modelVolumeRealGas_L4

A 1D tube-shaped control volume considering one-phase heat transfer in a straight pipe with static momentum balance and simple energy balance

Extends from ClaRa.Basics.Icons.Volume_L4, ClaRa.Basics.Icons.ComplexityLevel (Displays the complexity level inside model icon ).

Information

1. Purpose of model

A 1D tube-shaped control volume considering one-phase and two-phase heat transfer and Pressure Loss in a straight pipe with static momentum balance and simple energy balance. It is a modified version of the model ClaRa.Basics.ControlVolumes.FluidVolumes.VolumeVLE_L4 from ClaRa version 1.3.0.

2. Level of detail, physical effects considered, and physical insight

The pipe can be discretized in the length direction (L4). It uses real gas mixtures (VLEFluids).

It can be chosen if changes in the composition shall be considered or not. In the first case, it considers the time delay of the change of the mass fraction from inlet to outlet.

Compared to the ClaRa version, the simCenter, media model and connectors were exchanged for TransiEnt instances. The two-phase region is deactivated and a xi_nom as well as an m_flow_start is added. Also, different mass balance equations are added. You can choose a quasi-stationary and three different dynamic implementations, see below. Additionally, the parameter variableCompositionEntries can be used in case that not all components are freely variable, e.g. when hydrogen is fed into natural gas.

3. Limits of validity

(no remarks)

4. Interfaces

RealGasPorts

5. Nomenclature

(no remarks)

6. Governing Equations

Velocity at inlet and outlet:

w_inlet=m_flow/(A_cross_FM*rho_inlet)

w_outlet=m_flow/(A_cross_FM*rho_outlet)

flow velocity in energy cells:

w[i]=(m_flow[i]+m_flow[i+1])/(2*rho*A_cross), for i in 1:N_cv (number of control volumes)

Density in flow model:

rho_FM[i]=(rho[i]+rho[i-1])/2,for i in 2:N_cv

and the density in the first and last momentum cell:

rho_FM[1]=(rho_in+rho[1])/2

rho_FM[N_cv+1]=(rho_out+rho[N_cv])/2

Pressure drop due to friction and gravity:


Delta_p_grav[i] =(rho[i]*Delta_x[i] +rho[i-1]*Delta_x[i - 1])/(Delta_x[i - 1] + Delta_x[i])*g_n*(z[i] - z[i - 1]), for i in 3: N_cv-1

If there is friction at the inlet:


Delta_p_grav[1] =rho[1]*g_n*(z[1] - z_in)



Delta_p_grav[2] =(rho[1]*Delta_x[1] + rho[2]*Delta_x[2])/(Delta_x[2] +Delta_x[1])*g_n*(.z[2] - z[1])

If there is no friction at the inlet:


Delta_p_grav[1] = 0

Delta_p_grav[2] =(rho[1]*Delta_x[1] + rho[2]*Delta_x[2]/2)/(Delta_x[2]/2 +Delta_x[1])*g_n*(z[2] - z_in)

If there is friction at the outlet:


 Delta_p_grav[N_cv+1] =rho[N_cv]*g_n*(z_out - z[N_cv])

Delta_p_grav[N_cv] =(rho[N_cv-1]*Delta_x[N_cv - 1] +rho[N_cv]*Delta_x[N_cv])/(Delta_x[N_cv - 1] +.Delta_x[N_cv])*g_n*(.z[N_cv] - z[N_cv - 1])

If there is no friction at the outlet:

Delta_p_grav[N_cv+1] = 0


Delta_p_grav[N_cv] =(rho[N_cv-1]*Delta_x[N_cv - 1]/2 + rho[N_cv]*Delta_x[N_cv])/(Delta_x[N_cv - 1]/2 + Delta_x[N_cv])*g_n*(z_out - z[N_cv - 1])

Fluid mass:

m = V* rho_mix

Equations for calculating the cell states:

The model differentiates between four different kind of mass balances and a constant or variable composition.

Quasi-stationary:

0=der(rho[i]), for i in 1:N_cv

0=m_flow[i]-m_flow[i+1], for i in 1:N_cv

Dynamic:

Here, you can pick three different mathematically identical equations which are treated differently numerically. In the following, only the mathematical notation of the general equations is shown.

der(rho[i])*V[i]=m_flow[i]-m_flow[i+1], for i in 1:N_cv

For all components considered fully variable:

der(xi[i, j]) = 1/m[i]*((Xi_flow[i, j] - m_flow[i]*xi[i, j]) - (Xi_flow[i + 1, j] - m_flow[i + 1]*xi[i, j])), for i in 1:N_cv and for j in 1:nc-1 (number of components -1)

For the components which are dependent on other components:

xi[i, j] = (1 - (sum(xi[i, k] for k in variableCompositionEntries[1:end - 1]) + xi_end[i]))/(1 - (sum(xi_nom[k] for k in variableCompositionEntries[1:end - 1]) + 1 - sum(xi_nom)))*xi_nom[j], for j in dependentCompositionEntries[1:end - 1] and for i in 1:geo.N_cv

For constant composition:

xi[i, j] = xi[j,nom], for i in 1:N_cv and for j in 1:nc-1

Static momentum balance in the momentum cells:

 0 = p[i - 1] - p[i] - Delta_p_fric[i] - Delta_p_grav[i] , for i in 2:N_cv

and for the first and last momentum cell


0 =p_in - p[1] - Delta_p_fric[1] - Delta_p_grav[1]


0 = p[N_cv] - p_out - Delta_p_fric[N_cv + 1] - Delta_p_grav[N_cv + 1]


7. Remarks for Usage

Use of certain heat transfer models can lead to warnings like "Differentiating (if pipe_xy.iCom.m_flow_in[1] > 0.0 then junction_beforePipe.gasBulk.xi[1] else junction_beforePipe.gasBulk.xi[1]) under the assumption that it is continuous at switching.". This can be ignored as long as the composition is set to the same value in every component (even in sinks etc.).

8. Validation

(no remarks)

9. References

copied and changed from ClaRa.Basics.ControlVolumes.FluidVolumes.VolumeVLE_L4, v1.3.0

10. Version History

Model created by Tom Lindemann (tom.lindemann@tuhh.de), Jun 2015

Modified by Carsten Bode (c.bode@tuhh.de), Okt 2015

Modified by Lisa Andresen (andresen@tuhh.de), May 2016

Revised by Carsten Bode (c.bode@tuhh.de), Apr 2018 (updated to ClaRa 1.3.0)

Modified by Carsten Bode (c.bode@tuhh.de), Feb 2019 (added temperature start value)

Modified by Carsten Bode (c.bode@tuhh.de), Sep 2019 (merged constXi and varXi models)

Modified by Carsten Bode (c.bode@tuhh.de), May 2020 (added quasi-stationary equations and simplified equations for only dependent mass fractions)

Modified by Robert Flesch (flesch@xrg-simulation.de), Sep 2020 (included new ICom, exchanged ph fluid models to pT, turned of density derivative calculation)

Parameters

TypeNameDefaultDescription
Integer[:]dependentCompositionEntriesif variableCompositionEntries[1] == 0 then 1:medium.nc else findSetDifference(1:medium.nc, variableCompositionEntries)Entries of medium vector which are supposed to be dependent on the variable entries
ClaRa.Basics.Units.DensityMassSpecific[geo.N_cv]rho_nomTILMedia.Internals.VLEFluidConfigurations.FullyMixtureCompatible.VLEFluidFunctions.density_phxi(medium, p_nom, h_nom, xi_nom)Nominal density
Fundamental Definitions
TILMedia.VLEFluidTypes.BaseVLEFluidmediumsimCenter.gasModel1Medium in the component
BooleanconstantCompositionsimCenter.useConstCompInGasComptrue if composition of gas in the pipe is constant (xi_nom will be used)
Integer[:]variableCompositionEntries{0}Entries of medium vector which are supposed to be completely variable
IntegermassBalance1Mass balance and species balance fomulation
SI.Pressurep_min_assert0Minimum pressure in component and ports below which the simulation terminates
SI.Pressurep_max_assert1000e5Maximum pressure in component and ports above which the simulation terminates
BooleanfrictionAtInletfalseTrue if pressure loss between first cell and inlet shall be considered
BooleanfrictionAtOutletfalseTrue if pressure loss between last cell and outlet shall be considered
Nominal Values
ClaRa.Basics.Units.Pressure[geo.N_cv]p_nomones(geo.N_cv)*(simCenter.p_amb_const + simCenter.p_eff_2)Nominal pressure
ClaRa.Basics.Units.EnthalpyMassSpecific[geo.N_cv]h_nomones(geo.N_cv)*(-1850)Nominal specific enthalpy for single tube
ClaRa.Basics.Units.MassFlowRatem_flow_nom1Nominal mass flow w.r.t. all parallel tubes
ClaRa.Basics.Units.PressureDifferenceDelta_p_nom1e4Nominal pressure loss w.r.t. all parallel tubes
ClaRa.Basics.Units.MassFraction[medium.nc - 1]xi_nommedium.xi_defaultNominal composition
Initialisation
IntegerinitOption0Type of initialisation
ClaRa.Basics.Units.EnthalpyMassSpecific[geo.N_cv]h_startTILMedia.Internals.VLEFluidConfigurations.FullyMixtureCompatible.VLEFluidFunctions.specificEnthalpy_pTxi(medium, p_start, T_start, xi_start)Initial specific enthalpy for single tube
ClaRa.Basics.Units.Pressure[geo.N_cv]p_startp_nomInitial pressure
ClaRa.Basics.Units.MassFraction[medium.nc - 1]xi_startxi_nomInitial composition for single tube
ClaRa.Basics.Units.MassFlowRate[geo.N_cv + 1]m_flow_startm_flow_nom*ones(geo.N_cv + 1)Initial mass flow rate
Modelica.Units.SI.Temperature[geo.N_cv]T_startones(geo.N_cv)*simCenter.T_groundInitial temperature for single tube (used in calculation of h_start)
Initialisation › Model Settings
BooleanuseHomotopysimCenter.useHomotopytrue, if homotopy method is used during initialisation
Summary and Visualisation
BooleanshowExpertSummarysimCenter.showExpertSummaryTrue, if an extended summary shall be shown, else false
BooleanshowDatafalseTrue, if a data port containing p,T,h,s,m_flow shall be shown, else false

Connectors

TypeNameDefaultDescription
TransiEnt.Basics.Interfaces.Gas.RealGasPortIngasPortInInlet port
TransiEnt.Basics.Interfaces.Gas.RealGasPortOutgasPortOutOutlet port
ClaRa.Basics.Interfaces.HeatPort_a[geo.N_cv]heat

Components

TypeNameDefaultDescription
Stringcomplexity (from ComplexityLevel)"??"
TransiEnt.SimCentersimCenter
Summarysummary
ClaRa.Basics.Units.EnthalpyMassSpecific[geo.N_cv]hCell enthalpy
ClaRa.Basics.Units.Temperature[geo.N_cv]TCell temperature
PressureLosspressureLossPressure loss model
HeatTransferheatTransferheat transfer model
Geometrygeo
MechanicalEquilibriummechanicalEquilibriumMechanical equilibrium model

Contents

NameDescription
Outline
Wall_L4
Inlet
Outlet
Fluid
Summary
PressureLoss
HeatTransfer
Geometry
MechanicalEquilibrium