Open tank
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
This component model is documented in Sect. 14.5 of the ThermoSysPro book.
# Tank
The tank is a reservoir containing water. It is modeled as an open volume with a constant sky pressure.
The reservoir is assumed to be a vertical cylinder.
The tank component models the mass and energy of the input flows and a possible thermal exchange with the environment.
The junctions between the tube and the tank are called *orifices*.
Overflow through the orifices is taken into account.
## Modelica component model
The equations mentioned below are implemented in the component *Tank*, located in the *WaterSteam.Volumes* sub-library.
This component has 6 connectors:
- Ce1: fluid inlet,
- Ce2: fluid inlet,
- Cs1: fluid outlet,
- Cs2: fluid outlet,
- CTh: thermal port,
- yLevel: water level output.

## Nomenclature
| Symbol| Description| Unit| Definition| Modelica name |
| :-------------------------------- | :--------------------------------------------------------------------------------------- | :------------------------------------------- | :----------------------------------------------------------------------------------------------------------- | :----------- |
|\\(a\_{\mathrm{i}}\\) | Cross-sectional area of inlet i | \\(\mathrm{m}\\)| | dei |
|\\(a\_{\mathrm{o}}\\) | Cross-sectional area of outlet o | \\(\mathrm{m}\\)|| dso |
|\\(A\\) | Cross-sectional area of the liquid in the tank |\\(\mathrm{m}^{2}\\) || A |
|\\(h\\) | Specific enthalpy of the liquid in the tank |\\(\mathrm{J} / \mathrm{kg}\\) | | h |
|\\(h\_{\mathrm{i}}\\) | Specific enthalpy of the liquid at inlet i | \\(\mathrm{J} / \mathrm{kg}\\) | | Cei.h |
|\\(h\_{\mathrm{o}}\\) | Specific enthalpy of the liquid at outlet o | \\(\mathrm{J} / \mathrm{kg}\\) | | Cso.h |
|\\(m\_{\mathrm{i}}\\) | Mass flow rate of the liquid at inlet i |\\(\mathrm{kg} / \mathrm{s}\\) || Cei.Q |
|\\(\dot{m}\_{\mathrm{o}}\\) | Mass flow rate of the liquid at outlet o |\\(\mathrm{kg} / \mathrm{s}\\) | | Cso.Q |
|\\(P\\) | Liquid average pressure in the tank | \\(\mathrm{Pa}\\)|\\(P\_{\text {atm}}+\rho . \mathrm{g} \cdot z / 2\\)| P |
|\\(P\_{\text {atm }}\\) | Pressure above the fluid level \(sky pressure\) | \\(\mathrm{Pa}\\) || Patm |
|\\(P\_{\mathrm{i}}\\) | Pressure of the liquid at inlet i | \\(\mathrm{Pa}\\) | | Cei.P |
|\\(P\_{\mathrm{o}}\\) | Pressure of the liquid at outlet o |\\(\mathrm{Pa}\\) | | Cso.P |
|\\(W\\) | Thermal power exchanged between the fluid and the heat source | \\(\mathrm{W}\\) || Cth.W |
|\\(z\\) | Liquid level in the tank | \\(\mathrm{m}\\) | | z |
|\\(z\_{i}\\) | Altitude of inlet \\(i\\) | \\(\mathrm{m}\\) || zei |
|\\(z\_{0}\\) | Altitude of outlet o | \\(\mathrm{m}\\) | | zso |
|\\(\xi\_{\mathrm{i}}\\) | Pressure loss coefficient for inlet i | \\(-\\) | | kei |
|\\(\xi\_{\mathrm{o}}\\) | Pressure loss coefficient for outlet o | \\(-\\) | | kso |
|\\(\rho\\) | Liquid density in the tank | \\(\mathrm{kg} / \mathrm{m}^{3}\\) || rhp |
## Governing equations
### Dynamic mass balance equation
- Validity domain:
\\(\forall \dot{m}\\) and \\(z>0\\)
- Mathematical formulation:
$$\rho \cdot A \cdot \frac{\mathrm{d} z}{\mathrm{d} t}=\sum\_{\mathrm{i}} \dot{m}\_{\mathrm{i}}-\sum\_{\mathrm{o}} \dot{m}\_{\mathrm{o}}$$
- Comments:
The fluid is incompressible \(i.e., the partial derivatives of the density are zero\).
### Dynamic energy balance equation
- Validity domain:
\\(\forall \dot{m}\\) and \\(z>0\\)
- Mathematical formulation:
$$\rho \cdot A \cdot z \cdot \frac{\mathrm{d} h}{\mathrm{d} t}=\sum\_{\mathrm{i}} \dot{m}\_{\mathrm{i}} \cdot\left\(h\_{\mathrm{i}}-h\right\)+\sum\_{\mathrm{o}} \dot{m}\_{\mathrm{o}} \cdot\left\(h\_{\mathrm{o}}-h\right\)+W$$
- Comments:
The fluid is incompressible \(i.e., the partial derivatives of the density are zero\).
### Pressure losses at the inlets
- Validity domain:
\\(\forall \dot{m}\_{i}\\)
- Mathematical formulation:
$$\Delta P\_{\mathrm{i}} \cdot \Omega\_{\mathrm{i}}^{2}=\frac{1}{2} \cdot \xi\_{i} \cdot \frac{\dot{m}\_{\mathrm{i}} \cdot\lvert \dot{m}\_{\mathrm{i}}\rvert }{\rho \cdot a\_{i}^{2}} \quad \text{with} \quad \Delta P\_{\mathrm{i}}=P\_{\mathrm{i}}-\left\(P\_{\mathrm{atm}}+\rho \cdot g \cdot \max \left\(z-z\_{\mathrm{i}}, 0\right\)\right\)$$
- Comments:
The orifice is modeled as a singular pressure loss that varies with the level of water:
$$\Delta P\_{\mathrm{i}}=\frac{1}{2} \cdot \xi\_{\mathrm{i}} \cdot \frac{\dot{m}\_{\mathrm{i}} \cdot\lvert \dot{m}\_{\mathrm{i}}\rvert }{\rho \cdot\left\(\Omega\_{\mathrm{i}} \cdot a\_{\mathrm{i}}\right\)^{2}}$$ where \\(\Omega\_{\mathrm{i}}\\) is the ratio between the cross-sectional area of the flow through the orifice and the cross-sectional area of the tube to or from the orifice. When the orifice is empty, \\(\Omega\_{\mathrm{i}}=0\\). When the orifice is full, \\(\Omega\_{\mathrm{i}}=1\\).
When \\(\dot{m}\_{\mathrm{i}} \geq 0\\) \(direct flow\), then \\(\Omega\_{\mathrm{i}}=1 .\\) This means that the tube is always full when the fluid is entering the tank. Assuming uniform distribution of the flow velocity at the inlet, the pressure loss coefficient can be taken equal to unity \\(\xi\_{\mathrm{i}}=1\\) When \\(\dot{m}\_{\mathrm{i}}<0\\) \(backflow\), i.e., when the overflowing fluid is leaving the tank, \\(\Omega\_{\mathrm{i}}\\) depends on the level of water w.r.t. the orifice.
For a circular orifice of diameter \\(d\_{\mathrm{i}}\\):
$$ \Omega_{\mathrm{i}}=\left\{\begin{array}{l} 0 \text{ for } z \leq z_{i}-\frac{d_{i}}{2} \\ 1 \text{ for } z \geq z_{\mathrm{i}}+\frac{d_{\mathrm{i}}}{2} \\ \frac{\pi+2 \cdot \theta_{i}+\sin \left(2 \cdot \theta_{i}\right)}{2 \cdot \pi} \text{ for } z_{i}-\frac{d_{i}}{2} \leq z \leq z_{i}+\frac{d_{i}}{2} \\ \text{ with } \theta_{\mathrm{i}}=\arcsin \left(\left(z-z_{\mathrm{i}}\right) / d_{\mathrm{i}} / 2\right) \end{array}\right.$$
For a square orifice of side \\(d\_{\mathrm{i}}\\):
$$ \Omega_{\mathrm{i}}=\left\{\begin{array}{l} 0 \text{ for } z \leq z_{i}-\frac{d_{i}}{2} \\ 1 \text{ for } z \geq z_{\mathrm{i}}+\frac{d_{\mathrm{i}}}{2} \\ \frac{z-z_{i}+d_{i} / 2}{d_{i}} \text{ for } z_{i}-\frac{d_{i}}{2} \leq z \leq z_{i}+\frac{d_{i}}{2} \end{array}\right.$$
The value of \\(\xi\_{\mathrm{i}}\\) depends on the geometry of the junction. If the junction is not protruding inside the tank, then one can take \\(\xi\_{\mathrm{i}}=0.5\\).
### Pressure losses at the outlets
- Validity domain:
\\(\forall \dot{m}\_{o}\\)
- Mathematical formulation:
$$\Delta P\_{\mathrm{o}} \cdot \Omega\_{\mathrm{o}}^{2}=\frac{1}{2} \cdot \xi\_{\mathrm{o}} \cdot \frac{\dot{m}\_{\mathrm{o}} \cdot\lvert \dot{m}\_{\mathrm{o}}\rvert }{\rho \cdot a\_{\mathrm{o}}^{2}} \quad \text{with} \quad \Delta P\_{\mathrm{o}}=P\_{\text {atm}}+\rho \cdot g \cdot \max \left\(z-z\_{\mathrm{o}}, 0\right\)-P\_{\mathrm{o}}$$
- Comments:
The phenomenon is similar to pressure losses at the inlet, except that the flow is leaving the tank when \\(\dot{m}\_{\mathrm{o}}>0\\).
## References
El Hefni, Baligh and Bouskela, Daniel (2019). [Modeling and Simulation of Thermal Power Plants with ThermoSysPro](https://link.springer.com/book/10.1007/978-3-030-05105-1), sect. 14.5. Springer Nature Switzerland AG.
Author Daniel Bouskela
Generated at 2026-07-12T20:48:41Z by OpenModelicaOpenModelica 1.27.0 using
GenerateDoc.mos