Skip to content

Commit d3d0f41

Browse files
authored
Reformulated function to avoid binding equation not a parameter expression warning (#4216)
For 4215
1 parent 0cab92a commit d3d0f41

2 files changed

Lines changed: 25 additions & 7 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/UsersGuide/ReleaseNotes/Version_12_0_1.mo

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ have been <b style=\"color:blue\">improved</b> in a
5353
Buildings.Utilities.Clustering
5454
</td>
5555
</tr>
56+
<tr><td valign=\"top\">Buildings.Utilities.Clustering.KMeans
57+
</td>
58+
<td valign=\"top\">Improved code to avoid an error during initialization of certain borefield geometries.<br/>
59+
This is for <a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1985\">IBPSA, #1985</a> and
60+
<a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1976\">IBPSA, #1976</a>.
61+
</td>
62+
</tr>
5663
<tr><td colspan=\"2\"><b>Buildings.Electrical</b>
5764
</td>
5865
</tr>
@@ -63,11 +70,14 @@ have been <b style=\"color:blue\">improved</b> in a
6370
This is for <a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1996\">IBPSA, #1996</a>.
6471
</td>
6572
</tr>
66-
<tr><td valign=\"top\">Buildings.Utilities.Clustering.KMeans
73+
<tr><td colspan=\"2\"><b>Buildings.HeatTransfer</b>
6774
</td>
68-
<td valign=\"top\">Improved code to avoid an error during initialization of certain borefield geometries.<br/>
69-
This is for <a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1985\">IBPSA, #1985</a> and
70-
<a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1976\">IBPSA, #1976</a>.
75+
</tr>
76+
<tr><td valign=\"top\">Buildings.HeatTransfer.Conduction.BaseClasses.der_temperature_u
77+
</td>
78+
<td valign=\"top\">Reformulated model to avoid warning about binding equation not being a parameter expression.<br/>
79+
This is for
80+
<a href=\"https://github.com/lbl-srg/modelica-buildings/issues/4215\">#4215</a>.
7181
</td>
7282
</tr>
7383
<tr><td colspan=\"2\"><b>xxx</b>

0 commit comments

Comments
 (0)