modelPhysicalPL_L4

Physical pressure loss model

Extends from TransiEnt.Components.Gas.VolumesValvesFittings.Base.PressureLoss_L4_extICom (VLE || PL Base Class with extended iCom).

Information

1. Purpose of model

This model is a physical pressure loss model, which can also model disturbances.

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

The model considers the actual pressure loss of a one-phase fluid in a pipe in the turbulent regime. The calculation of the Darcy friction factor has been copied from Modelica.Fluid.Dissipation.PressureLoss.StraightPipe.dp_turbulent_MFLOW since it is numerically more efficient to integrate the equations directly in the model and it gives more insight.

Viscosity can be chosen to be constant or a correlation can be used.

Linearization can be used to achieve better numerical efficiency and stability.

numberOfMFlowNoDist is used to apply disturbances at the indices of m_flow. From t_dist_start until t_dist_end the corresponding mass flow rates are set to zero.

3. Limits of validity

This model is only valid in the turbulent regime. The linearization should be adjusted according to the application.

4. Interfaces

(none)

5. Nomenclature

(no elements)

6. Governing Equations

The correlation for the viscosity is:

eta = coeff_visc[1]+ coeff_visc[2]*p+ coeff_visc[3]*T+ sum(coeff_visc[4:end]*xi) with T=T_const

The pressure loss can be calculated according to [1]:

which can be transformed into

which can be simplified to

using the arithmetic mean of the density of inlet and outlet of each control volume. For the Reynolds number also the arithmetic mean of the viscosity is used.

7. Remarks for Usage

The default viscosity correlation coefficients for natural gas have been curve fitted for pressures of 1,10,20...100 bar, temperatures of 5,10,15 °C for the compositions of natural gas "Russland", "Verbundgas", "Nordsee I" and "Nordsee II" from [1] p.51 and hydrogen shares of 0,10...100 mole-% with a goodness of fit of 0.8013. The usual viscosity changes in natural gas pipelines have no big impact on the pressure loss so a linear correlation should be sufficient. The same was done for methane-hydrogen mixtures.

For pure hydrogen, the default setting is that another correlation for pure hydrogen is used which was determinded for pressures of 1,10,20...100 bar and temperatures of 5,10,15 °C with a goodness of fit of 0.9958.

8. Validation

The model has been validated against the compressible pressure loss calculation.

9. References

[1] G. Cerbe, B. Lendt, K. Brüggemann, M. Dehli, F. Gröschl, K. Heikrodt, T. Kleiber, J. Kuck, J. Mischner, T. Schmidt, A. Seemann, and W. Thielen, Grundlagen der Gastechnik. Gasbeschaffung - Gasverteilung - Gasverwendung, 8th ed. München: Carl Hanser Verlag, 2017.

10. Version History

Model created by Carsten Bode (c.bode@tuhh.de), Sep 2019

Modified by Carsten Bode (c.bode@tuhh.de), Aug 2020 (viscosity correlation, more exact calculation, elimination of FluidDissipation function)

Modified by Robert Flesch (flesch@xrg-simulation.de), Sep 2020 (linearization, new iCom)

Modified by Carsten Bode (c.bode@tuhh.de), Apr 2021 (added disturbance)

Parameters

TypeNameDefaultDescription
BooleanfrictionAtInlet (from PressureLoss_L4_extICom)
BooleanfrictionAtOutlet (from PressureLoss_L4_extICom)
BooleanuseHomotopy (from PressureLoss_L4_extICom)
SI.MassFlowRatem_flow_nom (from PressureLoss_L4_extICom)iCom.m_flow_nomNominal mass flow rate
SI.PressureDifferenceDelta_p_nom (from PressureLoss_L4_extICom)iCom.Delta_p_nomNominal pressure loss wrt. all parallel tubes
IntegerloopStartif frictionAtInlet then 1 else 2First index of loop
IntegerloopEndif frictionAtOutlet then iCom.N_cv + 1 else iCom.N_cvLast index of loop
IntegerloopIdxloopStart:loopEndAll loop indices
IntegernotLoopIdxif frictionAtInlet and frictionAtOutlet then fill(1, 0) elseif frictionAtInlet and not frictionAtOutlet then {iCom.N_cv + 1} elseif not frictionAtInlet and frictionAtOutlet then {1} else {1, iCom.N_cv + 1}All indices that do not appear in the loop
Modelica.Units.SI.Lengthd_hydgeo.diameter_hyd[1]Hydraulic diameter
RealkDk/d_hydRelative roughness
Modelica.Units.SI.AreaA_crossModelica.Constants.pi*d_hyd^2/4Circular cross sectional area
Modelica.Units.SI.Length[geo.N_cv + 1]Liif not frictionAtInlet and not frictionAtOutlet then geo.Delta_x_FM*geo.length/(geo.length - geo.Delta_x_FM[1] - geo.Delta_x_FM[iCom.N_cv + 1]) elseif not frictionAtInlet and frictionAtOutlet then geo.Delta_x_FM*geo.length/(geo.length - geo.Delta_x_FM[1]) elseif frictionAtInlet and not frictionAtOutlet then geo.Delta_x_FM*geo.length/(geo.length - geo.Delta_x_FM[iCom.N_cv + 1]) else geo.Delta_x_FMLength
Integer[:]numberOfMFlowNoDistif numberOfMFlowDist[1] == 0 then 1:iCom.N_cv + 1 else findSetDifference(1:iCom.N_cv + 1, numberOfMFlowDist)numbers of mass flows which will be undisturbed
Fundamental Definitions
Modelica.Units.SI.HeightksimCenter.roughnessGasPipesAbsolute roughness
RealMINModelica.Constants.epsLimiter
Realfactor1Factor to modify pressure loss
Modelica.Units.SI.PressureDifferencedp_switch1000Pressure difference at which function is linearized
Modelica.Fluid.Dissipation.Utilities.Types.RoughnessroughnessModelica.Fluid.Dissipation.Utilities.Types.Roughness.Considered
Viscosity
BooleanuseViscCorrfalsetrue if viscosity correlation shall be used, false for constant viscosity
Real[iCom.mediumModel.nc - 1 + 3]coeff_viscif iCom.mediumModel.nc == 1 then {2.77160904091864e-06, 1.37797594879264e-14, 2.05004849130428e-08} elseif iCom.mediumModel.nc == 2 then {3.49826606827002e-07, 1.04303247526047e-13, 2.71567407127824e-08, 2.80651000814681e-06} else {-1.43911039529083e-05, 3.75699281723867e-13, 1.96789492178842e-08, 1.89714979419216e-05, 2.93055875111180e-05, -1.78595469221118e-06, -1.29406293799004e-05, 1.02682267821617e-05, 4.15851977756051e-05}Coefficients for viscosity calculation (1st for constant part, 2nd for pressure, 3rd for temperature, rest for n-1 composition entries (vector must have nine entries, no matter how many components the gas consists of; the remaining entries will be ignored))
Modelica.Units.SI.TemperatureT_constsimCenter.T_groundConstant temperature for viscosity calculation
Modelica.Units.SI.Pressurep_nomiCom.p_nomNominal pressure for viscosity calculation
Modelica.Units.SI.MassFraction[iCom.mediumModel.nc - 1]xi_nomiCom.xi_nomNominal composition for viscosity calculation
Modelica.Units.SI.DynamicViscosityeta_constcoeff_visc[1] + coeff_visc[2]*p_nom + coeff_visc[3]*T_const + sum({coeff_visc[3 + j]*xi_nom for j in 1:iCom.mediumModel.nc - 1})Constant dynamic viscosity
Disturbance
Integer[:]numberOfMFlowDist{0}0 for no disturbance, otherwise give number (1...N_cv+1)
Modelica.Units.SI.Timet_dist_start1e10Start time of disturbance
Modelica.Units.SI.Timet_dist_endt_dist_start + 1End time of disturbance

Components

TypeNameDefaultDescription
TransiEnt.Components.Gas.VolumesValvesFittings.Base.IComVLE_L3_OnePort_extendediCom (from PressureLoss_L4_extICom)
ClaRa.Basics.ControlVolumes.Fundamentals.Geometry.PipeGeometry_N_cvgeo (from PressureLoss_L4_extICom)
SI.PressureDifference[geo.N_cv + 1]Delta_p (from PressureLoss_L4_extICom)Pressure difference
SI.MassFlowRate[geo.N_cv + 1]m_flow (from PressureLoss_L4_extICom)
TransiEnt.SimCentersimCenter
Modelica.Units.SI.Density[iCom.N_cv + 1]rhoDensity
Modelica.Units.SI.DynamicViscosity[iCom.N_cv + 1]etaDynamic Viscosity
Modelica.Units.SI.MassFlowRate[iCom.N_cv + 1]m_flow_1Mass flow rate in one tube
Modelica.Fluid.Dissipation.Utilities.Types.DarcyFrictionFactor[iCom.N_cv + 1]lambda_FRI_calc_switchAdapted Darcy friction factor
SI.ReynoldsNumber[iCom.N_cv + 1]Re_switchReynolds number assuming turbulent regime
SI.MassFlowRate[iCom.N_cv + 1]m_flow_switch
Modelica.Fluid.Dissipation.Utilities.Types.DarcyFrictionFactor[iCom.N_cv + 1]lambda_FRI_calcAdapted Darcy friction factor
SI.ReynoldsNumber[iCom.N_cv + 1]Re_turbReynolds number assuming turbulent regime
SI.Velocity[iCom.N_cv + 1]velocityMean velocity
Real[iCom.N_cv + 1]m_flow_rel_distRelative mass flow due to the disturbance, 1 if no disturbance, 0 if disturbance

Contents

NameDescription
TYP1