modelVolumeRealGas_L4
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:


flow velocity in energy cells:
, for i in 1:N_cv (number of control volumes)
Density in flow model:
,for i in 2:N_cv
and the density in the first and last momentum cell:
![rho_FM[1]=(rho_in+rho[1])/2](resources/TransiEnt/Resources/Images/equations/equation-SdWVxCFe.png)
![rho_FM[N_cv+1]=(rho_out+rho[N_cv])/2](resources/TransiEnt/Resources/Images/equations/equation-MNE1D0m6.png)
Pressure drop due to friction and gravity:
, 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)](resources/TransiEnt/Resources/Images/equations/equation-2yHwORzo.png)
![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])](resources/TransiEnt/Resources/Images/equations/equation-9xLaxLsk.png)
If there is no friction at the inlet:
![Delta_p_grav[1] = 0](resources/TransiEnt/Resources/Images/equations/equation-Df4rC8tX.png)
![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)](resources/TransiEnt/Resources/Images/equations/equation-bfjV5v9r.png)
If there is friction at the outlet:
![Delta_p_grav[N_cv+1] =rho[N_cv]*g_n*(z_out - z[N_cv])](resources/TransiEnt/Resources/Images/equations/equation-FFWU6G3c.png)
![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])](resources/TransiEnt/Resources/Images/equations/equation-IJqboncH.png)
If there is no friction at the outlet:
![Delta_p_grav[N_cv+1] = 0](resources/TransiEnt/Resources/Images/equations/equation-wtsOsr8g.png)
![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])](resources/TransiEnt/Resources/Images/equations/equation-nbrkl7Re.png)
Fluid mass:

Equations for calculating the cell states:
The model differentiates between four different kind of mass balances and a constant or variable composition.
Quasi-stationary:
, for i in 1:N_cv
, 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.
, for i in 1:N_cv
For all components considered fully variable:
, 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:
, for j in dependentCompositionEntries[1:end - 1] and for i in 1:geo.N_cv
For constant composition:
, for i in 1:N_cv and for j in 1:nc-1
Static momentum balance in the momentum cells:
, 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]](resources/TransiEnt/Resources/Images/equations/equation-Mu3mP7U9.png)
![0 = p[N_cv] - p_out - Delta_p_fric[N_cv + 1] - Delta_p_grav[N_cv + 1]](resources/TransiEnt/Resources/Images/equations/equation-XDKUC6XQ.png)
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
| Type | Name | Default | Description |
|---|---|---|---|
| Integer[:] | dependentCompositionEntries | if 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_nom | TILMedia.Internals.VLEFluidConfigurations.FullyMixtureCompatible.VLEFluidFunctions.density_phxi(medium, p_nom, h_nom, xi_nom) | Nominal density |
| Fundamental Definitions | |||
| TILMedia.VLEFluidTypes.BaseVLEFluid | medium | simCenter.gasModel1 | Medium in the component |
| Boolean | constantComposition | simCenter.useConstCompInGasComp | true 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 |
| Integer | massBalance | 1 | Mass balance and species balance fomulation |
| SI.Pressure | p_min_assert | 0 | Minimum pressure in component and ports below which the simulation terminates |
| SI.Pressure | p_max_assert | 1000e5 | Maximum pressure in component and ports above which the simulation terminates |
| Boolean | frictionAtInlet | false | True if pressure loss between first cell and inlet shall be considered |
| Boolean | frictionAtOutlet | false | True if pressure loss between last cell and outlet shall be considered |
| Nominal Values | |||
| ClaRa.Basics.Units.Pressure[geo.N_cv] | p_nom | ones(geo.N_cv)*(simCenter.p_amb_const + simCenter.p_eff_2) | Nominal pressure |
| ClaRa.Basics.Units.EnthalpyMassSpecific[geo.N_cv] | h_nom | ones(geo.N_cv)*(-1850) | Nominal specific enthalpy for single tube |
| ClaRa.Basics.Units.MassFlowRate | m_flow_nom | 1 | Nominal mass flow w.r.t. all parallel tubes |
| ClaRa.Basics.Units.PressureDifference | Delta_p_nom | 1e4 | Nominal pressure loss w.r.t. all parallel tubes |
| ClaRa.Basics.Units.MassFraction[medium.nc - 1] | xi_nom | medium.xi_default | Nominal composition |
| Initialisation | |||
| Integer | initOption | 0 | Type of initialisation |
| ClaRa.Basics.Units.EnthalpyMassSpecific[geo.N_cv] | h_start | TILMedia.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_start | p_nom | Initial pressure |
| ClaRa.Basics.Units.MassFraction[medium.nc - 1] | xi_start | xi_nom | Initial composition for single tube |
| ClaRa.Basics.Units.MassFlowRate[geo.N_cv + 1] | m_flow_start | m_flow_nom*ones(geo.N_cv + 1) | Initial mass flow rate |
| Modelica.Units.SI.Temperature[geo.N_cv] | T_start | ones(geo.N_cv)*simCenter.T_ground | Initial temperature for single tube (used in calculation of h_start) |
| Initialisation › Model Settings | |||
| Boolean | useHomotopy | simCenter.useHomotopy | true, if homotopy method is used during initialisation |
| Summary and Visualisation | |||
| Boolean | showExpertSummary | simCenter.showExpertSummary | True, if an extended summary shall be shown, else false |
| Boolean | showData | false | True, if a data port containing p,T,h,s,m_flow shall be shown, else false |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| TransiEnt.Basics.Interfaces.Gas.RealGasPortIn | gasPortIn | Inlet port | |
| TransiEnt.Basics.Interfaces.Gas.RealGasPortOut | gasPortOut | Outlet port | |
| ClaRa.Basics.Interfaces.HeatPort_a[geo.N_cv] | heat |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| String | complexity (from ComplexityLevel) | "??" | |
| TransiEnt.SimCenter | simCenter | ||
| Summary | summary | ||
| ClaRa.Basics.Units.EnthalpyMassSpecific[geo.N_cv] | h | Cell enthalpy | |
| ClaRa.Basics.Units.Temperature[geo.N_cv] | T | Cell temperature | |
| PressureLoss | pressureLoss | Pressure loss model | |
| HeatTransfer | heatTransfer | heat transfer model | |
| Geometry | geo | ||
| MechanicalEquilibrium | mechanicalEquilibrium | Mechanical equilibrium model |
Contents
| Name | Description |
|---|---|