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

CRYOLIB.Capacity



ABSTRACT COMPONENT Capacity

DOCUMENTATION:

This component simulates a volume with several fluid ports named f_in[i], f_out[j]. It is the basic capacitive abstract component containing the mass and energy conservation equations for these types of components.



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  
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 
Po REAL   Initial pressure bar 
To REAL  300  Initial temperature 
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 
thw REAL  0.01  Wall thickness 

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

 







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