From a31c2beac42230d1e9be5b7b4c8207a3d32ddc15 Mon Sep 17 00:00:00 2001 From: Katy Hinkelman Date: Fri, 29 Sep 2023 09:05:12 -0600 Subject: [PATCH 1/4] Revised IBPSA.Media.Steam to reflect changes made to Buildings.Media.Steam --- IBPSA/Media/Steam.mo | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/IBPSA/Media/Steam.mo b/IBPSA/Media/Steam.mo index 1c0853c52c..61979c8fa8 100644 --- a/IBPSA/Media/Steam.mo +++ b/IBPSA/Media/Steam.mo @@ -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}, @@ -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; @@ -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; @@ -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; @@ -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); @@ -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, @@ -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}}, @@ -915,6 +919,23 @@ properties of water and steam,” J. Eng. Gas Turbines Power, vol. 12

", revisions="