modelTank

Open tank
Diagram of Tank

Information

## 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.  
   
![modelica://ThermoSysPro/UsersGuide/Documentation/ThermoSysPro.WaterSteam.Volumes.Tank.svg](modelica://ThermoSysPro/UsersGuide/Documentation/ThermoSysPro.WaterSteam.Volumes.Tank.svg)  

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

Parameters

TypeNameDefaultDescription
Units.SI.AbsolutePressurePatm1.013e5Pressure above the fluid level
Units.SI.AreaA1Tank cross sectional area
Units.SI.Positionze140Altitude of inlet 1
Units.SI.Positionze2de2/2Altitude of inlet 2
Units.SI.Positionzs140Altitude of outlet 1
Units.SI.Positionzs2ds2/2Altitude of outlet 2
Units.SI.Diameterde10.20Diameter of inlet 1
Units.SI.Diameterde20.20Diameter of inlet 2
Units.SI.Diameterds10.20Diameter of outlet 1
Units.SI.Diameterds20.20Diameter of outlet 2
Units.SI.Positionz030Initial fluid level (active if steady_state=false)
Units.SI.SpecificEnthalpyh01.e5Initial fluid specific enthalpy (active if steady_state=false)
Realke11Pressure loss coefficient for inlet e1
Realke21Pressure loss coefficient for inlet e2
Realks11Pressure loss coefficient for outlet s1
Realks21Pressure loss coefficient for outlet s2
Booleandynamic_mass_balancefalsetrue: dynamic mass balance equation - false: static mass balance equation
Booleansteady_statefalsetrue: start from steady state - false: start from h0
Booleansteady_state_mechfalsetrue: start from steady state - false: start from z0
Integerfluid11: water/steam - 2: C3H3F5
Units.SI.Densityp_rho0If > 0, fixed fluid density
Integermode0IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic

Connectors

TypeNameDefaultDescription
ThermoSysPro.InstrumentationAndControl.Connectors.OutputRealyLevelWater level
Connectors.FluidInletCe1
Connectors.FluidOutletCs2
ThermoSysPro.Thermal.Connectors.ThermalPortCth
Connectors.FluidInletCe2
Connectors.FluidOutletCs1

Components

TypeNameDefaultDescription
Units.SI.PositionzFluid level
Units.SI.TemperatureTFluid temperature
Units.SI.AbsolutePressurePFluid average pressure
Units.SI.SpecificEnthalpyhFluid average specific enthalpy
Units.SI.DensityrhoFluid density
Units.SI.MassFlowRateBQRight hand side of the mass balance equation
Units.SI.PowerBHRight hand side of the energy balance equation
ThermoSysPro.Units.SI.PressureDifferencedeltaP_e1Presure loss for e1
ThermoSysPro.Units.SI.PressureDifferencedeltaP_e2Presure loss for e2
ThermoSysPro.Units.SI.PressureDifferencedeltaP_s1Presure loss for s1
ThermoSysPro.Units.SI.PressureDifferencedeltaP_s2Presure loss for s2
Realomega_e1
Realomega_e2
Realomega_s1
Realomega_s2
Units.SI.Angletheta_e1
Units.SI.Angletheta_e2
Units.SI.Angletheta_s1
Units.SI.Angletheta_s2
ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_phproWater properties

Revisions

Author  

Daniel Bouskela