Main Content

Constant Volume Chamber (G)

Chamber with fixed volume of gas and variable number of ports

  • Constant Volume Chamber (G) block

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:

MpdpIdt+MTdTIdt=m˙A+m˙B+m˙C+m˙D,

where:

  • Mp is the partial derivative of the mass of the gas volume with respect to pressure at constant temperature and volume.

  • MT is the partial derivative of the mass of the gas volume with respect to temperature at constant pressure and volume.

  • pI is the pressure of the gas volume. The pressure at ports A, B, C, and D is assumed to be equal to this pressure, pA = pB = pC = pD = pI.

  • TI is the temperature of the gas volume. The temperature at port H is assumed to be equal to this temperature, TH = TI.

  • t is time.

  • 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.

  • 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.

  • 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.

  • 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:

UpdpIdt+UTdTIdt=ΦA+ΦB+ΦC+ΦD+QH,

where:

  • Up is the partial derivative of the internal energy of the gas volume with respect to pressure at constant temperature and volume.

  • UT 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.

  • QH 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:

Mp=VρIpIMT=VρITIUp=V(hIZRTI1)UT=VρI(cpIhITI)

where:

  • ρI is the density of the gas volume.

  • V is the volume of gas.

  • hI is the specific enthalpy of the gas volume.

  • Z is the compressibility factor.

  • R is the specific gas constant.

  • cpI 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:

Mp=VρIβIMT=VρIαIUp=V(ρIhIβITIαI)UT=VρI(cpIhIαI)

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.

Ports

Conserving

expand all

Gas conserving port associated with the chamber inlet.

Gas conserving port associated with the second chamber inlet.

Dependencies

This port is visible if you set the Number of ports parameter to 2, 3, or 4.

Gas conserving port associated with the third chamber inlet.

Dependencies

This port is visible if you set the Number of ports parameter to 3 or 4.

Gas conserving port associated with the fourth chamber inlet. If a chamber has four inlet ports, you can use it as a junction in a cross connection.

Dependencies

This port is visible only if you set the Number of ports parameter to 4.

Thermal conserving port associated with the temperature of the gas inside the chamber.

Parameters

expand all

Volume of gas in the chamber. The chamber is rigid and therefore its volume is constant during simulation. The chamber is assumed to be completely filled with gas at all times.

Number of inlet ports in the chamber. The chamber can have between one and four ports, labeled from A to D. When you modify the parameter value, the corresponding ports are exposed or hidden in the block icon.

Cross-sectional area of the chamber inlet at port A, in the direction normal to gas flow path.

Cross-sectional area of the chamber inlet at port B, in the direction normal to gas flow path.

Dependencies

Enabled when port B is visible, that is, when the Number of ports parameter is set to 2, 3, or 4.

Cross-sectional area of the chamber inlet at port C, in the direction normal to gas flow path.

Dependencies

Enabled when port C is visible, that is, when the Number of ports parameter is set to 3 or 4.

Cross-sectional area of the chamber inlet at port D, in the direction normal to gas flow path.

Dependencies

Enabled when port D is visible, that is, when the Number of ports parameter is set to 4.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced in R2016b