Modeling Moist Air Systems
Intended Applications
The Moist Air library contains basic elements, such as reservoirs, chambers, and pneumatic-mechanical converters, as well as sensors and sources. Use these blocks to model HVAC systems, environmental control systems, and other similar applications.
Relevant industries include automotive, aerospace, building. The key aspect of these applications is the need to keep track of humidity levels in different parts of the model over time. The moist air domain is a two-species gas domain, where the species are air and water vapor. Furthermore, the water vapor can condense out of the system. This effect is important to HVAC applications because latent heat of water condensation affects the thermodynamics of the fluid flow.
The moist air mixture is composed of dry air and water vapor. Trace gas is an optional third species in the moist air mixture. Example of the trace gas usage is to track carbon dioxide and pollutants such as nitrogen oxides (NOx). You can also model entrained water droplets. Specify the moist air properties in the connected loop by using the Moist Air Properties (MA) block. This block also gives you several options for modeling trace gas properties. You increase and decrease levels of moisture and trace gas in the air mixture by using the blocks in the Moisture & Trace Gas Sources library (see Modeling Moisture and Trace Gas Levels).
All gas species in the mixture are assumed to be semiperfect gas. This means that pressure, temperature, and density obey the ideal gas law. Other properties―specific enthalpy, specific heat, dynamic viscosity, and thermal conductivity―are functions of temperature only.
Unless explicitly stated otherwise, all pressures and temperatures used in modeling moist air systems are static pressure and static temperature.
Use the Moist Air domain and library to perform the following tasks:
Develop requirements of an HVAC system for an environment, such as a building, automobile, or aircraft
Ensure acceptable temperature, pressure, humidity, and condensation within the environment
Determine capacity of an HVAC system to match heating, cooling, and dehumidification requirements
Analyze HVAC system performance, efficiency, and cost
Validate HVAC system model against test data
Design and simulate HVAC components and tune component models to test rig data
Simulate models including an HVAC system, environment model, and controller
Design controllers for valves, fans, and compressors to ensure safe and optimal operation
Perform HIL testing
Network Variables for Moist Air Domain
The Across variables are pressure, temperature, specific humidity (water vapor mass fraction), water droplets mass fraction, and trace gas mass fraction. The Through variables are mixture mass flow rate, mixture energy flow rate, water vapor mass flow rate, water droplets mass flow rate, and trace gas mass flow rate. Note that these choices result in a pseudo-bond graph, because the product of Across and Through variables is not power.
There is a separate domain for modeling moisture and trace gas levels in moist air systems. For more information, see Moist Air Source Domain.
Moist Air Properties
The default fluid properties for the moist air library correspond to dry air, water vapor, and carbon dioxide (the optional trace gas). However, you can modify the fluid properties in the Moist Air Properties (MA) block to model mixtures of other gases and vapors or include water droplets. You can replace dry air and carbon dioxide with other gas species. You can also change water vapor to another condensing vapor (or even to another noncondensing gas species, by supplying large enough values for the saturation pressure, so that it would never reach saturation during simulation). In this way, you can model any three-species gas mixture.
All gas species in the mixture are assumed to be semiperfect gas. This means that pressure p, temperature T, and density ρ of the constituents obey the ideal gas law:
where R is the specific gas constant. Subscripts a, w, and g indicate dry air, water vapor, and trace gas, respectively.
Dalton’s law applies to ideal gases:
Therefore, the mixture also obeys the ideal gas law:
where:
xa, xw, and xg are mass fractions of dry air, water vapor, and trace gas, respectively.
Other properties of each constituent are assumed to be functions of temperature only:
ha(T), hw(T), hd(T), hg(T) ― Specific enthalpy of dry air, water vapor, water droplets, and trace gas, respectively.
μa(T), μw(T), μg(T) ― Dynamic viscosity of dry air, water vapor, and trace gas, respectively.
ka(T), kw(T), kg(T) ― Thermal conductivity of dry air, water vapor, and trace gas, respectively.
Water droplets do not to contribute to the moist air density, viscosity, and conductivity, but they do contribute to enthalpy.
For ideal gases, the enthalpy of mixing is zero. The mixture specific enthalpy is a combination of the constituent specific enthalpy based on their mass fractions:
The specific enthalpy including water droplets is
where hd is the specific enthalpy of liquid water.
You can compute the entropy of mixing from the mole fractions:
where ya, yw, and yg are mole fractions of dry air, water vapor, and trace gas, respectively.
Therefore, the mixture specific entropy is
Consistent Specific Enthalpy Reference Temperature
Since R2023b
Specific enthalpy is a thermodynamic quantity that is measured with respect to a reference state. To ensure consistency in a moist air mixture, all the specific enthalpies must have the same reference temperature. The moist air domain uses a consistent reference temperature of 0 degC. When you enter specific enthalpy vectors in the Moist Air Properties (MA) block, the block internally shifts these vectors to be 0 kJ/kg at 0 degC. The library blocks then use these adjusted values in the internal calculations. The simulation data log also displays the adjusted specific enthalpy values.
You can use the Enthalpy reference state parameter of the Thermodynamic Properties Sensor (MA) block to view the specific enthalpy values adjusted with respect to different reference states.
Moisture and Trace Gas Property Definitions
The equations describing moisture and trace gas properties use these symbols and
property definitions. Subscripts a
, w
, and
g
indicate the properties of dry air, water vapor, and trace
gas, respectively. Subscript ws
indicates water vapor at
saturation.
Symbol | Property | Definition |
---|---|---|
p | Pressure | Pressure of the moist air mixture (as opposed to the partial pressure of water vapor or partial pressure of trace gas). |
T | Temperature | The dry-bulb temperature, which is the temperature in the common thermodynamic sense. (The wet-bulb temperature is a different quantity, which measures the humidity level.) |
R | Specific gas constant | Universal gas constant divided by the molar mass of the species. Specific gas constant of the mixture is |
φw | Relative humidity | Moles of water vapor as a fraction of the moles of water vapor needed to saturate at the same temperature. Water vapor saturation pressure is a property of water and is a function of temperature only, pws(T). The ideal gas law (due to the assumed semiperfect gas) means that mole fraction is equivalent to partial pressure fraction. The mole fraction yw cannot be greater than 1. Therefore, at high temperature or low pressure, it may not be possible to achieve relative humidity of 1. |
xw | Specific humidity | Mass of water vapor as a fraction of the total mass of the moist air mixture. It is another term for water vapor mass fraction. It may not be possible to achieve specific humidity of 1 due to saturation. |
yw | Water vapor mole fraction | Moles of water vapor as a fraction of the total moles of the moist air mixture. It may not be possible to achieve water vapor mole fraction of 1 due to saturation. |
rw | Humidity ratio | Ratio of mass of water vapor to mass of dry air and trace gas. For conditions in typical HVAC applications, it is close to the specific humidity. |
ρw | Absolute humidity | Mass of water vapor over the volume of the moist air mixture. It is another term for water vapor density. |
xg | Trace gas mass fraction | Mass of trace gas as a fraction of the total mass of the moist air mixture. |
yg | Trace gas mole fraction | Moles of trace gas as a fraction of the total moles of the moist air mixture. |
rd | Mass ratio of water droplets to moist ar | Ratio of the mass of entrained water droplets to the total mass of the moist air mixture. |
The water vapor mole fraction is related to specific humidity (that is, to mass fraction) as follows:
The trace gas mole fraction is related to trace gas mass fraction as follows:
For more information on modeling moisture and trace gas, see Modeling Moisture and Trace Gas Levels.
Blocks with Moist Air Volume
Components in the moist air domain are modeled using control volumes. A control volume encompasses the moist air inside the component and separates it from the surrounding environment and other components. Air flows and heat flows across the control surface are represented by ports. The moist air volume inside the component is represented using an internal node. This internal node is not visible, but you can access its parameters and variables using Simscape™ data logging. For more information, see About Simulation Data Logging.
For a moist air volume, you must specify the pressure, temperature, moisture level, and trace gas level. For more information, see Initial Conditions for Blocks with Finite Moist Air Volume.
The following blocks in the Moist Air library are modeled as components with a moist air volume. In the case of Controlled Reservoir (MA) and Reservoir (MA) blocks, the volume is assumed to be infinitely large.
Block | Moist Air Volume |
---|---|
Constant Volume Chamber (MA) | Finite |
Pipe (MA) | Finite |
Rotational Mechanical Converter (MA) | Finite |
Translational Mechanical Converter (MA) | Finite |
Reservoir (MA) | Infinite |
Other components have relatively small moist air volumes, so that the air mixture entering the component spends negligible time inside the component before exiting. These components are considered quasi-steady-state and they do not have an internal node.
Reference Node and Grounding Rules
Unlike mechanical and electrical domains, where each topologically distinct circuit within a domain must contain at least one reference block, moist air networks have different grounding rules.
Blocks with a moist air volume contain an internal node, which provides the pressure, temperature, moisture level, and trace gas level inside the component and therefore serves as a reference node for the moist air network. Each connected moist air network must have at least one reference node. This means that each connected moist air network must have at least one of the blocks listed in Blocks with Moist Air Volume. In other words, a moist air network that contains no air volume is an invalid network.
The Foundation Moist Air library contains the Absolute Reference (MA) block but, unlike other domains, you do not use it for grounding moist air circuits. The purpose of the Absolute Reference (MA) block is to provide a reference for the Pressure & Temperature Sensor (MA) block. However, starting in R2023a, the Pressure & Temperature Sensor (MA) block contains an implicit reference node, which makes using the Absolute Reference (MA) block with the Pressure & Temperature Sensor (MA) block unnecessary. If you use the Absolute Reference (MA) block elsewhere in a moist air network, it triggers a simulation assertion because air mixture pressure and temperature cannot be at absolute zero.
Initial Conditions for Blocks with Finite Moist Air Volume
Since R2024b
For the blocks listed in the table in the Blocks with Moist Air Volume section, you must specify initial conditions to define the initial fluid states. The fluid states of a moist air volume are pressure, temperature, moisture level, and trace gas level. These fluid states evolve dynamically based on the mixture mass conservation, water vapor mass conservation, trace gas mass conservation, water droplet mass conservation, and the mixture energy conservation. You can use the equations in the Moisture and Trace Gas Property Definitions and Trace Gas Modeling Options sections to convert the values from one moisture or trace gas measure to another.
The physical signal output port F outputs the fluid states of moist air volume in these blocks. Connect port F to the Measurement Selector (MA) block to extract the measurements of pressure, temperature, moisture level, and trace gas level during simulation.
Blocks that model an infinitely large moist air volume assume that the state of the volume is quasisteady. You do not need to specify an initial condition for these blocks. Instead, these blocks represent boundary conditions for the moist air network.
Saturation and Condensation
The blocks listed in the table in the Blocks with Moist Air Volume section measure finite moist air volume, and can become saturated when the relative humidity φw reaches the relative humidity at saturation φws. The saturated state represents the maximum amount of moisture that the moist air volume can hold at that pressure and temperature. Any additional moisture condenses into liquid water. If you enable droplet tracking, the Fraction of condensate entrained as water droplets parameter in each block specifies the amount of condensate that the block converts to water droplets. The remaining condensate leaves the flow.
By definition, the relative humidity at saturation is 1. However, you can specify a different value for φws to model an empirical effect or other phenomenon. When φws > 1, water vapor partial pressure can become greater than the water vapor saturation pressure. When φws < 1, moisture can condense before the water vapor partial pressure reaches the water vapor saturation pressure.
Condensation does not occur instantaneously. Consequently, it is possible for φw to be slightly greater than φws. The Water vapor condensation time constant parameter represents the characteristic time it takes to condense out enough moisture to bring φw back to φws. A larger value of the time constant causes φw to exceed φws to a greater degree, but is more numerically robust.
Moisture that condenses and is not entrained as water droplets leaves the moist air network. The mass and energy of this portion of condensed liquid water also leaves the moist air volume. The physical signal output port W reports the rate of water removed from the moist air flow. The condensate that is not entrained as water droplets drains away. If you want to model the flow of the drained liquid water, you can use the signal from output port W as an input for a isothermal liquid, thermal liquid, two-phase fluid, or another moist air network. This example shows how to use a thermal liquid network to model the condensate that drains from a Constant Volume Chamber (MA) through a pipe.
If you have a Simscape Fluids™ license, you can also use the Tank (TL) block to model a condensation collection tray. The liquid level in the tank represents the amount of condensation collected but not yet drained from the tank.
Choked Flow
Moist air flow through Local Restriction (MA), Variable Local Restriction (MA), or Pipe (MA) blocks can become choked. Choking occurs when the flow velocity reaches the local speed of sound. When the flow is choked, the velocity at the point of choking cannot increase any further. However, the mass flow rate can still increase if the density of the air mixture increases. This can be achieved, for example, by increasing the pressure upstream of the point of choking. The effect of choking on a moist air network is that the mass flow rate through the branch containing the choked block depends completely on the upstream pressure and temperature. As long as the choking condition is maintained, this choked mass flow rate is independent of any changes occurring in the pressure downstream.
The following model illustrates the choked flow. In this model, the
Ramp block has a slope of 0.005 and the start time of 10. The
Simulink-PS Converter block has Input
signal unit set to MPa
. All other blocks
have default parameter values. Simulation time is 50 s. When you simulate the model,
the pressure at port A of the Local Restriction (MA)
block increases linearly from atmospheric pressure, starting at 10 s. The pressure
at port B is fixed at atmospheric pressure.
The following two plots show the logged simulation data for the Local Restriction (MA) block. The Mach number at the restriction (Mach) reaches 1 at around 20 s, indicating that the flow is choked. The mass flow rate (mdot_A) before the flow is choked follows the typical quadratic behavior with respect to an increasing pressure difference. However, the mass flow rate after the flow is choked becomes linear because the choked mass flow rate depends only on the upstream pressure and temperature, and the upstream pressure is increasing linearly.
The fact that the choked mass flow rate depends only on the upstream conditions can cause an incompatibility with a Mass Flow Rate Source (MA) or a Controlled Mass Flow Rate Source (MA) block connected downstream of the choked block. Consider this model, which contains the Controlled Mass Flow Rate Source (MA) block instead of the Controlled Pressure Source (MA) block.
If the source commanded an increasing mass flow rate from left to right through the Local Restriction (MA) block, the simulation would succeed even if the flow became choked because the Controlled Mass Flow Rate Source (MA) block would be upstream of the choked block. However, in this model, the Gain block reverses the flow direction, so that the Controlled Mass Flow Rate Source (MA) block is downstream of the choked block. The pressure upstream of the Local Restriction (MA) block is fixed at atmospheric pressure. Therefore, the choked mass flow rate in this situation is constant. As the commanded mass flow rate increases, eventually it will become greater than this constant value of choked mass flow rate. At this point, the commanded mass flow rate and the choked mass flow rate cannot be reconciled and the simulation fails. Viewing the logged simulation data in the Simscape Results Explorer shows that simulation fails just at the point when the Mach number reaches 1 and the flow becomes choked.
In general, if a model is likely to choke, use pressure sources rather than mass flow rate sources. If a model contains mass flow rate source blocks and the simulation fails, use the Simscape Results Explorer to inspect the Mach number variables in all Local Restriction (MA), Variable Local Restriction (MA), and Pipe (MA) blocks connected along the same branch as the mass flow rate source. If the simulation failure occurs when the Mach number reaches 1, it is likely that there is a downstream mass flow rate source trying to command a mass flow rate greater than the possible choked mass flow rate.
Cross-Sectional Area at Block Ports
Many blocks in the moist air domain let you specify the cross-sectional area at the inlet and outlet ports as a block parameter. It is recommended that you specify the same cross-sectional area for ports that are connected together. For example, if you have port A of a Constant Volume Chamber (MA) block connected to a Pipe (MA) block, set the Cross-sectional area at port A parameter of the Constant Volume Chamber (MA) block to the same value as the Cross-sectional area parameter of the Pipe (MA) block.
Especially for high-speed flows, where Mach number is close to 1, differences in the connected port areas can result in unexpected temperature differences. For more information, see Specifying the Cross-Sectional Area at Ports.