# Constant Volume Chamber (G)

Chamber with fixed volume of gas and variable number of ports

**Libraries:**

Simscape /
Foundation Library /
Gas /
Elements

## Description

The Constant Volume Chamber (G) block models mass and energy storage in a gas network. The chamber contains a constant volume of gas. It can have between one and four inlets. The enclosure can exchange mass and energy with the connected gas 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 gas volume.

### Mass Balance

Mass conservation relates the mass flow rates to the dynamics of the pressure and temperature of the internal node representing the gas volume:

$$\frac{\partial M}{\partial p}\cdot \frac{d{p}_{\text{I}}}{dt}+\frac{\partial M}{\partial T}\cdot \frac{d{T}_{\text{I}}}{dt}={\dot{m}}_{\text{A}}+{\dot{m}}_{\text{B}}+{\dot{m}}_{\text{C}}+{\dot{m}}_{\text{D}},$$

where:

$$\frac{\partial M}{\partial p}$$ is the partial derivative of the mass of the gas volume with respect to pressure at constant temperature and volume.

$$\frac{\partial M}{\partial T}$$ is the partial derivative of the mass of the gas volume with respect to temperature at constant pressure and volume.

*p*_{I}is the pressure of the gas volume. The pressure at ports**A**,**B**,**C**, and**D**is assumed to be equal to this pressure,*p*_{A}=*p*_{B}=*p*_{C}=*p*_{D}=*p*_{I}.*T*_{I}is the temperature of the gas volume. The temperature at port**H**is assumed to be equal to this temperature,*T*_{H}=*T*_{I}.*t*is time.$$\dot{m}$$

_{A}is the mass flow rate at port**A**. The flow rate associated with a port is positive when it flows into the block.$$\dot{m}$$

_{B}is the mass flow rate at port**B**. The flow rate associated with a port is positive when it flows into the block.$$\dot{m}$$

_{C}is the mass flow rate at port**C**. The flow rate associated with a port is positive when it flows into the block.$$\dot{m}$$

_{D}is the mass flow rate at port**D**. The flow rate associated with a port is positive when it flows into the block.

### Energy Balance

Energy conservation relates the energy and heat flow rates to the dynamics of the pressure and temperature of the internal node representing the gas volume:

$$\frac{\partial U}{\partial p}\cdot \frac{d{p}_{\text{I}}}{dt}+\frac{\partial U}{\partial T}\cdot \frac{d{T}_{\text{I}}}{dt}={\Phi}_{\text{A}}+{\Phi}_{\text{B}}+{\Phi}_{\text{C}}+{\Phi}_{\text{D}}+{Q}_{\text{H}},$$

where:

$$\frac{\partial U}{\partial p}$$ is the partial derivative of the internal energy of the gas volume with respect to pressure at constant temperature and volume.

$$\frac{\partial U}{\partial T}$$ is the partial derivative of the internal energy of the gas volume with respect to temperature at constant pressure and volume.

Ф

_{A}is the energy flow rate at port**A**.Ф

_{B}is the energy flow rate at port**B**.Ф

_{C}is the energy flow rate at port**C**.Ф

_{D}is the energy flow rate at port**D**.*Q*_{H}is the heat flow rate at port**H**.

### Partial Derivatives for Perfect and Semiperfect Gas Models

The partial derivatives of the mass *M* and the internal energy
*U* of the gas volume, with respect to pressure and temperature at
constant volume, depend on the gas property model. For perfect and semiperfect gas models,
the equations are:

$$\begin{array}{l}\frac{\partial M}{\partial p}=V\frac{{\rho}_{I}}{{p}_{I}}\\ \frac{\partial M}{\partial T}=-V\frac{{\rho}_{I}}{{T}_{I}}\\ \frac{\partial U}{\partial p}=V\left(\frac{{h}_{I}}{ZR{T}_{I}}-1\right)\\ \frac{\partial U}{\partial T}=V{\rho}_{I}\left({c}_{pI}-\frac{{h}_{I}}{{T}_{I}}\right)\end{array}$$

where:

*ρ*_{I}is the density of the gas volume.*V*is the volume of gas.*h*_{I}is the specific enthalpy of the gas volume.*Z*is the compressibility factor.*R*is the specific gas constant.*c*_{pI}is the specific heat at constant pressure of the gas volume.

### Partial Derivatives for Real Gas Model

For real gas model, the partial derivatives of the mass *M* and the internal
energy *U* of the gas volume, with respect to pressure and temperature at
constant volume, are:

$$\begin{array}{l}\frac{\partial M}{\partial p}=V\frac{{\rho}_{I}}{{\beta}_{I}}\\ \frac{\partial M}{\partial T}=-V{\rho}_{I}{\alpha}_{I}\\ \frac{\partial U}{\partial p}=V\left(\frac{{\rho}_{I}{h}_{I}}{{\beta}_{I}}-{T}_{I}{\alpha}_{I}\right)\\ \frac{\partial U}{\partial T}=V{\rho}_{I}\left({c}_{pI}-{h}_{I}{\alpha}_{I}\right)\end{array}$$

where:

*β*is the isothermal bulk modulus of the gas volume.*α*is the isobaric thermal expansion coefficient of the gas volume.

### 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 Gas 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.

There is no flow resistance between ports

**A**,**B**,**C**, and**D**and the chamber interior.There is no thermal resistance between port

**H**and the chamber interior.

## Examples

## Ports

### Conserving

## Parameters

## Extended Capabilities

## Version History

**Introduced in R2016b**