Skip to content

Commit

Permalink
Correct unit error in assignment of gas constant (#2949)
Browse files Browse the repository at this point in the history
* Corrected unit error

This is for IBPSA, 1603
  • Loading branch information
mwetter authored Apr 6, 2022
1 parent 7ae23c6 commit 3050077
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
12 changes: 7 additions & 5 deletions Buildings/Media/Specialized/Water/TemperatureDependentDensity.mo
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@ package TemperatureDependentDensity
each casRegistryNumber="7732-18-5",
each iupacName="oxidane",
each molarMass=MM_const);

redeclare record extends ThermodynamicState "Thermodynamic state variables"
Temperature T(start=T_default) "Temperature of medium";
AbsolutePressure p(start=p_default) "Pressure of medium";
end ThermodynamicState;

constant Modelica.Units.SI.SpecificHeatCapacity cp_const=4184
"Specific heat capacity at constant pressure";

Expand All @@ -37,7 +35,7 @@ package TemperatureDependentDensity
d = density(state);
state.T = T;
state.p = p;
R_s = Modelica.Constants.R;
R_s = 0;
MM=MM_const;
annotation(Documentation(info="<html>
<p>
Expand Down Expand Up @@ -662,7 +660,6 @@ First implementation.
</ul>
</html>"));
end setState_psX;

//////////////////////////////////////////////////////////////////////
// Protected classes.
// These classes are only of use within this medium model.
Expand Down Expand Up @@ -786,7 +783,6 @@ but converted from Celsius to Kelvin.
</ul>
</html>"));
end kinematicViscosity;

annotation(preferredView="info", Documentation(info="<html>
<p>
This medium package models liquid water.
Expand Down Expand Up @@ -864,6 +860,12 @@ Phase changes are not modeled.
</html>", revisions="<html>
<ul>
<li>
April 5, 2022, by Michael Wetter:<br/>
Corrected assignment of <code>R_s</code> in <code>BaseProperties</code> to avoid a unit error.<br/>
This is for
<a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1603\">#1603</a>.
</li>
<li>
July 7, 2016, by Carles Ribas Tugores:<br/>
Correct Documentation. This is for
<a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/487\">#487</a>.
Expand Down
20 changes: 15 additions & 5 deletions Buildings/package.mo
Original file line number Diff line number Diff line change
Expand Up @@ -954,10 +954,10 @@ units are wrong or errors in documentation):
<a href=\"https://github.com/lbl-srg/modelica-buildings/issues/2706\">Buildings, issue 2706</a>.
</td>
</tr>
<tr><td colspan=\"2\"><b>Buildings.Electrical</b>
<tr><td colspan=\"2\"><b>Buildings.Electrical</b>
</td>
</tr>
<tr><td valign=\"top\">Buildings.Electrical.AC.OnePhase.Sources.PVSimple<br/>
</tr>
<tr><td valign=\"top\">Buildings.Electrical.AC.OnePhase.Sources.PVSimple<br/>
Buildings.Electrical.AC.OnePhase.Sources.PVSimpleOriented<br/>
Buildings.Electrical.AC.ThreePhasesBalanced.Sources.PVSimple<br/>
Buildings.Electrical.AC.ThreePhasesBalanced.Sources.PVSimpleOriented<br/>
Expand Down Expand Up @@ -986,7 +986,17 @@ units are wrong or errors in documentation):
<a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1563\">Buildings, #1563</a>.
</td>
</tr>
<tr><td colspan=\"2\"><b>Buildings.ThermalZones.Detailed</b>
<tr><td colspan=\"2\"><b>Buildings.Media</b>
</td>
</tr>
<tr><td valign=\"top\">Buildings.Media.Specialized.Water.TemperatureDependentDensity
</td>
<td valign=\"top\">Corrected assignment of gas constant which lead to a unit error.
This change does not affect the results as the value is not used for this liquid medium.<br/>
This is for <a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1603\">IBPSA, #1603</a>.
</td>
</tr>
<tr><td colspan=\"2\"><b>Buildings.ThermalZones.Detailed</b>
</td>
</tr>
<tr><td valign=\"top\">Buildings.ThermalZones.Detailed.BaseClasses.RadiationTemperature
Expand Down Expand Up @@ -10694,4 +10704,4 @@ requirements definition or providing feedback regarding the model applicability
to solve specific problems.
</p>
</html>"));
end Buildings;
end Buildings;

0 comments on commit 3050077

Please sign in to comment.