Skip to content

Commit 2fd34c8

Browse files
committed
Reformulated function to avoid binding eqn warning (maint 10)
For #4215
1 parent e65e5e6 commit 2fd34c8

2 files changed

Lines changed: 21 additions & 3 deletions

File tree

Buildings/HeatTransfer/Conduction/BaseClasses/der_temperature_u.mo

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,17 @@ function der_temperature_u
2020
each unit="kg.K2/J")
2121
"Derivatives dT/du at the support points";
2222
protected
23-
parameter Real scale=0.999 "Used to place points on the phase transition";
24-
Modelica.Units.SI.Temperature Tm1=TSol + (1 - scale)*(TLiq - TSol)
23+
constant Real scale=0.999 "Used to place points on the phase transition";
24+
Modelica.Units.SI.Temperature Tm1
2525
"Support point";
26-
Modelica.Units.SI.Temperature Tm2=TSol + scale*(TLiq - TSol)
26+
Modelica.Units.SI.Temperature Tm2
2727
"Support point";
2828
algorithm
2929
assert(Buildings.HeatTransfer.Conduction.nSupPCM == 6,
3030
"The material must have exactly 6 support points for the u(T) relation.");
3131
assert(TLiq > TSol, "TLiq has to be larger than TSol.");
32+
Tm1:=TSol + (1 - scale)*(TLiq - TSol);
33+
Tm2:=TSol + scale*(TLiq - TSol);
3234
// Get the derivative values at the support points
3335
ud:={c*scale*TSol,
3436
c*TSol,
@@ -61,6 +63,12 @@ to compute for a given specific internal energy the temperature.
6163
revisions="<html>
6264
<ul>
6365
<li>
66+
May 1, 2025, by Michael Wetter:<br/>
67+
Reformulated model to avoid warning about binding equation not being a parameter expression.<br/>
68+
This is for
69+
<a href=\"https://github.com/lbl-srg/modelica-buildings/issues/4215\">#4215</a>.
70+
</li>
71+
<li>
6472
August 30, 2024, by Michael Wetter:<br/>
6573
Removed wrong <code>parameter</code> declaration on a protected variable which causes an error in
6674
Dymola 2025x beta1.<br/>

Buildings/package.mo

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,16 @@ have been <b style=\"color:blue\">improved</b> in a
231231
<b style=\"color:blue\">backward compatible</b> way:
232232
</p>
233233
<table class=\"releaseTable\" summary=\"summary\" border=\"1\" cellspacing=\"0\" cellpadding=\"2\" style=\"border-collapse:collapse;\">
234+
<tr><td colspan=\"2\"><b>Buildings.HeatTransfer</b>
235+
</td>
236+
</tr>
237+
<tr><td valign=\"top\">Buildings.HeatTransfer.Conduction.BaseClasses.der_temperature_u
238+
</td>
239+
<td valign=\"top\">Reformulated model to avoid warning about binding equation not being a parameter expression.<br/>
240+
This is for
241+
<a href=\"https://github.com/lbl-srg/modelica-buildings/issues/4215\">#4215</a>.
242+
</td>
243+
</tr>
234244
<tr><td colspan=\"2\"><b>xxx</b>
235245
</td>
236246
</tr>

0 commit comments

Comments
 (0)