MoistAir

Air: Moist air model (190 ... 647 K)

Package Contents

ThermodynamicState

ThermodynamicState record for moist air

BaseProperties

Moist air base properties record

setState_pTX

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

setState_phX

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

setState_dTX

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

setSmoothState

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

Xsaturation

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

xsaturation

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

xsaturation_pT

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

massFraction_pTphi

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

relativeHumidity_pTX

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

relativeHumidity

Return relative humidity as a function of the thermodynamic state record

gasConstant

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

gasConstant_X

Return ideal gas constant as a function from composition X

saturationPressureLiquid

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

saturationPressureLiquid_der

Derivative function for 'saturationPressureLiquid'

sublimationPressureIce

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

sublimationPressureIce_der

Derivative function for 'sublimationPressureIce'

saturationPressure

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

saturationPressure_der

Derivative function for 'saturationPressure'

saturationTemperature

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

enthalpyOfVaporization

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

HeatCapacityOfWater

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

enthalpyOfLiquid

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

enthalpyOfGas

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

enthalpyOfCondensingGas

Return specific enthalpy of steam as a function of temperature T

enthalpyOfNonCondensingGas

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

enthalpyOfWater

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

enthalpyOfWater_der

Derivative function of enthalpyOfWater

pressure

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

temperature

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

T_phX

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

density

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

specificEnthalpy

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

h_pTX

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

h_pTX_der

Derivative function of h_pTX

isentropicExponent

Return isentropic exponent (only for gas fraction!)

isentropicEnthalpyApproximation

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

specificInternalEnergy

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

specificInternalEnergy_pTX

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

specificEntropy

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

specificGibbsEnergy

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

specificHelmholtzEnergy

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

specificHeatCapacityCp

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

specificHeatCapacityCv

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

dynamicViscosity

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

thermalConductivity

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

velocityOfSound

isobaricExpansionCoefficient

isothermalCompressibility

density_derp_h

density_derh_p

density_derp_T

density_derT_p

density_derX

molarMass

T_psX

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

setState_psX

s_pTX

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

s_pTX_der

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

isentropicEnthalpy

Isentropic enthalpy (only valid for phi<1)

Utilities

Utility functions

Package Constants (27)

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.Units.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 mass-balance) transported properties

C_nominal

Value: 1.0e-6 * 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

Information

This information is part of the Modelica Standard Library maintained by the Modelica Association.

Thermodynamic Model

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:

  • the perfect gas law applies
  • water volume other than that of steam is neglected

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.

Range of validity

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.

Transport Properties

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.

Application

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

Extended by (5)

Medium

Modelica.Media.Examples.PsychrometricData

Used medium package

Medium

Modelica.Media.Examples.MoistAir

Medium model

Medium

Modelica.Fluid.Examples.TraceSubstances.RoomCO2WithControls

Medium

Modelica.Fluid.Examples.TraceSubstances.RoomCO2

Medium

Modelica.Fluid.Examples.BranchingDynamicPipes