WOLFRAM SYSTEM MODELER
MoistAirAir: Moist air model (190 ... 647 K) 
ThermodynamicState record for moist air 

Moist air base properties record 

Return thermodynamic state as function of pressure p, temperature T and composition X 

Return thermodynamic state as function of pressure p, specific enthalpy h and composition X 

Return thermodynamic state as function of density d, temperature T and composition X 

Return thermodynamic state so that it smoothly approximates: if x > 0 then state_a else state_b 

Return absolute humidity per unit mass of moist air at saturation as a function of the thermodynamic state record 

Return absolute humidity per unit mass of dry air at saturation as a function of the thermodynamic state record 

Return absolute humidity per unit mass of dry air at saturation as a function of pressure p and temperature T 

Return steam mass fraction as a function of relative humidity phi and temperature T 

Return relative humidity as a function of pressure p, temperature T and composition X 

Return relative humidity as a function of the thermodynamic state record 

Return ideal gas constant as a function from thermodynamic state, only valid for phi<1 

Return ideal gas constant as a function from composition X 

Return saturation pressure of water as a function of temperature T in the range of 273.16 to 647.096 K 

Derivative function for 'saturationPressureLiquid' 

Return sublimation pressure of water as a function of temperature T between 190 and 273.16 K 

Derivative function for 'sublimationPressureIce' 

Return saturation pressure of water as a function of temperature T between 190 and 647.096 K 

Derivative function for 'saturationPressure' 

Return saturation temperature of water as a function of (partial) pressure p 

Return enthalpy of vaporization of water as a function of temperature T, 273.16 to 647.096 K 

Return specific heat capacity of water (liquid only) as a function of temperature T 

Return enthalpy of liquid water as a function of temperature T(use enthalpyOfWater instead) 

Return specific enthalpy of gas (air and steam) as a function of temperature T and composition X 

Return specific enthalpy of steam as a function of temperature T 

Return specific enthalpy of dry air as a function of temperature T 

Computes specific enthalpy of water (solid/liquid) near atmospheric pressure from temperature T 

Derivative function of enthalpyOfWater 

Returns pressure of ideal gas as a function of the thermodynamic state record 

Return temperature of ideal gas as a function of the thermodynamic state record 

Return temperature as a function of pressure p, specific enthalpy h and composition X 

Returns density of ideal gas as a function of the thermodynamic state record 

Return specific enthalpy of moist air as a function of the thermodynamic state record 

Return specific enthalpy of moist air as a function of pressure p, temperature T and composition X 

Derivative function of h_pTX 

Return isentropic exponent (only for gas fraction!) 

isentropicEnthalpyApproximation Approximate calculation of h_is from upstream properties, downstream pressure, gas part only 

Return specific internal energy of moist air as a function of the thermodynamic state record 

Return specific internal energy of moist air as a function of pressure p, temperature T and composition X 

specificInternalEnergy_pTX_der Derivative function for specificInternalEnergy_pTX 

Return specific entropy from thermodynamic state record, only valid for phi<1 

Return specific Gibbs energy as a function of the thermodynamic state record, only valid for phi<1 

Return specific Helmholtz energy as a function of the thermodynamic state record, only valid for phi<1 

Return specific heat capacity at constant pressure as a function of the thermodynamic state record 

Return specific heat capacity at constant volume as a function of the thermodynamic state record 

Return dynamic viscosity as a function of the thermodynamic state record, valid from 123.15 K to 1273.15 K 

Return thermal conductivity as a function of the thermodynamic state record, valid from 123.15 K to 1273.15 K 

Return temperature as a function of pressure p, specific entropy s and composition X 

Return specific entropy of moist air as a function of pressure p, temperature T and composition X (only valid for phi<1) 

Return specific entropy of moist air as a function of pressure p, temperature T and composition X (only valid for phi<1) 

Isentropic enthalpy (only valid for phi<1) 

Utility functions 
ThermoStates 
Value: Modelica.Media.Interfaces.Choices.IndependentVariables.pTX Type: IndependentVariables Description: Enumeration type for independent variables 

mediumName 
Value: "Moist air" Type: String Description: Name of the medium 
substanceNames 
Value: {"water", "air"} Type: String[:] Description: Names of the mixture substances. Set substanceNames={mediumName} if only one substance. 
extraPropertiesNames 
Value: fill("", 0) Type: String[:] Description: Names of the additional (extra) transported properties. Set extraPropertiesNames=fill("",0) if unused 
singleState 
Value: false Type: Boolean Description: = true, if u and d are not a function of pressure 
reducedX 
Value: true Type: Boolean Description: = true if medium contains the equation sum(X) = 1.0; set reducedX=true if only one substance (see docu for details) 
fixedX 
Value: false Type: Boolean Description: = true if medium contains the equation X = reference_X 
reference_p 
Value: 101325 Type: AbsolutePressure (Pa) Description: Reference pressure of Medium: default 1 atmosphere 
reference_T 
Value: 298.15 Type: Temperature (K) Description: Reference temperature of Medium: default 25 deg Celsius 
reference_X 
Value: {0.01, 0.99} Type: MassFraction[nX] (kg/kg) Description: Default mass fractions of medium 
p_default 
Value: 101325 Type: AbsolutePressure (Pa) Description: Default value for pressure of medium (for initialization) 
T_default 
Value: Modelica.SIunits.Conversions.from_degC(20) Type: Temperature (K) Description: Default value for temperature of medium (for initialization) 
h_default 
Value: specificEnthalpy_pTX(p_default, T_default, X_default) Type: SpecificEnthalpy (J/kg) Description: Default value for specific enthalpy of medium (for initialization) 
X_default 
Value: reference_X Type: MassFraction[nX] (kg/kg) Description: Default value for mass fractions of medium (for initialization) 
C_default 
Value: fill(0, nC) Type: ExtraProperty[nC] Description: Default value for trace substances of medium (for initialization) 
nS 
Value: size(substanceNames, 1) Type: Integer Description: Number of substances 
nX 
Value: nS Type: Integer Description: Number of mass fractions 
nXi 
Value: if fixedX then 0 else if reducedX then nS  1 else nS Type: Integer Description: Number of structurally independent mass fractions (see docu for details) 
nC 
Value: size(extraPropertiesNames, 1) Type: Integer Description: Number of extra (outside of standard massbalance) transported properties 
C_nominal 
Value: 1.0e6 * ones(nC) Type: Real[nC] Description: Default for the nominal values for the extra properties 
fluidConstants 
Value: {IdealGases.Common.FluidData.H2O, IdealGases.Common.FluidData.N2} Type: FluidConstants[nS] Description: Constant data for the fluid 
Water 
Value: 1 Type: Integer Description: Index of water (in substanceNames, massFractions X, etc.) 
Air 
Value: 2 Type: Integer Description: Index of air (in substanceNames, massFractions X, etc.) 
k_mair 
Value: steam.MM / dryair.MM Type: Real Description: Ratio of molar weights 
dryair 
Value: IdealGases.Common.SingleGasesData.Air Type: DataRecord 
steam 
Value: IdealGases.Common.SingleGasesData.H2O Type: DataRecord 
MMX 
Value: {steam.MM, dryair.MM} Type: MolarMass[2] (kg/mol) Description: Molar masses of components 
This information is part of the Modelica Standard Library maintained by the Modelica Association.
This package provides a full thermodynamic model of moist air including the fog region and temperatures below zero degC. The governing assumptions in this model are:
All extensive properties are expressed in terms of the total mass in order to comply with other media in this library. However, for moist air it is rather common to express the absolute humidity in terms of mass of dry air only, which has advantages when working with charts. In addition, care must be taken, when working with mass fractions with respect to total mass, that all properties refer to the same water content when being used in mathematical operations (which is always the case if based on dry air only). Therefore two absolute humidities are computed in the BaseProperties model: X denotes the absolute humidity in terms of the total mass while x denotes the absolute humidity per unit mass of dry air. In addition, the relative humidity phi is also computed.
At the triple point temperature of water of 0.01 °C or 273.16 K and a relative humidity greater than 1 fog may be present as liquid and as ice resulting in a specific enthalpy somewhere between those of the two isotherms for solid and liquid fog, respectively. For numerical reasons a coexisting mixture of 50% solid and 50% liquid fog is assumed in the fog region at the triple point in this model.
From the assumptions mentioned above it follows that the pressure should be in the region around atmospheric conditions or below (a few bars may still be fine though). Additionally a very high water content at low temperatures would yield incorrect densities, because the volume of the liquid or solid phase would not be negligible anymore. The model does not provide information on limits for water drop size in the fog region or transport information for the actual condensation or evaporation process in combination with surfaces. All excess water which is not in its vapour state is assumed to be still present in the air regarding its energy but not in terms of its spatial extent.
The thermodynamic model may be used for temperatures ranging from 190 ... 647 K. This holds for all functions unless otherwise stated in their description. However, although the model works at temperatures above the saturation temperature it is questionable to use the term "relative humidity" in this region. Please note, that although several functions compute pure water properties, they are designed to be used within the moist air medium model where properties are dominated by air and steam in their vapor states, and not for pure liquid water applications.
Several additional functions that are not needed to describe the thermodynamic system, but are required to model transport processes, like heat and mass transfer, may be called. They usually neglect the moisture influence unless otherwise stated.
The model's main area of application is all processes that involve moist air cooling under near atmospheric pressure with possible moisture condensation. This is the case in all domestic and industrial air conditioning applications. Another large domain of moist air applications covers all processes that deal with dehydration of bulk material using air as a transport medium. Engineering tasks involving moist air are often performed (or at least visualized) by using charts that contain all relevant thermodynamic data for a moist air system. These so called psychrometric charts can be generated from the medium properties in this package. The model PsychrometricData may be used for this purpose in order to obtain data for figures like those below (the plotting itself is not part of the model though).
Legend: blue  constant specific enthalpy, red  constant temperature, black  constant relative humidity
SystemModel["Modelica.Media.Air.MoistAir"]