Package Modelica.​Fluid.​Pipes.​BaseClasses
Base classes used in the Pipes package (only of interest to build new component models)

Information

This icon shall be used for a package/library that contains base models and classes, respectively.

Extends from Modelica.​Icons.​BasesPackage (Icon for packages containing base classes).

Package Contents

NameDescription
CharacteristicNumbersFunctions to compute characteristic numbers
FlowModelsFlow models for pipes, including wall friction, static head and momentum flow
HeatTransferHeat transfer for flow models
PartialStraightPipeBase class for straight pipe models
PartialTwoPortFlowBase class for distributed flow models
WallFrictionDifferent variants for pressure drops due to pipe wall friction

Partial Model Modelica.​Fluid.​Pipes.​BaseClasses.​PartialStraightPipe
Base class for straight pipe models

Information

Base class for one dimensional flow models. It specializes a PartialTwoPort with a parameter interface and icon graphics.

Extends from Modelica.​Fluid.​Interfaces.​PartialTwoPort (Partial component with two ports).

Parameters

TypeNameDefaultDescription
BooleanallowFlowReversalsystem.​allowFlowReversal= true to allow flow reversal, false restricts to design direction (port_a -> port_b)
RealnParallel1Number of identical parallel pipes
Lengthlength Length
BooleanisCirculartrue= true if cross sectional area is circular
Diameterdiameter Diameter of circular pipe
AreacrossArea0.25 * (Modelica.Constants.pi * diameter * diameter)Inner cross section area
LengthperimeterModelica.Constants.pi * diameterInner perimeter
Roughnessroughness2.5e-5Average height of surface asperities (default: smooth steel pipe)
final VolumeVcrossArea * length * nParallelvolume size
Lengthheight_ab0Height(port_b) - Height(port_a)

Connectors

TypeNameDescription
FluidPort_aport_aFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bFluid connector b (positive design flow direction is from port_a to port_b)

Partial Model Modelica.​Fluid.​Pipes.​BaseClasses.​PartialTwoPortFlow
Base class for distributed flow models

Information

Base class for distributed flow models. The total volume is split into nNodes segments along the flow path. The default value is nNodes=2.

Mass and Energy balances

The mass and energy balances are inherited from Interfaces.PartialDistributedVolume. One total mass and one energy balance is formed across each segment according to the finite volume approach. Substance mass balances are added if the medium contains more than one component.

An extending model needs to define the geometry and the difference in heights between the flow segments (static head). Moreover it needs to define two vectors of source terms for the distributed energy balance:

Momentum balance

The momentum balance is determined by the FlowModel component, which can be replaced with any model extended from BaseClasses.FlowModels.PartialStaggeredFlowModel. The default setting is DetailedPipeFlow.

This considers

Model Structure

The momentum balances are formulated across the segment boundaries along the flow path according to the staggered grid approach. The configurable modelStructure determines the formulation of the boundary conditions at port_a and port_b. The options include (default: av_vb):

When connecting two components, e.g., two pipes, the momentum balance across the connection point reduces to

pipe1.port_b.p = pipe2.port_a.p

This is only true if the flow velocity remains the same on each side of the connection. Consider using a fitting for any significant change in diameter or fluid density, if the resulting effects, such as change in kinetic energy, cannot be neglected. This also allows for taking into account friction losses with respect to the actual geometry of the connection point.

Extends from Modelica.​Fluid.​Interfaces.​PartialTwoPort (Partial component with two ports) and Modelica.​Fluid.​Interfaces.​PartialDistributedVolume (Base class for distributed volume models).

Parameters

TypeNameDefaultDescription
BooleanallowFlowReversalsystem.​allowFlowReversal= true to allow flow reversal, false restricts to design direction (port_a -> port_b)
final IntegernnNodesNumber of discrete volumes
DynamicsenergyDynamicssystem.​energyDynamicsFormulation of energy balances
DynamicsmassDynamicssystem.​massDynamicsFormulation of mass balances
final DynamicssubstanceDynamicsmassDynamicsFormulation of substance balances
final DynamicstraceDynamicsmassDynamicsFormulation of trace substance balances
AbsolutePressurep_a_startsystem.​p_startStart value of pressure at port a
AbsolutePressurep_b_startp_a_startStart value of pressure at port b
final AbsolutePressureps_start[n]if 1 < n then linspace(p_a_start, p_b_start, n) else {0.5 * (p_a_start + p_b_start)}Start value of pressure
Booleanuse_T_starttrueUse T_start if true, otherwise h_start
TemperatureT_startif use_T_start then system.T_start else Medium.temperature_phX(0.5 * (p_a_start + p_b_start), h_start, X_start)Start value of temperature
SpecificEnthalpyh_startif use_T_start then Medium.specificEnthalpy_pTX(0.5 * (p_a_start + p_b_start), T_start, X_start) else Medium.h_defaultStart value of specific enthalpy
MassFractionX_start[Medium.nX]Medium.​X_defaultStart value of mass fractions m_i/m
ExtraPropertyC_start[Medium.nC]Medium.​C_defaultStart value of trace substances
RealnParallel1Number of identical parallel flow devices
Lengthlengths[n] lengths of flow segments
AreacrossAreas[n] cross flow areas of flow segments
Lengthdimensions[n] hydraulic diameters of flow segments
Roughnessroughnesses[n] Average heights of surface asperities
Lengthdheights[n]zeros(n)Differences in heights of flow segments
DynamicsmomentumDynamicssystem.​momentumDynamicsFormulation of momentum balances
MassFlowRatem_flow_startsystem.​m_flow_startStart value for mass flow rate
IntegernNodes2Number of discrete flow volumes
ModelStructuremodelStructureTypes.​ModelStructure.​av_vbDetermines whether flow or volume models are present at the ports
BooleanuseLumpedPressurefalse=true to lump pressure states together
final IntegernFMif useLumpedPressure then nFMLumped else nFMDistributednumber of flow models in flowModel
final IntegernFMDistributedif modelStructure == Types.ModelStructure.a_v_b then n + 1 else if modelStructure == Types.ModelStructure.a_vb or modelStructure == Types.ModelStructure.av_b then n else n - 1 
final IntegernFMLumpedif modelStructure == Types.ModelStructure.a_v_b then 2 else 1 
final IntegeriLumpedinteger(0.5 * n) + 1Index of control volume with representative state if useLumpedPressure
BooleanuseInnerPortPropertiesfalse=true to take port properties for flow models from internal control volumes

Connectors

TypeNameDescription
FluidPort_aport_aFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bFluid connector b (positive design flow direction is from port_a to port_b)