CRYOLIB Home | Components | Ports | Classes | Functions | Enumeratives | Global Variables

CRYOLIB.AbsTank



ABSTRACT COMPONENT AbsTank IS_A Capacity

DESCRIPTION:
Base component of all the tanks

DOCUMENTATION:

Inherited from the abstract component 'Capacity', this component represents a 0D tank volume. It is the simplest model of a tank. Liquid and vapor are assumed to be at the same equilibrium temperature. One phase state (sub cooled or superheated fluids) is also included in the formulation.



CONSTRUCTION PARAMETERS:
NAME  TYPE  DEFAULT  DESCRIPTION  UNITS  
Heat_Transfer ENUM HeatTransfer hc_calc Heat transfer coefficient calculation  
nports_in INTEGER    
nports_out INTEGER    

PORTS:
NAME  TYPE  PARAMETERS  DIRECTION  CARDINALITY  DESCRIPTION  
Level_Sensor_percent PORTS_LIB.analog_signal  (n = 1)  OUT   Level transmitter (%) 
Pressure_Sensor PORTS_LIB.analog_signal  (n = 1)  OUT   Pressure transmitter (bar) 
Temperature_Sensor PORTS_LIB.analog_signal  (n = 1)  OUT   Temperature transmitter (K) 
f_in[nports_in] fluid  IN   Inlet fluid 
f_out[nports_out] fluid  OUT   Outlet Gas 

DATA:
NAME  TYPE  DEFAULT  RANGE  DESCRIPTION  UNITS  
REAL  0.5  Diameter 
REAL   Height 
Po REAL   Initial pressure bar 
Q_d REAL   Design radiation losses 
T_env REAL  300  Temperature of the environment 
To REAL  300  Initial temperature 
Tw_d REAL  300  Design temperature of the wall 
hc_dat REAL  100  Heat transfer coefficient defined by the user W/(m^2�K) 
init_condition ENUM InitSepType Gas  Initial condition in the volume: gas or two_phase 
level_o REAL  20  Initial level 
mat ENUM THERMAL.Material SS_304  Wall material 
overfl_f REAL  0.01  Ratio of the characteristic outlet flanges to tank diameter - for overflowing calculation (-) 
thw REAL  0.01  Wall thickness 
z_bottom REAL   Elevation of the volume/tank base w.r.t. the coordinate system set by the user  
z_in[nports_in] REAL   Elevation of inlets ports (m) 
z_out[nports_out] REAL   Elevation of outlet ports (m) 

DECLS:
NAME  TYPE  INITIAL  RANGE  DESCRIPTION  UNITS  
REAL    Area m^2 
Cpw REAL    Wall heat transfer coefficient J/(kg�K) 
REAL    Mass flow per unit area kg/(s�m^2) 
HTOption ENUM FLUID_PROP.HT_OPTION     
REAL    Total mass kg 
Mw REAL    Wall mass kg 
Nu REAL    Nusselt number 
REAL    Pressure bar 
Pr REAL    Prandtl number 
Qrad REAL     
Re REAL    Reynolds number 
Sw REAL    Wall surface m^2 
REAL    Temperature 
Tf REAL    Film temperature 
Tsat REAL    Saturation temperature 
Tw REAL    Wall temperature 
REAL    Total volume m^3 
alp_in[nports_in] REAL    Void fraction 
alp_out[nports_out] REAL    Void fraction 
alpha REAL    Void fraction 
cond REAL    Conductivity W/(m�K) 
cond_g REAL    Conductivity W/(m�K) 
cond_l REAL    Conductivity W/(m�K) 
cp REAL    Heat transfer coefficient J/(kg�K) 
cp_g REAL    Heat transfer coefficient J/(kg�K) 
cp_l REAL    Heat transfer coefficient J/(kg�K) 
dP_in[nports_in] REAL    Additional pressure difference inlet in ports Pa 
dP_out[nports_out] REAL    Additional pressure difference outlet in ports Pa 
drho_dh REAL    Partial derivative of density with respect enthalpy at constant pressure J/M^3/J/kg 
drho_dp REAL    Partial derivative of density with respect pressure at constant enthalpy  
error_flag INTEGER      
REAL    Enthalpy J/kg 
h_film REAL    Film enthalpy J/kg 
h_g REAL    Enthalpy J/kg 
h_l REAL    Enthalpy J/kg 
hc REAL    Heat transfer coefficient W/(m^2�K) 
ier INTEGER    Error index of thermodynamic function calls 
ier2 INTEGER    Error index of thermodynamic function calls 
ier3 INTEGER    Error index of thermodynamic function calls 
ier4 INTEGER    Error index of thermodynamic function calls 
ier5 INTEGER    Error index of thermodynamic function calls 
ier6 INTEGER    Error index of thermodynamic function calls 
ier7 INTEGER    Error index of thermodynamic function calls 
ier8 INTEGER    Error index of thermodynamic function calls 
level REAL    Level in the phase separator 
m_avg REAL    Average mass kg 
m_tot_in REAL    Total massflow entering/ Total massflow leaving kg/s 
m_tot_out REAL    Total massflow entering/ Total massflow leaving kg/s 
phase ENUM FLUID_PROP.Phase   Phase of the fluid 
REAL    Heat flow 
rho REAL    Density kg/m^3 
rho_g REAL    Gas density kg/m^3 
rho_l REAL    Liquid density kg/m^3 
rhow REAL    Wall density kg/m^3 
sigma REAL    Surface tension N/m 
REAL    Specific internal energy J/kg 
vel REAL    Velocity m/s 
visc REAL    Viscosity Pa�s 
visc_g REAL    Viscosity Pa�s 
visc_l REAL    Viscosity Pa�s 
vsound REAL    Sound speed m/s 
REAL    Quality 
x_in[nports_in] REAL    Quality 
x_out[nports_out] REAL    Quality 
z_in_e[nports_in] REAL   Elevation of inlets ports (m) 
z_level REAL     
z_out_e[nports_out] REAL   Elevation of outlet ports (m) 
z_top REAL    Elevation at the top of the volume relative to a z fixed axis (m) 
FORMULATION:



Capacity formulation:

Below are the general equations for a non-adiabatic constant volume. It is assumed that all the mixture (non condensable plus main fluid in liquid, gas or two phase conditions) is at only one temperature.

Mass conservation equation

whereis the volume of the component, is the massflow entering and leaving the volume and ρ is the density of the fluid in the component.

Energy conservation equation

where�� is the volume of the node i, is the massflow and ρ is the density of the node, u is the internal energy, h the enthalpy, is the velocity of the fluid, the slope of the pipe and g gravity.

 

Energy conservation equation

 

where and u are the fluid mixture (including two phase flow) density, and the total energy respectively; mi,hi and mj,hj are the mass and enthalpy flows at port number i/j calculated at the connected resistive type components.

 

Pressure, temperature and quality calculation

The above conservation equations enable calculating the derivatives of the mixture density and mixture energy. These variables can be integrated, so they are known at any time.

Assuming thermodynamic equilibrium, the conservation equations are always valid even if the fluid conditions are liquid, vapor or homogeneous two phase flow. Then, the complete thermodynamic state (partial pressures, temperature, quality �) can be calculated using the pure fluid thermodynamic routines:

CRYO_FL_state_vs_ru(fluid, eos, rho, u-0.5*vel**2, phase, rho_f, rho_g, P, T, Tsat, h_f, h_g,x, alpha, cp, cp_f, cp_g, drho_dp, drho_dh, vsound, visc, visc_f, visc_g, cond, cond_f, cond_g, sigma, ier)

Inputs are: fluid and eos with the fluid name and its type; rho and u are the mixture density and the mixture energy (dynamic variables).

All the arguments from phase (liquid, vapor or two-phase) to ier (the error code) are outputs: x, alpha are the quality and the void fraction respectively; drho_dp, drho_dh are thermo derivatives;

Both actual and saturated (liquid and vapor) properties are returned. So, cp, cp_f, cp_g are the mixture, saturated liquid and saturated vapor heat capacities respectively; h_f, h_g are the saturated liquid and vapor enthalpies, rho_f, rho_g the saturated liquid and vapor densities, etc.

 

Initialization

The component Capacity and all its child components can be initialized by means of the variable 'init_condition'. If 'init_condition' is Gas then the state variables ρ and υ are calculated calling the function CRYO_PF_prop_vs_pT with the initial temperature (To) and pressure (Po) defined by the user. In the case that 'init_condition' is TwoPhases then the temperature in the tank is the saturation temperature for the pressure defined by the user. The void fraction is calculated as function of the initial level of liquid defined by the user:

And density and quality are calculated as follows:

The internal energy is calculated calling the function CRYO_PF_prop_vs_Px with the pressure and the quality previously calculated.

 




AbsTank formulation:

Mass and energy conservation equations are inherited from the Capacity component.

Calculation of the Liquid Surface Elevation

Under two-phase flow conditions, with gravity forces, and assuming a constant vapor/liquid surface area, the liquid surface elevation z_level is calculated as follows:

where z_bottom is the bottom elevation of the volume, is the void fraction and L the longitud of the tank.

The void fraction is calculated according to the Homogeneous Equilibrium Model (HEM) method. The pressure elevation at port number i produced by the liquid column under gravity forces is:

where g is the actual gravity acceleration.

Over-flowing an outlet

The Tank model takes into account that the liquid surface elevation can move through the outlets. The quality and the void fraction at the outlet port number i are calculated as a smoothing between 0 and 1 when the liquid level passes near the junction elevation:

andare the gas and liquid densities calculated by the state functions. overfl_f is the ratio of the characteristic outlet flanges diameter to tank diameter. The enthalpy and density at the outlets will be calculated as a homogeneous two-phase flow with the previously calculated local void fraction j:

where h_g and h_f are the gas and liquid enthalpies; , is the mixture density in the tank, all of them calculated by the state functions.

Gravity & Port heights

Tank models can simulate the liquid level passing through a fluid port in such a way that the exiting flow can be liquid or gas depending on the liquid level. So, a 'liquid' outlet will be automatically connected to the gas volume if the remaining liquid in the tank is below the level of such fluid port, which is an input data through the connected junction.

It is assumed that the gravity acts in only one direction, i.e. top or bottom (positive through the bottom). Only the vertical vector is active because the lateral accelerations are not included in the formulation.

The liquid height of a Tank is taken into account to calculate the liquid column pressure.

 







Document generated automatically with EcosimPro Version: 5.4.14 Date: 2015:02:02 Time: 12:52:58