Pressurized tank with variable gas and thermal liquid volumes

**Library:**Fluid Network Interfaces / Tanks & Accumulators

The Tank (G-TL) block models the accumulation of mass and energy in a chamber with separate gas and thermal liquid volumes. The total fluid volume is fixed but the individual gas and thermal liquid volumes are free to vary. Two gas ports allow for gas flow and a variable number of thermal liquid ports, ranging from one to three, allow for thermal liquid flow. The thermal liquid ports can be at different elevations.

**Tank Inlets and Inlet Heights ( y)**

The tank is pressurized but the pressurization is not fixed. It changes during simulation with the pressure in the gas volume. It rises when the pressure of the gas volume rises and it falls when the pressure of the gas volume falls. The thermal liquid volume is assumed to be at equilibrium with the gas volume and its pressure is therefore the same as that of the gas.

The fluid volumes can exchange energy with other fluid components and with the environment but not with each other. The fluid volumes behave as if they were isolated from each other by an insulated membrane. Energy exchanges with other components occur through gas or thermal liquid ports, while exchanges with the environment occur, strictly in the form of heat, through thermal ports.

Use this block to model components such as drain tanks, in which water condensed from a compressed gas system is trapped at the bottom by gravity and expelled through a drain outlet. Note, however, that neither gas nor thermal liquid domains capture the effects of phase change—and therefore that this block cannot capture the effects of condensation.

The number of thermal liquid ports depends on the block variant that is active. To
view or change the active variant, right-click the block and select **Simscape** > **Block Choices**. The `One inlet`

variant exposes thermal
liquid port **A2**, the `Two inlets`

variant adds port **B2**, and the ```
Three
inlets
```

variant adds port **C2**.

The total volume of the tank is equal to the sum of the gas and thermal liquid volumes that it contains:

$${V}_{\text{T}}={V}_{\text{L}}+{V}_{\text{G}},$$

$${\dot{V}}_{\text{G}}=-{\dot{V}}_{\text{L}}.$$

$${M}_{\text{L}}={\rho}_{\text{L}}{V}_{\text{L}},$$

$${\dot{M}}_{\text{L}}={V}_{\text{L}}{\dot{\rho}}_{\text{L}}+{\dot{V}}_{\text{L}}{\rho}_{\text{L}},$$

$${\dot{\rho}}_{\text{L}}=\frac{{\rho}_{\text{L}}}{{\beta}_{\text{L}}}{\dot{p}}_{\text{L}}-{\alpha}_{\text{L}}{\rho}_{\text{L}}{\dot{T}}_{\text{L}},$$

*β*is the isothermal bulk modulus.*ɑ*is the isobaric thermal expansion coefficient.*p*is the fluid pressure.*T*is the fluid temperature.

Rearranging terms gives the rate of change of the thermal liquid volume and, by extension, of the gas volume:

$${\dot{V}}_{\text{G}}=-{\dot{V}}_{\text{L}}\approx {V}_{\text{L}}\left(\frac{{\dot{p}}_{\text{L}}}{{\beta}_{\text{L}}}-{\alpha}_{\text{L}}{\dot{T}}_{\text{L}}\right)-\frac{{\dot{M}}_{\text{L}}}{{\rho}_{\text{L}}}$$

The rate of mass accumulation in each fluid volume is equal to the net mass flow rate into that fluid volume. In the thermal liquid volume:

$${\dot{M}}_{\text{L}}={\displaystyle \sum _{i=\text{A2,B2,C2}}{\dot{m}}_{i}},$$

```
Three
inlets
```

variant). The rate of mass accumulation contains
contributions from pressure, temperature, and volume change:$${\dot{M}}_{\text{L}}={V}_{\text{L}}\left(\frac{{\rho}_{\text{L}}}{{\beta}_{\text{L}}}{\dot{p}}_{\text{G}}-{\alpha}_{\text{L}}{\rho}_{\text{L}}{\dot{T}}_{\text{L}}\right)+{\dot{V}}_{\text{L}}{\rho}_{\text{L}},$$

$${\dot{M}}_{\text{G}}={\displaystyle \sum _{i=\text{A1,B1}}{\dot{m}}_{i}},$$

$${\dot{M}}_{\text{G}}={\frac{dM}{dp}|}_{\text{G}}{\dot{p}}_{\text{G}}+{\frac{dM}{dT}|}_{\text{G}}{\dot{T}}_{\text{G}}+{\dot{V}}_{\text{G}}{\rho}_{\text{G}},$$

$${\frac{dM}{dp}|}_{\text{G}}{\dot{p}}_{\text{G}}+{\frac{dM}{dT}|}_{\text{G}}{\dot{T}}_{\text{G}}+\left[{V}_{\text{L}}\left(\frac{{\dot{p}}_{\text{G}}}{{\beta}_{\text{L}}}-{\alpha}_{\text{L}}{\dot{T}}_{\text{L}}\right)-\frac{{\dot{M}}_{\text{L}}}{{\rho}_{\text{L}}}\right]{\rho}_{\text{G}}={\displaystyle \sum _{i=\text{A1,B1}}{\dot{m}}_{i}}.$$

$${\dot{p}}_{\text{G}}\left({\frac{dM}{dp}|}_{\text{G}}+\frac{{\rho}_{\text{G}}{V}_{\text{L}}}{{\beta}_{\text{L}}}\right)+\left({\dot{T}}_{\text{G}}{\frac{dM}{dT}|}_{\text{G}}-{\dot{T}}_{\text{L}}{\rho}_{\text{G}}{V}_{\text{L}}{\alpha}_{\text{L}}\right)={\displaystyle \sum _{i=\text{A1,B1}}{\dot{m}}_{i}}+\frac{{\rho}_{\text{G}}}{{\rho}_{\text{L}}}{\displaystyle \sum _{i=\text{A2,B2,C2}}{\dot{m}}_{i}},$$

The rate of energy accumulation in each fluid volume is the sum of the energy flow rates through the fluid inlets, the heat flow rate through the corresponding thermal port, and the energy flow rate due to volume changes. For the gas volume:

$${\dot{p}}_{\text{G}}\left({\frac{dU}{dp}|}_{\text{G}}+{\rho}_{\text{G}}{h}_{\text{G}}\frac{{V}_{\text{L}}}{{\beta}_{\text{L}}}\right)+\left({\dot{T}}_{\text{G}}{\frac{dU}{dT}|}_{\text{G}}-{\dot{T}}_{\text{L}}{\rho}_{\text{G}}{h}_{\text{G}}{V}_{\text{L}}{\alpha}_{\text{L}}\right)={Q}_{\text{H1}}+{\displaystyle \sum _{i=\text{A1,B1}}{\varphi}_{i}}+\frac{{\rho}_{\text{G}}}{{\rho}_{\text{L}}}{h}_{\text{G}}{\displaystyle \sum _{i=\text{A2,B2,C2}}{\dot{m}}_{i}},$$

*U*is the total energy of the fluid volume.*h*is the fluid enthalpy.*Q*is the heat flow rate through the thermal port.*ϕ*_{i}are the energy flow rates through the fluid inlets.

As before, the pressure and temperature derivatives depend on the type of gas specified in the Gas Properties (G) block. See the equations section of the Translational Mechanical Converter (G) block reference page for their definitions. For the thermal liquid volume:

$${\dot{p}}_{\text{L}}{\frac{dU}{dp}|}_{\text{L}}+{\dot{T}}_{\text{L}}{\frac{dU}{dT}|}_{\text{L}}={Q}_{\text{H2}}+{\displaystyle \sum _{i=\text{A2,B2,C2}}{\varphi}_{i}}+{\displaystyle \sum _{i=\text{A2,B2,C2}}\dot{m}g\left(y(i)-y\right)-{h}_{\text{L}}{\displaystyle \sum _{i=\text{A2,B2,C2}}{\dot{m}}_{i}}},$$

$${\frac{dU}{dp}|}_{\text{L}}=-{T}_{\text{L}}{\alpha}_{\text{L}}{V}_{\text{L}},$$

$${\frac{dU}{dT}|}_{\text{L}}={c}_{p,\text{L}}{\rho}_{\text{L}}{V}_{\text{L}},$$

Flow resistance due to friction or other causes is ignored in both fluid volumes. The effect of elevation on inlet pressure is also ignored, but only on the gas side. The gas inlet pressures are therefore equal to each other and to the internal pressure of the gas volume:

$${p}_{\text{A1}}={p}_{\text{B1}}={p}_{\text{G}}.$$

The thermal liquid inlet pressures are each a function of inlet depth. The
internal pressure of the thermal liquid volume is equal to that of the gas volume (*p*_{L} =
*p*_{G}). Including the dynamic pressures
(*p*_{i,dyn}) at the inlets:

$${p}_{i}+{p}_{i,\text{dyn}}={p}_{\text{G}}+{\rho}_{\text{L}}\left(y-{y}_{i}\right)g,$$

$${p}_{i,\text{dyn}}=\{\begin{array}{cc}\frac{1}{2}{\rho}_{i}{v}_{i}^{2},& \text{if}{\dot{m}}_{i}0\\ 0,& \text{if}{\dot{m}}_{i}\ge 0\end{array}$$

Was this topic helpful?