Skip to content

Commit

Permalink
Merge pull request #1800 from khinkelman/issue1793_steamDocumentation
Browse files Browse the repository at this point in the history
Issue1793 steam documentation
  • Loading branch information
mwetter authored Sep 29, 2023
2 parents c5f8684 + 4dca2d1 commit 5cab3e7
Showing 1 changed file with 46 additions and 9 deletions.
55 changes: 46 additions & 9 deletions IBPSA/Media/Steam.mo
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package Steam
reducedX=true,
fixedX=true,
FluidConstants={Modelica.Media.IdealGases.Common.FluidData.H2O},
ThermoStates=Modelica.Media.Interfaces.Choices.IndependentVariables.pTX,
reference_T=273.15,
reference_p=101325,
reference_X={1},
Expand Down Expand Up @@ -125,8 +126,8 @@ redeclare replaceable function extends specificEnthalpy
constant Temperature TMean = 4.15555698340926E+02 "Mean temperature";
constant Real pSD = 1.13236055019318E+05 "Normalization value";
constant Real TSD = 1.32971013463839E+01 "Normalization value";
AbsolutePressure pHat;
Temperature THat;
Modelica.Units.SI.PressureDifference pHat;
Modelica.Units.SI.TemperatureDifference THat;
algorithm
pHat := (state.p - pMean)/pSD;
THat := (state.T - TMean)/TSD;
Expand Down Expand Up @@ -170,8 +171,8 @@ redeclare replaceable function extends specificEntropy
constant Temperature TMean = 4.15555698340926E+02 "Mean temperature";
constant Real pSD = 1.13236055019318E+05 "Normalization value";
constant Real TSD = 1.32971013463839E+01 "Normalization value";
AbsolutePressure pHat;
Temperature THat;
Modelica.Units.SI.PressureDifference pHat;
Modelica.Units.SI.TemperatureDifference THat;
algorithm
pHat := (state.p - pMean)/pSD;
THat := (state.T - TMean)/TSD;
Expand Down Expand Up @@ -728,7 +729,7 @@ function temperature_ph
constant Temperature TMean = 4.15555698340926E+02 "Mean temperature";
constant Real pSD = 1.13236055019318E+05 "Normalization value";
constant Real TSD = 1.32971013463839E+01 "Normalization value";
AbsolutePressure pHat;
Modelica.Units.SI.PressureDifference pHat;
algorithm
pHat := (p - pMean)/pSD;
T := b[1] + b[2]*pHat + b[3]*h;
Expand Down Expand Up @@ -773,8 +774,8 @@ function temperature_ps
constant Temperature TMean = 4.15555698340926E+02 "Mean temperature";
constant Real pSD = 1.13236055019318E+05 "Normalization value";
constant Real TSD = 1.32971013463839E+01 "Normalization value";
AbsolutePressure pHat;
Temperature THat;
Modelica.Units.SI.PressureDifference pHat;
Modelica.Units.SI.TemperatureDifference THat;
algorithm
pHat := (p - pMean)/pSD;
THat := (s - a[1] - pHat*(a[2] + a[4]*pHat))/(a[3] + a[5]*pHat);
Expand Down Expand Up @@ -818,10 +819,14 @@ function rho_pT "Density as function of temperature and pressure"
Modelica.Media.Common.GibbsDerivs g
"Dimensionless Gibbs function and derivatives w.r.t. pi and tau";
SpecificHeatCapacity R "Specific gas constant of water vapor";
function g2_smooth
extends Modelica.Media.Water.IF97_Utilities.BaseIF97.Basic.g2;
annotation(smoothOrder=2);
end g2_smooth;
algorithm
R := Modelica.Media.Water.IF97_Utilities.BaseIF97.data.RH2O;
// Region 2 properties
g := Modelica.Media.Water.IF97_Utilities.BaseIF97.Basic.g2(p, T);
g := g2_smooth(p, T);
rho := p/(R*T*g.pi*g.gpi);
annotation (
Inline=true,
Expand All @@ -847,7 +852,6 @@ algorithm
region=2);
annotation (Inline=true);
end pressure_dT;

annotation (Icon(graphics={
Line(
points={{50,30},{30,10},{50,-10},{30,-30}},
Expand Down Expand Up @@ -913,9 +917,42 @@ steam heating processes involving low and medium pressure steam.
properties of water and steam,&rdquo; <i>J. Eng. Gas Turbines Power</i>, vol. 122, no.
1, pp. 150&ndash;180, 2000.
</p>
<p>
Kathryn Hinkelman, Saranya Anbarasu, Michael Wetter, Antoine Gautier, Wangda Zuo. 2022.
&ldquo;A Fast and Accurate Modeling Approach for Water and Steam
Thermodynamics with Practical Applications in District Heating System Simulation,&rdquo;
<i>Energy</i>, 254(A), pp. 124227.
<a href=\\\"https://doi.org/10.1016/j.energy.2022.124227\\\">10.1016/j.energy.2022.124227</a>
</p>
<p>
Kathryn Hinkelman, Saranya Anbarasu, Michael Wetter, Antoine Gautier, Baptiste Ravache, Wangda Zuo 2022.
&ldquo;Towards Open-Source Modelica Models For Steam-Based District Heating Systems.&rdquo;
<i>Proc. of the 1st International Workshop On Open Source Modelling And Simulation Of
Energy Systems (OSMSES 2022)</i>, Aachen, German, April 4-5, 2022.
<a href=\\\"https://doi.org/10.1109/OSMSES54027.2022.9769121\\\">10.1109/OSMSES54027.2022.9769121</a>
</p>
</html>", revisions="<html>
<ul>
<li>
September 29, 2023, by Kathryn Hinkelman:<br/>
Added publication references.
</li>
<li>
March 10, 2023, by Saranya Anbarasu:<br/>
Changed the variable type definition of <code>pHat</code> and <code>THat</code>
from absolute to <code>Modelica.Units.SI.PressureDifference</code> and
<code>Modelica.Units.SI.TemperatureDifference</code> to prevent min/max
assertion errors during initilization.
</li>
<li>
May 9, 2022, by David Blum:<br/>
In function <code>rho_pT</code>, created and used new function extending
<code>Modelica.Media.Water.IF97_Utilities.BaseIF97.Basic.g2</code> with an
annotation <code>smoothOrder=2</code>. This is to specifically pass on the
<code>smoothOrder=2</code> annotion placed on <code>rho_pT</code> to
the <code>g2</code> function.
</li>
<li>
April 13, 2021, by Kathryn Hinkelman:<br/>
Changed pressure from constant to variable and reduced applicable
pressure-temperature range to improve accuracy of polynomial approximations.
Expand Down

0 comments on commit 5cab3e7

Please sign in to comment.