# Constant Volume Chamber (MA)

Chamber with fixed volume of moist air and variable number of ports

**Libraries:**

Simscape /
Foundation Library /
Moist Air /
Elements

## Description

The Constant Volume Chamber (MA) block models mass and energy storage in a moist air network. The chamber contains a constant volume of moist air. It can have between one and four inlets. The enclosure can exchange mass and energy with the connected moist air network and exchange heat with the environment, allowing its internal pressure and temperature to evolve over time. The pressure and temperature evolve based on the compressibility and thermal capacity of the moist air volume. Liquid water condenses out of the moist air volume when it reaches saturation.

The block equations use these symbols. Subscripts `a`

,
`w`

, and `g`

indicate the properties of dry air,
water vapor, and trace gas, respectively. Subscript `ws`

indicates
water vapor at saturation. Subscripts `A`

, `B`

,
`C`

, `D`

, `H`

, and
`S`

indicate the appropriate port. Subscript `I`

indicates the properties of the internal moist air volume.

$$\dot{m}$$ | Mass flow rate |

Φ | Energy flow rate |

Q | Heat flow rate |

p | Pressure |

ρ | Density |

R | Specific gas constant |

V | Volume of moist air inside the chamber |

c_{v} | Specific heat at constant volume |

h | Specific enthalpy |

u | Specific internal energy |

x | Mass fraction
(x_{w} is specific humidity,
which is another term for water vapor mass fraction) |

y | Mole fraction |

φ | Relative humidity |

r | Humidity ratio |

T | Temperature |

t | Time |

The net flow rates into the moist air volume inside the chamber are

$$\begin{array}{l}{\dot{m}}_{net}={\dot{m}}_{A}+{\dot{m}}_{B}+{\dot{m}}_{C}+{\dot{m}}_{D}-{\dot{m}}_{condense}+{\dot{m}}_{wS}+{\dot{m}}_{gS}\\ {\Phi}_{net}={\Phi}_{A}+{\Phi}_{B}+{\Phi}_{C}+{\Phi}_{D}+{Q}_{H}-{\Phi}_{condense}+{\Phi}_{S}\\ {\dot{m}}_{w,net}={\dot{m}}_{wA}+{\dot{m}}_{wB}+{\dot{m}}_{wC}+{\dot{m}}_{wD}-{\dot{m}}_{condense}+{\dot{m}}_{wS}\\ {\dot{m}}_{g,net}={\dot{m}}_{gA}+{\dot{m}}_{gB}+{\dot{m}}_{gC}+{\dot{m}}_{gD}+{\dot{m}}_{gS}\end{array}$$

where:

$$\dot{m}$$

_{condense}is the rate of condensation.*Φ*_{condense}is the rate of energy loss from the condensed water.*Φ*_{S}is the rate of energy added by the sources of moisture and trace gas. $${\dot{m}}_{wS}$$ and $${\dot{m}}_{gS}$$ are mass flow rates of water and gas, respectively, through port**S**. The values of $${\dot{m}}_{wS}$$, $${\dot{m}}_{gS}$$, and*Φ*_{S}are determined by the moisture and trace gas sources connected to port**S**of the chamber, or by the corresponding parameter values on the**Moisture and Trace Gas**tab.

If a port is not visible, then the terms with the subscript corresponding to the port name are 0.

Water vapor mass conservation relates the water vapor mass flow rate to the dynamics of the moisture level in the internal moist air volume:

$$\frac{d{x}_{wI}}{dt}{\rho}_{I}V+{x}_{wI}{\dot{m}}_{net}={\dot{m}}_{w,net}$$

Similarly, trace gas mass conservation relates the trace gas mass flow rate to the dynamics of the trace gas level in the internal moist air volume:

$$\frac{d{x}_{gI}}{dt}{\rho}_{I}V+{x}_{gI}{\dot{m}}_{net}={\dot{m}}_{g,net}$$

Mixture mass conservation relates the mixture mass flow rate to the dynamics of the pressure, temperature, and mass fractions of the internal moist air volume:

$$\left(\frac{1}{{p}_{I}}\frac{d{p}_{I}}{dt}-\frac{1}{{T}_{I}}\frac{d{T}_{I}}{dt}\right){\rho}_{I}V+\frac{{R}_{a}-{R}_{w}}{{R}_{I}}\left({\dot{m}}_{w,net}-{x}_{w}{\dot{m}}_{net}\right)+\frac{{R}_{a}-{R}_{g}}{{R}_{I}}\left({\dot{m}}_{g,net}-{x}_{g}{\dot{m}}_{net}\right)={\dot{m}}_{net}$$

Finally, energy conservation relates the energy flow rate to the dynamics of the pressure, temperature, and mass fractions of the internal moist air volume:

$${\rho}_{I}{c}_{vI}V\frac{d{T}_{I}}{dt}+\left({u}_{wI}-{u}_{aI}\right)\left({\dot{m}}_{w,net}-{x}_{w}{\dot{m}}_{net}\right)+\left({u}_{gI}-{u}_{aI}\right)\left({\dot{m}}_{g,net}-{x}_{g}{\dot{m}}_{net}\right)+{u}_{I}{\dot{m}}_{net}={\Phi}_{net}$$

The equation of state relates the mixture density to the pressure and temperature:

$${p}_{I}={\rho}_{I}{R}_{I}{T}_{I}$$

The mixture specific gas constant is

$${R}_{I}={x}_{aI}{R}_{a}+{x}_{wI}{R}_{w}+{x}_{gI}{R}_{g}$$

Flow resistance and thermal resistance are not modeled in the chamber:

$$\begin{array}{l}{p}_{A}={p}_{B}={p}_{C}={p}_{D}={p}_{I}\\ {T}_{H}={T}_{I}\end{array}$$

When the moist air volume reaches saturation, condensation may occur. The specific humidity at saturation is

$${x}_{wsI}={\phi}_{ws}\frac{{R}_{I}}{{R}_{w}}\frac{{p}_{wsI}}{{p}_{I}}$$

where:

*φ*_{ws}is the relative humidity at saturation (typically 1).*p*_{wsI}is the water vapor saturation pressure evaluated at*T*_{I}.

The rate of condensation is

$${\dot{m}}_{condense}=\{\begin{array}{ll}0,\hfill & \text{if}{x}_{wI}\le {x}_{wsI}\hfill \\ \frac{{x}_{wI}-{x}_{wsI}}{{\tau}_{condense}}{\rho}_{I}V,\hfill & \text{if}{x}_{wI}{x}_{wsI}\hfill \end{array}$$

where *τ*_{condense} is the value of the
**Condensation time constant** parameter.

The condensed water is subtracted from the moist air volume, as shown in the conservation equations. The energy associated with the condensed water is

$${\Phi}_{condense}={\dot{m}}_{condense}\left({h}_{wI}-\Delta {h}_{vapI}\right)$$

where *Δh*_{vapI} is the specific enthalpy of
vaporization evaluated at *T*_{I}.

Other moisture and trace gas quantities are related to each other as follows:

$$\begin{array}{l}{\phi}_{wI}=\frac{{y}_{wI}{p}_{I}}{{p}_{wsI}}\\ {y}_{wI}=\frac{{x}_{wI}{R}_{w}}{{R}_{I}}\\ {r}_{wI}=\frac{{x}_{wI}}{1-{x}_{wI}}\\ {y}_{gI}=\frac{{x}_{gI}{R}_{g}}{{R}_{I}}\\ {x}_{aI}+{x}_{wI}+{x}_{gI}=1\end{array}$$

### Variables

To set the priority and initial target values for the block variables prior to simulation, use
the **Initial Targets** section in the block dialog box or Property
Inspector. For more information, see Set Priority and Initial Target for Block Variables and Initial Conditions for Blocks with Finite Moist Air Volume.

Nominal values provide a way to specify the expected magnitude of a variable in a model.
Using system scaling based on nominal values increases the simulation robustness. Nominal
values can come from different sources, one of which is the **Nominal
Values** section in the block dialog box or Property Inspector. For more
information, see Modify Nominal Values for a Block Variable.

### Assumptions and Limitations

The chamber walls are perfectly rigid.

Flow resistance between the chamber inlet and the moist air volume is not modeled. Connect a Local Restriction (MA) block or a Flow Resistance (MA) block to port

**A**to model the pressure losses associated with the inlet.Thermal resistance between port

**H**and the moist air volume is not modeled. Use Thermal library blocks to model thermal resistances between the moist air mixture and the environment, including any thermal effects of a chamber wall.

## Ports

### Output

### Conserving

## Parameters

## Extended Capabilities

## Version History

**Introduced in R2018a**