Buildings.Media.Steam

Package with model for pure steam water vapor

Information

This medium package models water vapor (pure steam, region 2, quality=1).

Thermodynamic properties are calculated primarily in terms of pressure and temperature. For thermodynamic property functions, the IAPWS-IF97 formulations are adapted, and approximate relationships are provided for commonly used functions to improve computational efficiency and provide backward compatability.

Detailed functions from Modelica.Media.Water.WaterIF97_R2pT are generally used, except for Buildings.Media.Steam.specificEnthalpy and Buildings.Media.Steam.specificEntropy (both "forward" functions), as well as their "backward" inverse functions Buildings.Media.Steam.temperature_ph and Buildings.Media.Steam.temperature_ps, which are numerically consistent with the forward functions. The following modifications were made relative to the Modelica.Media.Water.WaterIF97_R2pT medium package:

  1. Analytic expressions for the derivatives are provided for all thermodynamic property functions.
  2. The implementation is generally simpler in order to increase the likelihood of more efficient simulations.

Limitations

Applications

This model is intended for first generation district heating systems and other steam heating processes involving low and medium pressure steam.

References

W. Wagner et al., “The IAPWS industrial formulation 1997 for the thermodynamic properties of water and steam,” J. Eng. Gas Turbines Power, vol. 122, no. 1, pp. 150–180, 2000.

Kathryn Hinkelman, Saranya Anbarasu, Michael Wetter, Antoine Gautier, Wangda Zuo. 2022. “A Fast and Accurate Modeling Approach for Water and Steam Thermodynamics with Practical Applications in District Heating System Simulation,” Energy, 254(A), pp. 124227. 10.1016/j.energy.2022.124227

Kathryn Hinkelman, Saranya Anbarasu, Michael Wetter, Antoine Gautier, Baptiste Ravache, Wangda Zuo 2022. “Towards Open-Source Modelica Models For Steam-Based District Heating Systems.” Proc. of the 1st International Workshop On Open Source Modelling And Simulation Of Energy Systems (OSMSES 2022), Aachen, German, April 4-5, 2022. 10.1109/OSMSES54027.2022.9769121

Extends from Modelica.Media.Interfaces.PartialMedium (Partial medium properties (base package of all media packages)), Modelica.Icons.Package (Icon for standard packages).

Package Content

Name Description
Buildings.Media.Steam.ThermodynamicState ThermodynamicState Thermodynamic state variables
Buildings.Media.Steam.BaseProperties BaseProperties Base properties (p, d, T, h, u, R, MM) of water
Buildings.Media.Steam.density density Returns density
Buildings.Media.Steam.dynamicViscosity dynamicViscosity Return dynamic viscosity
Buildings.Media.Steam.molarMass molarMass Return the molar mass of the medium
Buildings.Media.Steam.pressure pressure Return pressure
Buildings.Media.Steam.saturationPressure saturationPressure Return saturation pressure of condensing fluid
Buildings.Media.Steam.saturationTemperature saturationTemperature Return saturation temperature
Buildings.Media.Steam.specificEnthalpy specificEnthalpy Returns specific enthalpy
Buildings.Media.Steam.specificEntropy specificEntropy Return specific entropy
Buildings.Media.Steam.specificInternalEnergy specificInternalEnergy Return specific internal energy
Buildings.Media.Steam.specificHeatCapacityCp specificHeatCapacityCp Specific heat capacity at constant pressure
Buildings.Media.Steam.specificHeatCapacityCv specificHeatCapacityCv Specific heat capacity at constant volume
Buildings.Media.Steam.specificGibbsEnergy specificGibbsEnergy Specific Gibbs energy
Buildings.Media.Steam.specificHelmholtzEnergy specificHelmholtzEnergy Specific Helmholtz energy
Buildings.Media.Steam.setState_dTX setState_dTX Return the thermodynamic state as function of d and T
Buildings.Media.Steam.setState_pTX setState_pTX Return the thermodynamic state as function of p and T
Buildings.Media.Steam.setState_phX setState_phX Return the thermodynamic state as function of p and h
Buildings.Media.Steam.setState_psX setState_psX Return the thermodynamic state as function of p and s
Buildings.Media.Steam.temperature temperature Return temperature
Buildings.Media.Steam.thermalConductivity thermalConductivity Return thermal conductivity
Buildings.Media.Steam.density_derh_p density_derh_p Density derivative by specific enthalpy
Buildings.Media.Steam.density_derp_h density_derp_h Density derivative by pressure
Buildings.Media.Steam.isentropicExponent isentropicExponent Return isentropic exponent
Buildings.Media.Steam.isothermalCompressibility isothermalCompressibility Isothermal compressibility of water
Buildings.Media.Steam.isobaricExpansionCoefficient isobaricExpansionCoefficient Isobaric expansion coefficient of water
Buildings.Media.Steam.isentropicEnthalpy isentropicEnthalpy Isentropic enthalpy
Buildings.Media.Steam.GasProperties GasProperties Coefficient data record for properties of perfect gases
steam Steam properties
Buildings.Media.Steam.g2 g2 Gibbs function for region 2: g(p,T)
Buildings.Media.Steam.temperature_ph temperature_ph Return temperature from p and h, inverse function of h(p,T)
Buildings.Media.Steam.temperature_ps temperature_ps Return temperature from p and s, inverse function of s(p,T)
Buildings.Media.Steam.rho_pT rho_pT Density as function of temperature and pressure
Buildings.Media.Steam.pressure_dT pressure_dT Computes pressure as a function of density and temperature
Inherited
ThermoStates=Modelica.Media.Interfaces.Choices.IndependentVariables.pTX Enumeration type for independent variables
mediumName="steam" Name of the medium
substanceNames={"water"} Names of the mixture substances. Set substanceNames={mediumName} if only one substance.
extraPropertiesNames=fill("", 0) Names of the additional (extra) transported properties. Set extraPropertiesNames=fill("",0) if unused
singleState=true = true, if u and d are not a function of pressure
reducedX=true = true if medium contains the equation sum(X) = 1.0; set reducedX=true if only one substance (see docu for details)
fixedX=true = true if medium contains the equation X = reference_X
reference_p=101325 Reference pressure of Medium: default 1 atmosphere
reference_T=273.15 Reference temperature of Medium: default 25 deg Celsius
reference_X={1} Default mass fractions of medium
p_default=100000 Default value for pressure of medium (for initialization)
T_default=Modelica.Units.Conversions.from_degC(100) Default value for temperature of medium (for initialization)
h_default=specificEnthalpy_pTX(p_default, T_default, X_default) Default value for specific enthalpy of medium (for initialization)
X_default=reference_X Default value for mass fractions of medium (for initialization)
C_default=fill(0, nC) Default value for trace substances of medium (for initialization)
nS=size(substanceNames, 1) Number of substances
nX=nS Number of mass fractions
nXi=if fixedX then 0 else if reducedX then nS - 1 else nS Number of structurally independent mass fractions (see docu for details)
nC=size(extraPropertiesNames, 1) Number of extra (outside of standard mass-balance) transported properties
C_nominal=1.0e-6*ones(nC) Default for the nominal values for the extra properties
Modelica.Media.Interfaces.PartialMedium.FluidConstants FluidConstants Critical, triple, molecular and other standard data of fluid
Modelica.Media.Interfaces.PartialMedium.setSmoothState setSmoothState Return thermodynamic state so that it smoothly approximates: if x > 0 then state_a else state_b
Modelica.Media.Interfaces.PartialMedium.prandtlNumber prandtlNumber Return the Prandtl number
Modelica.Media.Interfaces.PartialMedium.heatCapacity_cp heatCapacity_cp Alias for deprecated name
Modelica.Media.Interfaces.PartialMedium.heatCapacity_cv heatCapacity_cv Alias for deprecated name
Modelica.Media.Interfaces.PartialMedium.velocityOfSound velocityOfSound Return velocity of sound
Modelica.Media.Interfaces.PartialMedium.beta beta Alias for isobaricExpansionCoefficient for user convenience
Modelica.Media.Interfaces.PartialMedium.kappa kappa Alias of isothermalCompressibility for user convenience
Modelica.Media.Interfaces.PartialMedium.density_derp_T density_derp_T Return density derivative w.r.t. pressure at const temperature
Modelica.Media.Interfaces.PartialMedium.density_derT_p density_derT_p Return density derivative w.r.t. temperature at constant pressure
Modelica.Media.Interfaces.PartialMedium.density_derX density_derX Return density derivative w.r.t. mass fraction
Modelica.Media.Interfaces.PartialMedium.specificEnthalpy_pTX specificEnthalpy_pTX Return specific enthalpy from p, T, and X or Xi
Modelica.Media.Interfaces.PartialMedium.specificEntropy_pTX specificEntropy_pTX Return specific enthalpy from p, T, and X or Xi
Modelica.Media.Interfaces.PartialMedium.density_pTX density_pTX Return density from p, T, and X or Xi
Modelica.Media.Interfaces.PartialMedium.temperature_phX temperature_phX Return temperature from p, h, and X or Xi
Modelica.Media.Interfaces.PartialMedium.density_phX density_phX Return density from p, h, and X or Xi
Modelica.Media.Interfaces.PartialMedium.temperature_psX temperature_psX Return temperature from p,s, and X or Xi
Modelica.Media.Interfaces.PartialMedium.density_psX density_psX Return density from p, s, and X or Xi
Modelica.Media.Interfaces.PartialMedium.specificEnthalpy_psX specificEnthalpy_psX Return specific enthalpy from p, s, and X or Xi
Modelica.Media.Interfaces.PartialMedium.MassFlowRate MassFlowRate Type for mass flow rate with medium specific attributes
Modelica.Media.Interfaces.Types.AbsolutePressure AbsolutePressure Type for absolute pressure with medium specific attributes
Modelica.Media.Interfaces.Types.Density Density Type for density with medium specific attributes
Modelica.Media.Interfaces.Types.DynamicViscosity DynamicViscosity Type for dynamic viscosity with medium specific attributes
Modelica.Media.Interfaces.Types.EnthalpyFlowRate EnthalpyFlowRate Type for enthalpy flow rate with medium specific attributes
Modelica.Media.Interfaces.Types.MassFraction MassFraction Type for mass fraction with medium specific attributes
Modelica.Media.Interfaces.Types.MoleFraction MoleFraction Type for mole fraction with medium specific attributes
Modelica.Media.Interfaces.Types.MolarMass MolarMass Type for molar mass with medium specific attributes
Modelica.Media.Interfaces.Types.MolarVolume MolarVolume Type for molar volume with medium specific attributes
Modelica.Media.Interfaces.Types.IsentropicExponent IsentropicExponent Type for isentropic exponent with medium specific attributes
Modelica.Media.Interfaces.Types.SpecificEnergy SpecificEnergy Type for specific energy with medium specific attributes
Modelica.Media.Interfaces.Types.SpecificInternalEnergy SpecificInternalEnergy Type for specific internal energy with medium specific attributes
Modelica.Media.Interfaces.Types.SpecificEnthalpy SpecificEnthalpy Type for specific enthalpy with medium specific attributes
Modelica.Media.Interfaces.Types.SpecificEntropy SpecificEntropy Type for specific entropy with medium specific attributes
Modelica.Media.Interfaces.Types.SpecificHeatCapacity SpecificHeatCapacity Type for specific heat capacity with medium specific attributes
Modelica.Media.Interfaces.Types.SurfaceTension SurfaceTension Type for surface tension with medium specific attributes
Modelica.Media.Interfaces.Types.Temperature Temperature Type for temperature with medium specific attributes
Modelica.Media.Interfaces.Types.ThermalConductivity ThermalConductivity Type for thermal conductivity with medium specific attributes
Modelica.Media.Interfaces.Types.PrandtlNumber PrandtlNumber Type for Prandtl number with medium specific attributes
Modelica.Media.Interfaces.Types.VelocityOfSound VelocityOfSound Type for velocity of sound with medium specific attributes
Modelica.Media.Interfaces.Types.ExtraProperty ExtraProperty Type for unspecified, mass-specific property transported by flow
Modelica.Media.Interfaces.Types.CumulativeExtraProperty CumulativeExtraProperty Type for conserved integral of unspecified, mass specific property
Modelica.Media.Interfaces.Types.ExtraPropertyFlowRate ExtraPropertyFlowRate Type for flow rate of unspecified, mass-specific property
Modelica.Media.Interfaces.Types.IsobaricExpansionCoefficient IsobaricExpansionCoefficient Type for isobaric expansion coefficient with medium specific attributes
Modelica.Media.Interfaces.Types.DipoleMoment DipoleMoment Type for dipole moment with medium specific attributes
Modelica.Media.Interfaces.Types.DerDensityByPressure DerDensityByPressure Type for partial derivative of density with respect to pressure with medium specific attributes
Modelica.Media.Interfaces.Types.DerDensityByEnthalpy DerDensityByEnthalpy Type for partial derivative of density with respect to enthalpy with medium specific attributes
Modelica.Media.Interfaces.Types.DerEnthalpyByPressure DerEnthalpyByPressure Type for partial derivative of enthalpy with respect to pressure with medium specific attributes
Modelica.Media.Interfaces.Types.DerDensityByTemperature DerDensityByTemperature Type for partial derivative of density with respect to temperature with medium specific attributes
Modelica.Media.Interfaces.Types.DerTemperatureByPressure DerTemperatureByPressure Type for partial derivative of temperature with respect to pressure with medium specific attributes
Modelica.Media.Interfaces.Types.SaturationProperties SaturationProperties Saturation properties of two phase medium
Modelica.Media.Interfaces.Types.FluidLimits FluidLimits Validity limits for fluid model
Modelica.Media.Interfaces.Types.FixedPhase FixedPhase Phase of the fluid: 1 for 1-phase, 2 for two-phase, 0 for not known, e.g., interactive use
Modelica.Media.Interfaces.Types.Basic Basic The most basic version of a record used in several degrees of detail
Modelica.Media.Interfaces.Types.IdealGas IdealGas The ideal gas version of a record used in several degrees of detail
Modelica.Media.Interfaces.Types.TwoPhase TwoPhase The two phase fluid version of a record used in several degrees of detail

Types and constants

  constant GasProperties steam(R=Modelica.Media.IdealGases.Common.SingleGasesData.H2O.R_s,
      MM=Modelica.Media.IdealGases.Common.SingleGasesData.H2O.MM)
    "Steam properties";

Buildings.Media.Steam.ThermodynamicState

Thermodynamic state variables

Modelica definition

redeclare record ThermodynamicState "Thermodynamic state variables" AbsolutePressure p "Absolute pressure of medium"; Temperature T "Temperature of medium"; end ThermodynamicState;

Buildings.Media.Steam.BaseProperties Buildings.Media.Steam.BaseProperties

Base properties (p, d, T, h, u, R, MM) of water

Information

Extends from (Base properties (p, d, T, h, u, R_s, MM and, if applicable, X and Xi) of a medium).

Parameters

TypeNameDefaultDescription
BooleanstandardOrderComponentstrueIf true, and reducedX = true, the last element of X will be computed from the other ones
Advanced
BooleanpreferredMediumStatestrue= true if StateSelect.prefer shall be used for the independent property variables of the medium

Modelica definition

redeclare replaceable model extends BaseProperties( preferredMediumStates = true, final standardOrderComponents=true) "Base properties (p, d, T, h, u, R, MM) of water" equation MM = steam.MM; h = specificEnthalpy(state); d = density(state); u = h - p/d; R_s = steam.R; state.p = p; state.T = T; end BaseProperties;

Buildings.Media.Steam.density Buildings.Media.Steam.density

Returns density

Information

Density is computed from temperature and pressure using the IAPWS-IF97 relationship via the Gibbs free energy for region 2.

Extends from (Return density).

Inputs

TypeNameDefaultDescription
ThermodynamicStatestate Thermodynamic state record

Outputs

TypeNameDescription
DensitydDensity [kg/m3]

Modelica definition

redeclare replaceable function extends density "Returns density" algorithm d := rho_pT(state.p, state.T); end density;

Buildings.Media.Steam.dynamicViscosity Buildings.Media.Steam.dynamicViscosity

Return dynamic viscosity

Information

Dynamic viscosity is computed from density, temperature and pressure using the IAPWS-IF97 formulation.

Extends from (Return dynamic viscosity).

Inputs

TypeNameDefaultDescription
ThermodynamicStatestate Thermodynamic state record

Outputs

TypeNameDescription
DynamicViscosityetaDynamic viscosity [Pa.s]

Modelica definition

redeclare replaceable function extends dynamicViscosity "Return dynamic viscosity" algorithm eta := Modelica.Media.Water.IF97_Utilities.dynamicViscosity( d=density(state), T=state.T, p=state.p); end dynamicViscosity;

Buildings.Media.Steam.molarMass Buildings.Media.Steam.molarMass

Return the molar mass of the medium

Information

Returns the molar mass.

Extends from (Return the molar mass of the medium).

Inputs

TypeNameDefaultDescription
ThermodynamicStatestate Thermodynamic state record

Outputs

TypeNameDescription
MolarMassMMMixture molar mass [kg/mol]

Modelica definition

redeclare replaceable function extends molarMass "Return the molar mass of the medium" algorithm MM := steam.MM; end molarMass;

Buildings.Media.Steam.pressure Buildings.Media.Steam.pressure

Return pressure

Information

Pressure is returned from the thermodynamic state record input as a simple assignment.

Extends from (Return pressure).

Inputs

TypeNameDefaultDescription
ThermodynamicStatestate Thermodynamic state record

Outputs

TypeNameDescription
AbsolutePressurepPressure [Pa]

Modelica definition

redeclare function extends pressure "Return pressure" algorithm p := state.p; end pressure;

Buildings.Media.Steam.saturationPressure Buildings.Media.Steam.saturationPressure

Return saturation pressure of condensing fluid

Information

Saturation pressure is computed from temperature using the IAPWS-IF97 formulation.

Extends from Modelica.Icons.Function (Icon for functions).

Inputs

TypeNameDefaultDescription
TemperatureTsat Saturation temperature [K]

Outputs

TypeNameDescription
AbsolutePressurepsatSaturation pressure [Pa]

Modelica definition

replaceable function saturationPressure "Return saturation pressure of condensing fluid" extends Modelica.Icons.Function; input Temperature Tsat "Saturation temperature"; output AbsolutePressure psat "Saturation pressure"; algorithm psat := Modelica.Media.Water.IF97_Utilities.BaseIF97.Basic.psat(Tsat); end saturationPressure;

Buildings.Media.Steam.saturationTemperature

Return saturation temperature

Information

Saturation temperature is computed from pressure using the IAPWS-IF97 formulation.

Inputs

TypeNameDefaultDescription
AbsolutePressurepsat Saturation pressure [Pa]

Outputs

TypeNameDescription
TemperatureTsatSaturation temperature [K]

Modelica definition

replaceable function saturationTemperature "Return saturation temperature" input AbsolutePressure psat "Saturation pressure"; output Temperature Tsat "Saturation temperature"; algorithm Tsat := Modelica.Media.Water.IF97_Utilities.BaseIF97.Basic.tsat(psat); end saturationTemperature;

Buildings.Media.Steam.specificEnthalpy Buildings.Media.Steam.specificEnthalpy

Returns specific enthalpy

Information

Returns the specific enthalpy.

Implementation

The function is based on Modelica.Media.Water.WaterIF97_base.specificEnthalpy_pT. However, for the typical range of temperatures and pressures encountered in building and district energy applications, a linear function sufficies. This implementation is therefore a linear surface fit of the IF97 formulation h(p,T) in the ranges of 100°C ≤ T ≤ 160°C and 100 kPa ≤ p ≤ 550 kPa. The fit is scaled by the dataset's mean and standard deviation values to improve conditioning. The largest error of this linearization is 2.42 kJ/kg (0.09%), which occurs at 100.6°C and 100 kPa. The root mean square error (RMSE) is 0.76 kJ/kg.

Extends from (Return specific enthalpy).

Inputs

TypeNameDefaultDescription
ThermodynamicStatestate Thermodynamic state record

Outputs

TypeNameDescription
SpecificEnthalpyhSpecific enthalpy [J/kg]

Modelica definition

redeclare replaceable function extends specificEnthalpy "Returns specific enthalpy" protected constant Real a[:] = {2.749e+06,-9118,2.752e+04} "Regression coefficients"; constant AbsolutePressure pMean = 2.50427896656637E+05 "Mean pressure"; constant Temperature TMean = 4.15555698340926E+02 "Mean temperature"; constant Real pSD = 1.13236055019318E+05 "Normalization value"; constant Real TSD = 1.32971013463839E+01 "Normalization value"; Modelica.Units.SI.PressureDifference pHat; Modelica.Units.SI.TemperatureDifference THat; algorithm pHat := (state.p - pMean)/pSD; THat := (state.T - TMean)/TSD; h := a[1] + a[2]*pHat + a[3]*THat; end specificEnthalpy;

Buildings.Media.Steam.specificEntropy Buildings.Media.Steam.specificEntropy

Return specific entropy

Information

Returns the specific entropy.

Implementation

The function is based on Modelica.Media.Water.WaterIF97_base.specificEntropy. However, for the typical range of temperatures and pressures encountered in building and district energy applications, an invertible polynomial fit sufficies. This implementation is therefore a polynomial fit (quadratic in pressure, linear in temperature) of the IF97 formulation s(p,T) in the ranges of 100°C ≤ T ≤ 160°C and 100 kPa ≤ p ≤ 550 kPa. The fit is scaled by the dataset's mean and standard deviation values to improve conditioning. The largest error of this approximation is 0.047 kJ/kg-K (0.70%), which occurs at 160°C and 550 kPa. The root mean square error (RMSE) is 12.56 J/kg-K.

Extends from (Return specific entropy).

Inputs

TypeNameDefaultDescription
ThermodynamicStatestate Thermodynamic state record

Outputs

TypeNameDescription
SpecificEntropysSpecific entropy [J/(kg.K)]

Modelica definition

redeclare replaceable function extends specificEntropy "Return specific entropy" protected constant Real a[:] = {7135,-252.4,70.03,40.6,4.953} "Regression coefficients"; constant AbsolutePressure pMean = 2.50427896656637E+05 "Mean pressure"; constant Temperature TMean = 4.15555698340926E+02 "Mean temperature"; constant Real pSD = 1.13236055019318E+05 "Normalization value"; constant Real TSD = 1.32971013463839E+01 "Normalization value"; Modelica.Units.SI.PressureDifference pHat; Modelica.Units.SI.TemperatureDifference THat; algorithm pHat := (state.p - pMean)/pSD; THat := (state.T - TMean)/TSD; s := a[1] + a[2]*pHat + a[3]*THat + pHat*(a[4]*pHat + a[5]*THat); end specificEntropy;

Buildings.Media.Steam.specificInternalEnergy Buildings.Media.Steam.specificInternalEnergy

Return specific internal energy

Information

Returns the specific internal energy for a given state.

Extends from (Return specific internal energy).

Inputs

TypeNameDefaultDescription
ThermodynamicStatestate Thermodynamic state record

Outputs

TypeNameDescription
SpecificEnergyuSpecific internal energy [J/kg]

Modelica definition

redeclare replaceable function extends specificInternalEnergy "Return specific internal energy" algorithm u := specificEnthalpy(state) - state.p/density(state); end specificInternalEnergy;

Buildings.Media.Steam.specificHeatCapacityCp Buildings.Media.Steam.specificHeatCapacityCp

Specific heat capacity at constant pressure

Information

Specific heat at constant pressure is computed from temperature and pressure using the IAPWS-IF97 relationship via the Gibbs free energy for region 2.

Extends from (Return specific heat capacity at constant pressure).

Inputs

TypeNameDefaultDescription
ThermodynamicStatestate Thermodynamic state record

Outputs

TypeNameDescription
SpecificHeatCapacitycpSpecific heat capacity at constant pressure [J/(kg.K)]

Modelica definition

redeclare replaceable function extends specificHeatCapacityCp "Specific heat capacity at constant pressure" protected Modelica.Media.Common.GibbsDerivs g "Dimensionless Gibbs function and derivatives w.r.t. pi and tau"; SpecificHeatCapacity R "Specific gas constant of water vapor"; algorithm R := Modelica.Media.Water.IF97_Utilities.BaseIF97.data.RH2O; // Region 2 properties g := g2(state.p, state.T); cp := -R*g.tau*g.tau*g.gtautau; end specificHeatCapacityCp;

Buildings.Media.Steam.specificHeatCapacityCv Buildings.Media.Steam.specificHeatCapacityCv

Specific heat capacity at constant volume

Information

Specific heat at constant volume is computed from temperature and pressure using the IAPWS-IF97 relationship via the Gibbs free energy for region 2.

Extends from (Return specific heat capacity at constant volume).

Inputs

TypeNameDefaultDescription
ThermodynamicStatestate Thermodynamic state record

Outputs

TypeNameDescription
SpecificHeatCapacitycvSpecific heat capacity at constant volume [J/(kg.K)]

Modelica definition

redeclare replaceable function extends specificHeatCapacityCv "Specific heat capacity at constant volume" protected Modelica.Media.Common.GibbsDerivs g "Dimensionless Gibbs function and derivatives w.r.t. pi and tau"; SpecificHeatCapacity R "Specific gas constant of water vapor"; algorithm R := Modelica.Media.Water.IF97_Utilities.BaseIF97.data.RH2O; // Region 2 properties g := g2(state.p, state.T); cv := R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi)); end specificHeatCapacityCv;

Buildings.Media.Steam.specificGibbsEnergy Buildings.Media.Steam.specificGibbsEnergy

Specific Gibbs energy

Information

Extends from (Return specific Gibbs energy).

Inputs

TypeNameDefaultDescription
ThermodynamicStatestate Thermodynamic state record

Outputs

TypeNameDescription
SpecificEnergygSpecific Gibbs energy [J/kg]

Modelica definition

redeclare replaceable function extends specificGibbsEnergy "Specific Gibbs energy" algorithm g := specificEnthalpy(state) - state.T*specificEntropy(state); end specificGibbsEnergy;

Buildings.Media.Steam.specificHelmholtzEnergy Buildings.Media.Steam.specificHelmholtzEnergy

Specific Helmholtz energy

Information

Returns the specific Helmholtz energy for a given state.

Extends from (Return specific Helmholtz energy).

Inputs

TypeNameDefaultDescription
ThermodynamicStatestate Thermodynamic state record

Outputs

TypeNameDescription
SpecificEnergyfSpecific Helmholtz energy [J/kg]

Modelica definition

redeclare replaceable function extends specificHelmholtzEnergy "Specific Helmholtz energy" algorithm f := specificEnthalpy(state) - steam.R*state.T - state.T*specificEntropy(state); end specificHelmholtzEnergy;

Buildings.Media.Steam.setState_dTX Buildings.Media.Steam.setState_dTX

Return the thermodynamic state as function of d and T

Information

The thermodynamic state record is computed from density d and temperature T.

Extends from (Return thermodynamic state as function of d, T and composition X or Xi).

Inputs

TypeNameDefaultDescription
Densityd Density [kg/m3]
TemperatureT Temperature [K]
MassFractionX[:]reference_XMass fractions [kg/kg]

Outputs

TypeNameDescription
ThermodynamicStatestateThermodynamic state record

Modelica definition

redeclare replaceable function extends setState_dTX "Return the thermodynamic state as function of d and T" algorithm state := ThermodynamicState(p=pressure_dT(d,T), T=T); end setState_dTX;

Buildings.Media.Steam.setState_pTX Buildings.Media.Steam.setState_pTX

Return the thermodynamic state as function of p and T

Information

The thermodynamic state record is computed from pressure p and temperature T.

Extends from (Return thermodynamic state as function of p, T and composition X or Xi).

Inputs

TypeNameDefaultDescription
AbsolutePressurep Pressure [Pa]
TemperatureT Temperature [K]
MassFractionX[:]reference_XMass fractions [kg/kg]

Outputs

TypeNameDescription
ThermodynamicStatestateThermodynamic state record

Modelica definition

redeclare replaceable function extends setState_pTX "Return the thermodynamic state as function of p and T" algorithm state := ThermodynamicState(p=p, T=T); end setState_pTX;

Buildings.Media.Steam.setState_phX Buildings.Media.Steam.setState_phX

Return the thermodynamic state as function of p and h

Information

The thermodynamic state record is computed from pressure p and specific enthalpy h.

Extends from (Return thermodynamic state as function of p, h and composition X or Xi).

Inputs

TypeNameDefaultDescription
AbsolutePressurep Pressure [Pa]
SpecificEnthalpyh Specific enthalpy [J/kg]
MassFractionX[:]reference_XMass fractions [kg/kg]

Outputs

TypeNameDescription
ThermodynamicStatestateThermodynamic state record

Modelica definition

redeclare replaceable function extends setState_phX "Return the thermodynamic state as function of p and h" algorithm state := ThermodynamicState(p=p, T=temperature_ph(p,h)); end setState_phX;

Buildings.Media.Steam.setState_psX Buildings.Media.Steam.setState_psX

Return the thermodynamic state as function of p and s

Information

The thermodynamic state record is computed from pressure p and specific entropy s.

Extends from (Return thermodynamic state as function of p, s and composition X or Xi).

Inputs

TypeNameDefaultDescription
AbsolutePressurep Pressure [Pa]
SpecificEntropys Specific entropy [J/(kg.K)]
MassFractionX[:]reference_XMass fractions [kg/kg]

Outputs

TypeNameDescription
ThermodynamicStatestateThermodynamic state record

Modelica definition

redeclare replaceable function extends setState_psX "Return the thermodynamic state as function of p and s" algorithm state := ThermodynamicState(p=p, T=temperature_ps(p,s)); end setState_psX;

Buildings.Media.Steam.temperature Buildings.Media.Steam.temperature

Return temperature

Information

Temperature is returned from the thermodynamic state record input as a simple assignment.

Extends from (Return temperature).

Inputs

TypeNameDefaultDescription
ThermodynamicStatestate Thermodynamic state record

Outputs

TypeNameDescription
TemperatureTTemperature [K]

Modelica definition

redeclare function extends temperature "Return temperature" algorithm T := state.T; end temperature;

Buildings.Media.Steam.thermalConductivity Buildings.Media.Steam.thermalConductivity

Return thermal conductivity

Information

Thermal conductivity is computed from density, temperature and pressure using the IAPWS-IF97 formulation.

Extends from (Return thermal conductivity).

Inputs

TypeNameDefaultDescription
ThermodynamicStatestate Thermodynamic state record

Outputs

TypeNameDescription
ThermalConductivitylambdaThermal conductivity [W/(m.K)]

Modelica definition

redeclare replaceable function extends thermalConductivity "Return thermal conductivity" algorithm lambda := Modelica.Media.Water.IF97_Utilities.thermalConductivity( density(state), state.T, state.p); end thermalConductivity;

Buildings.Media.Steam.density_derh_p Buildings.Media.Steam.density_derh_p

Density derivative by specific enthalpy

Information

Returns the partial derivative of density with respect to specific enthalpy at constant pressure using the IAPWS-IF97 formulation.

Extends from (Return density derivative w.r.t. specific enthalpy at constant pressure).

Inputs

TypeNameDefaultDescription
ThermodynamicStatestate Thermodynamic state record

Outputs

TypeNameDescription
DerDensityByEnthalpyddhpDensity derivative w.r.t. specific enthalpy [kg.s2/m5]

Modelica definition

redeclare function extends density_derh_p "Density derivative by specific enthalpy" algorithm ddhp := Modelica.Media.Water.IF97_Utilities.ddhp( p = state.p, h = specificEnthalpy(state), phase = 1, region = 2); end density_derh_p;

Buildings.Media.Steam.density_derp_h Buildings.Media.Steam.density_derp_h

Density derivative by pressure

Information

Returns the partial derivative of density with respect to pressure at constant specific enthalpy using the IAPWS-IF97 formulation.

Extends from (Return density derivative w.r.t. pressure at const specific enthalpy).

Inputs

TypeNameDefaultDescription
ThermodynamicStatestate Thermodynamic state record

Outputs

TypeNameDescription
DerDensityByPressureddphDensity derivative w.r.t. pressure [s2/m2]

Modelica definition

redeclare function extends density_derp_h "Density derivative by pressure" algorithm ddph := Modelica.Media.Water.IF97_Utilities.ddph( p = state.p, h = specificEnthalpy(state), phase = 1, region = 2); end density_derp_h;

Buildings.Media.Steam.isentropicExponent Buildings.Media.Steam.isentropicExponent

Return isentropic exponent

Information

Isentropic exponent is computed from temperature and pressure using the IAPWS-IF97 formulation.

Extends from (Return isentropic exponent).

Inputs

TypeNameDefaultDescription
ThermodynamicStatestate Thermodynamic state record

Outputs

TypeNameDescription
IsentropicExponentgammaIsentropic exponent [1]

Modelica definition

redeclare replaceable function extends isentropicExponent "Return isentropic exponent" algorithm gamma := Modelica.Media.Water.IF97_Utilities.isentropicExponent_pT( p = state.p, T = state.T, region = 2); end isentropicExponent;

Buildings.Media.Steam.isothermalCompressibility Buildings.Media.Steam.isothermalCompressibility

Isothermal compressibility of water

Information

Isothermal compressibility is computed from temperature and pressure using the IAPWS-IF97 formulation.

Extends from (Return overall the isothermal compressibility factor).

Inputs

TypeNameDefaultDescription
ThermodynamicStatestate Thermodynamic state record

Outputs

TypeNameDescription
IsothermalCompressibilitykappaIsothermal compressibility [1/Pa]

Modelica definition

redeclare replaceable function extends isothermalCompressibility "Isothermal compressibility of water" algorithm kappa := Modelica.Media.Water.IF97_Utilities.kappa_pT( p = state.p, T = state.T, region = 2); end isothermalCompressibility;

Buildings.Media.Steam.isobaricExpansionCoefficient Buildings.Media.Steam.isobaricExpansionCoefficient

Isobaric expansion coefficient of water

Information

Isobaric expansion coefficient is computed from temperature and pressure using the IAPWS-IF97 formulation.

Extends from (Return overall the isobaric expansion coefficient beta).

Inputs

TypeNameDefaultDescription
ThermodynamicStatestate Thermodynamic state record

Outputs

TypeNameDescription
IsobaricExpansionCoefficientbetaIsobaric expansion coefficient [1/K]

Modelica definition

redeclare replaceable function extends isobaricExpansionCoefficient "Isobaric expansion coefficient of water" algorithm beta := Modelica.Media.Water.IF97_Utilities.beta_pT( p = state.p, T = state.T, region = 2); end isobaricExpansionCoefficient;

Buildings.Media.Steam.isentropicEnthalpy Buildings.Media.Steam.isentropicEnthalpy

Isentropic enthalpy

Information

Isentropic enthalpy is computed using the IAPWS-IF97 formulation:

  1. A medium is in a particular state, refState.
  2. The enthalpy at another state h_is shall be computed under the assumption that the state transformation from refState to h_is is performed with a change of specific entropy ds = 0 and the pressure of state h_is is p_downstream and the composition X upstream and downstream is assumed to be the same.

Extends from (Return isentropic enthalpy).

Inputs

TypeNameDefaultDescription
AbsolutePressurep_downstream Downstream pressure [Pa]
ThermodynamicStaterefState Reference state for entropy

Outputs

TypeNameDescription
SpecificEnthalpyh_isIsentropic enthalpy [J/kg]

Modelica definition

redeclare replaceable function extends isentropicEnthalpy "Isentropic enthalpy" algorithm h_is := Modelica.Media.Water.IF97_Utilities.isentropicEnthalpy( p = p_downstream, s = specificEntropy(refState), phase = 0); // phase 0 means unknown end isentropicEnthalpy;

Buildings.Media.Steam.GasProperties Buildings.Media.Steam.GasProperties

Coefficient data record for properties of perfect gases

Information

Extends from Modelica.Icons.Record (Icon for records).

Modelica definition

record GasProperties "Coefficient data record for properties of perfect gases" extends Modelica.Icons.Record; Modelica.Units.SI.MolarMass MM "Molar mass"; Modelica.Units.SI.SpecificHeatCapacity R "Gas constant"; end GasProperties;

Buildings.Media.Steam.g2 Buildings.Media.Steam.g2

Gibbs function for region 2: g(p,T)

Information

This function is identical to Modelica.Media.Water.IF97_Utilities.BaseIF97.Basic.g2 except that

The smoothOrder is needed for Optimica to differentiate the specific heat capacity, which is used in Buildings.Media.Examples.SteamDerivativeCheck. The function is differentiable except at p=0, which is far away from the state for which this function is used.

Extends from Modelica.Icons.Function (Icon for functions).

Inputs

TypeNameDefaultDescription
Pressurep Pressure [Pa]
TemperatureT Temperature (K) [K]

Outputs

TypeNameDescription
GibbsDerivsgDimensionless Gibbs function and derivatives w.r.t. pi and tau

Modelica definition

function g2 "Gibbs function for region 2: g(p,T)" extends Modelica.Icons.Function; input Modelica.Units.SI.Pressure p "Pressure"; input Modelica.Units.SI.Temperature T "Temperature (K)"; output Modelica.Media.Common.GibbsDerivs g "Dimensionless Gibbs function and derivatives w.r.t. pi and tau"; protected Real tau2 "Dimensionless temperature"; Real[55] o "Vector of auxiliary variables"; algorithm g.p := p; g.T := T; g.R_s := Modelica.Media.Water.IF97_Utilities.BaseIF97.data.RH2O; // assert(p > 0.0, // "IF97 medium function g2 called with too low pressure\n" + "p = " + // String(p) + " Pa <= 0.0 Pa"); // assert(p <= 100.0e6, "IF97 medium function g2: the input pressure (= " // + String(p) + " Pa) is higher than 100 Mpa"); // assert(T >= 273.15, "IF97 medium function g2: the temperature (= " + // String(T) + " K) is lower than 273.15 K!"); // assert(T <= 1073.15, // "IF97 medium function g2: the input temperature (= " + String(T) + // " K) is higher than the limit of 1073.15 K"); g.pi := p/Modelica.Media.Water.IF97_Utilities.BaseIF97.data.PSTAR2; g.tau := Modelica.Media.Water.IF97_Utilities.BaseIF97.data.TSTAR2/T; tau2 := -0.5 + g.tau; o[1] := tau2*tau2; o[2] := o[1]*tau2; o[3] := -0.050325278727930*o[2]; o[4] := -0.057581259083432 + o[3]; o[5] := o[4]*tau2; o[6] := -0.045996013696365 + o[5]; o[7] := o[6]*tau2; o[8] := -0.0178348622923580 + o[7]; o[9] := o[8]*tau2; o[10] := o[1]*o[1]; o[11] := o[10]*o[10]; o[12] := o[11]*o[11]; o[13] := o[10]*o[11]*o[12]*tau2; o[14] := o[1]*o[10]*tau2; o[15] := o[10]*o[11]*tau2; o[16] := o[1]*o[12]*tau2; o[17] := o[1]*o[11]*tau2; o[18] := o[1]*o[10]*o[11]; o[19] := o[10]*o[11]*o[12]; o[20] := o[1]*o[10]; o[21] := g.pi*g.pi; o[22] := o[21]*o[21]; o[23] := o[21]*o[22]; o[24] := o[10]*o[12]*tau2; o[25] := o[12]*o[12]; o[26] := o[11]*o[12]*o[25]*tau2; o[27] := o[10]*o[12]; o[28] := o[1]*o[10]*o[11]*tau2; o[29] := o[10]*o[12]*o[25]*tau2; o[30] := o[1]*o[10]*o[25]*tau2; o[31] := o[1]*o[11]*o[12]; o[32] := o[1]*o[12]; o[33] := g.tau*g.tau; o[34] := o[33]*o[33]; o[35] := -0.000053349095828174*o[13]; o[36] := -0.087594591301146 + o[35]; o[37] := o[2]*o[36]; o[38] := -0.0078785554486710 + o[37]; o[39] := o[1]*o[38]; o[40] := -0.00037897975032630 + o[39]; o[41] := o[40]*tau2; o[42] := -0.000066065283340406 + o[41]; o[43] := o[42]*tau2; o[44] := 5.7870447262208e-6*tau2; o[45] := -0.301951672367580*o[2]; o[46] := -0.172743777250296 + o[45]; o[47] := o[46]*tau2; o[48] := -0.091992027392730 + o[47]; o[49] := o[48]*tau2; o[50] := o[1]*o[11]; o[51] := o[10]*o[11]; o[52] := o[11]*o[12]*o[25]; o[53] := o[10]*o[12]*o[25]; o[54] := o[1]*o[10]*o[25]; o[55] := o[11]*o[12]*tau2; g.g := g.pi*(-0.00177317424732130 + o[9] + g.pi*(tau2*(-0.000033032641670203 + (-0.000189489875163150 + o[1]*(-0.0039392777243355 + (-0.043797295650573 - 0.0000266745479140870*o[13])*o[2]))*tau2) + g.pi*( 2.04817376923090e-8 + (4.3870667284435e-7 + o[1]*(-0.000032277677238570 + (-0.00150339245421480 - 0.040668253562649*o[13])*o[2]))*tau2 + g.pi *(g.pi*(2.29220763376610e-6*o[14] + g.pi*((-1.67147664510610e-11 + o[ 15]*(-0.00211714723213550 - 23.8957419341040*o[16]))*o[2] + g.pi*(-5.9059564324270e-18 + o[17]*(-1.26218088991010e-6 - 0.038946842435739*o[18]) + g.pi*(o[ 11]*(1.12562113604590e-11 - 8.2311340897998*o[19]) + g.pi*( 1.98097128020880e-8*o[15] + g.pi*(o[10]*(1.04069652101740e-19 + (-1.02347470959290e-13 - 1.00181793795110e-9*o[10])*o[20]) + o[23]*(o[13]*(-8.0882908646985e-11 + 0.106930318794090*o[24]) + o[21]*(-0.33662250574171*o[26] + o[21]* (o[27]*(8.9185845355421e-25 + (3.06293168762320e-13 - 4.2002467698208e-6*o[15])*o[28]) + g.pi*(-5.9056029685639e-26*o[24] + g.pi*(3.7826947613457e-6*o[29] + g.pi*(-1.27686089346810e-15*o[30] + o[31]*(7.3087610595061e-29 + o[18]*(5.5414715350778e-17 - 9.4369707241210e-7*o[32]))*g.pi)))))))))))) + tau2*(-7.8847309559367e-10 + (1.27907178522850e-8 + 4.8225372718507e-7*tau2)*tau2))))) + (-0.0056087911830200 + g.tau*(0.071452738814550 + g.tau*(-0.40710498239280 + g.tau*( 1.42408197144400 + g.tau*(-4.3839511194500 + g.tau*(-9.6927686002170 + g.tau*(10.0866556801800 + (-0.284086326077200 + 0.0212684635330700 *g.tau)*g.tau) + Modelica.Math.log(g.pi)))))))/(o[34]*g.tau); g.gpi := (1.00000000000000 + g.pi*(-0.00177317424732130 + o[9] + g.pi*( o[43] + g.pi*(6.1445213076927e-8 + (1.31612001853305e-6 + o[1]*(-0.000096833031715710 + (-0.0045101773626444 - 0.122004760687947*o[13])*o[2]))*tau2 + g.pi *(g.pi*(0.0000114610381688305*o[14] + g.pi*((-1.00288598706366e-10 + o[15]*(-0.0127028833928130 - 143.374451604624*o[16]))*o[2] + g.pi*(-4.1341695026989e-17 + o[17]*(-8.8352662293707e-6 - 0.272627897050173*o[18]) + g.pi*(o[11] *(9.0049690883672e-11 - 65.849072718398*o[19]) + g.pi*( 1.78287415218792e-7*o[15] + g.pi*(o[10]*(1.04069652101740e-18 + (-1.02347470959290e-12 - 1.00181793795110e-8*o[10])*o[20]) + o[23]*(o[13]*(-1.29412653835176e-9 + 1.71088510070544*o[24]) + o[21]*(-6.0592051033508*o[26] + o[21]*(o[ 27]*(1.78371690710842e-23 + (6.1258633752464e-12 - 0.000084004935396416*o[15])*o[28]) + g.pi*(-1.24017662339842e-24*o[24] + g.pi*(0.000083219284749605*o[29] + g.pi*(-2.93678005497663e-14*o[ 30] + o[31]*(1.75410265428146e-27 + o[18]*(1.32995316841867e-15 - 0.0000226487297378904*o[32]))*g.pi)))))))))))) + tau2*(-3.15389238237468e-9 + (5.1162871409140e-8 + 1.92901490874028e-6*tau2)*tau2))))))/g.pi; g.gpipi := (-1.00000000000000 + o[21]*(o[43] + g.pi*( 1.22890426153854e-7 + (2.63224003706610e-6 + o[1]*(-0.000193666063431420 + (-0.0090203547252888 - 0.244009521375894*o[13])*o[2]))*tau2 + g.pi *(g.pi*(0.000045844152675322*o[14] + g.pi*((-5.0144299353183e-10 + o[ 15]*(-0.063514416964065 - 716.87225802312*o[16]))*o[2] + g.pi*(-2.48050170161934e-16 + o[17]*(-0.000053011597376224 - 1.63576738230104*o[18]) + g.pi*(o[ 11]*(6.3034783618570e-10 - 460.94350902879*o[19]) + g.pi*( 1.42629932175034e-6*o[15] + g.pi*(o[10]*(9.3662686891566e-18 + (-9.2112723863361e-12 - 9.0163614415599e-8*o[10])*o[20]) + o[23]*(o[13]*(-1.94118980752764e-8 + 25.6632765105816*o[24]) + o[21]*(-103.006486756963*o[26] + o[21]*( o[27]*(3.3890621235060e-22 + (1.16391404129682e-10 - 0.00159609377253190*o[15])*o[28]) + g.pi*(-2.48035324679684e-23*o[24] + g.pi*(0.00174760497974171*o[29] + g.pi*(-6.4609161209486e-13*o[30] + o[31]*(4.0344361048474e-26 + o[18]*(3.05889228736295e-14 - 0.00052092078397148*o[32]))*g.pi)))))))))))) + tau2*(-9.4616771471240e-9 + (1.53488614227420e-7 + o[44])*tau2)))))/o[21]; g.gtau := (0.0280439559151000 + g.tau*(-0.285810955258200 + g.tau*( 1.22131494717840 + g.tau*(-2.84816394288800 + g.tau*(4.3839511194500 + o[33]*(10.0866556801800 + (-0.56817265215440 + 0.063805390599210*g.tau) *g.tau))))))/(o[33]*o[34]) + g.pi*(-0.0178348622923580 + o[49] + g.pi *(-0.000033032641670203 + (-0.00037897975032630 + o[1]*(-0.0157571108973420 + (-0.306581069554011 - 0.00096028372490713*o[13])*o[2]))*tau2 + g.pi *(4.3870667284435e-7 + o[1]*(-0.000096833031715710 + (-0.0090203547252888 - 1.42338887469272*o[13])*o[2]) + g.pi*(-7.8847309559367e-10 + g.pi* (0.0000160454534363627*o[20] + g.pi*(o[1]*(-5.0144299353183e-11 + o[ 15]*(-0.033874355714168 - 836.35096769364*o[16])) + g.pi*((-0.0000138839897890111 - 0.97367106089347*o[18])*o[50] + g.pi*(o[14]*(9.0049690883672e-11 - 296.320827232793*o[19]) + g.pi*(2.57526266427144e-7*o[51] + g.pi*( o[2]*(4.1627860840696e-19 + (-1.02347470959290e-12 - 1.40254511313154e-8*o[10])*o[20]) + o[23]*(o[19]*(-2.34560435076256e-9 + 5.3465159397045*o[24]) + o[21]*(-19.1874828272775*o[52] + o[21]*(o[ 16]*(1.78371690710842e-23 + (1.07202609066812e-11 - 0.000201611844951398*o[15])*o[28]) + g.pi*(-1.24017662339842e-24*o[27] + g.pi*(0.000200482822351322*o[53] + g.pi*(-4.9797574845256e-14*o[54] + (1.90027787547159e-27 + o[18]*(2.21658861403112e-15 - 0.000054734430199902*o[32]))*o[55]*g.pi)))))))))))) + ( 2.55814357045700e-8 + 1.44676118155521e-6*tau2)*tau2)))); g.gtautau := (-0.168263735490600 + g.tau*(1.42905477629100 + g.tau*(-4.8852597887136 + g.tau*(8.5444918286640 + g.tau*(-8.7679022389000 + o[33]*(-0.56817265215440 + 0.127610781198420*g.tau)*g.tau)))))/(o[33]*o[34]*g.tau) + g.pi*(-0.091992027392730 + (-0.34548755450059 - 1.50975836183790*o[2])*tau2 + g.pi*(-0.00037897975032630 + o[1]*(-0.047271332692026 + (-1.83948641732407 - 0.033609930371750* o[13])*o[2]) + g.pi*((-0.000193666063431420 + (-0.045101773626444 - 48.395221739552*o[13])*o[2])*tau2 + g.pi*(2.55814357045700e-8 + 2.89352236311042e-6*tau2 + g.pi*(0.000096272720618176*o[10]*tau2 + g.pi *((-1.00288598706366e-10 + o[15]*(-0.50811533571252 - 28435.9329015838*o[16]))*tau2 + g.pi*(o[11]*(-0.000138839897890111 - 23.3681054614434*o[18])*tau2 + g.pi*((6.3034783618570e-10 - 10371.2289531477*o[19])*o[20] + g.pi*(3.09031519712573e-6*o[17] + g.pi *(o[1]*(1.24883582522088e-18 + (-9.2112723863361e-12 - 1.82330864707100e-7*o[10])*o[20]) + o[23]*(o[1]*o[11]*o[12]*(-6.5676921821352e-8 + 261.979281045521*o[24])*tau2 + o[21]*(-1074.49903832754*o[1]*o[10] *o[12]*o[25]*tau2 + o[21]*((3.3890621235060e-22 + ( 3.6448887082716e-10 - 0.0094757567127157*o[15])*o[28])*o[32] + g.pi*( -2.48035324679684e-23*o[16] + g.pi*(0.0104251067622687*o[1]*o[12]*o[ 25]*tau2 + g.pi*(o[11]*o[12]*(4.7506946886790e-26 + o[18]*( 8.6446955947214e-14 - 0.00311986252139440*o[32]))*g.pi - 1.89230784411972e-12*o[10]*o[25]*tau2)))))))))))))))); g.gtaupi := -0.0178348622923580 + o[49] + g.pi*(-0.000066065283340406 + (-0.00075795950065260 + o[1]*(-0.0315142217946840 + (-0.61316213910802 - 0.00192056744981426*o[13])*o[2]))*tau2 + g.pi*(1.31612001853305e-6 + o[1]*(-0.000290499095147130 + (-0.0270610641758664 - 4.2701666240781*o[13])*o[2]) + g.pi*(-3.15389238237468e-9 + g.pi*( 0.000080227267181813*o[20] + g.pi*(o[1]*(-3.00865796119098e-10 + o[15] *(-0.203246134285008 - 5018.1058061618*o[16])) + g.pi*((-0.000097187928523078 - 6.8156974262543*o[18])*o[50] + g.pi*(o[14]*(7.2039752706938e-10 - 2370.56661786234*o[19]) + g.pi*(2.31773639784430e-6*o[51] + g.pi*(o[2] *(4.1627860840696e-18 + (-1.02347470959290e-11 - 1.40254511313154e-7* o[10])*o[20]) + o[23]*(o[19]*(-3.7529669612201e-8 + 85.544255035272*o[ 24]) + o[21]*(-345.37469089099*o[52] + o[21]*(o[16]*( 3.5674338142168e-22 + (2.14405218133624e-10 - 0.0040322368990280*o[15]) *o[28]) + g.pi*(-2.60437090913668e-23*o[27] + g.pi*( 0.0044106220917291*o[53] + g.pi*(-1.14534422144089e-12*o[54] + ( 4.5606669011318e-26 + o[18]*(5.3198126736747e-14 - 0.00131362632479764*o[32]))*o[55]*g.pi)))))))))))) + ( 1.02325742818280e-7 + o[44])*tau2))); end g2;

Buildings.Media.Steam.temperature_ph

Return temperature from p and h, inverse function of h(p,T)

Information

Returns temperature from specific enthalpy and pressure.

Implementation

This linear approximation is the inverse or backward function of Buildings.Media.Steam.specificEnthalpy and is numerically consistent with that forward function.

The largest error of this linearization is 1.17°C (0.31%), which occurs at 100°C and 100 kPa.

Inputs

TypeNameDefaultDescription
AbsolutePressurep Pressure [Pa]
SpecificEnthalpyh Specific Enthalpy [J/kg]

Outputs

TypeNameDescription
TemperatureTTemperature [K]

Modelica definition

function temperature_ph "Return temperature from p and h, inverse function of h(p,T)" input AbsolutePressure p "Pressure"; input SpecificEnthalpy h "Specific Enthalpy"; output Temperature T "Temperature"; protected constant Real a[:] = {2.749e+06,-9118,2.752e+04} "Coefficients from forward function h(p,T)"; constant Real b[:] = {-a[1]*TSD/a[3]+TMean, -a[2]*TSD/a[3], TSD/a[3]} "Regression coefficients"; constant AbsolutePressure pMean = 2.50427896656637E+05 "Mean pressure"; constant Temperature TMean = 4.15555698340926E+02 "Mean temperature"; constant Real pSD = 1.13236055019318E+05 "Normalization value"; constant Real TSD = 1.32971013463839E+01 "Normalization value"; Modelica.Units.SI.PressureDifference pHat; algorithm pHat := (p - pMean)/pSD; T := b[1] + b[2]*pHat + b[3]*h; end temperature_ph;

Buildings.Media.Steam.temperature_ps

Return temperature from p and s, inverse function of s(p,T)

Information

Returns temperature from specific entropy and pressure.

Implementation

This polynomial approximation is the inverse or backward function of Buildings.Media.Steam.specificEntropy and is numerically consistent with that forward function.

The largest error of this linearization is 7.70°C (1.86%), which occurs at 137.4°C and 100 kPa.

Inputs

TypeNameDefaultDescription
AbsolutePressurep Pressure [Pa]
SpecificEntropys Specific Entropy [J/(kg.K)]

Outputs

TypeNameDescription
TemperatureTTemperature [K]

Modelica definition

function temperature_ps "Return temperature from p and s, inverse function of s(p,T)" input AbsolutePressure p "Pressure"; input SpecificEntropy s "Specific Entropy"; output Temperature T "Temperature"; protected constant Real a[:] = {7135,-252.4,70.03,40.6,4.953} "Coefficients from forward function s(p,T)"; constant AbsolutePressure pMean = 2.50427896656637E+05 "Mean pressure"; constant Temperature TMean = 4.15555698340926E+02 "Mean temperature"; constant Real pSD = 1.13236055019318E+05 "Normalization value"; constant Real TSD = 1.32971013463839E+01 "Normalization value"; 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); T := THat*TSD + TMean; end temperature_ps;

Buildings.Media.Steam.rho_pT Buildings.Media.Steam.rho_pT

Density as function of temperature and pressure

Information

Density is computed from temperature and pressure using the IAPWS-IF97 relationship via the Gibbs free energy for region 2.

Extends from Modelica.Icons.Function (Icon for functions).

Inputs

TypeNameDefaultDescription
AbsolutePressurep Pressure [Pa]
TemperatureT Temperature [K]

Outputs

TypeNameDescription
DensityrhoDensity [kg/m3]

Modelica definition

function rho_pT "Density as function of temperature and pressure" extends Modelica.Icons.Function; input AbsolutePressure p "Pressure"; input Temperature T "Temperature"; output Density rho "Density"; protected 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; end g2_smooth; algorithm R := Modelica.Media.Water.IF97_Utilities.BaseIF97.data.RH2O; // Region 2 properties g := g2_smooth(p, T); rho := p/(R*T*g.pi*g.gpi); end rho_pT;

Buildings.Media.Steam.pressure_dT

Computes pressure as a function of density and temperature

Inputs

TypeNameDefaultDescription
Densityd Density [kg/m3]
TemperatureT Temperature [K]

Outputs

TypeNameDescription
AbsolutePressurepPressure [Pa]

Modelica definition

function pressure_dT "Computes pressure as a function of density and temperature" input Density d "Density"; input Temperature T "Temperature"; output AbsolutePressure p "Pressure"; algorithm p := Modelica.Media.Water.IF97_Utilities.BaseIF97.Inverses.pofdt125( d=d, T=T, reldd=1.0e-8, region=2); end pressure_dT;