Package Modelica.​Fluid.​Pipes
Devices for conveying fluid

Information

Extends from Modelica.​Icons.​VariantsPackage (Icon for package containing variants).

Package Contents

NameDescription
BaseClassesBase classes used in the Pipes package (only of interest to build new component models)
DynamicPipeDynamic pipe model with storage of mass and energy
StaticPipeBasic pipe flow model without storage of mass or energy

Model Modelica.​Fluid.​Pipes.​StaticPipe
Basic pipe flow model without storage of mass or energy

Information

Model of a straight pipe with constant cross section and with steady-state mass, momentum and energy balances, i.e., the model does not store mass or energy. There exist two thermodynamic states, one at each fluid port. The momentum balance is formulated for the two states, taking into account momentum flows, friction and gravity. The same result can be obtained by using DynamicPipe with steady-state dynamic settings. The intended use is to provide simple connections of vessels or other devices with storage, as it is done in:

Numerical Issues

With the stream connectors the thermodynamic states on the ports are generally defined by models with storage or by sources placed upstream and downstream of the static pipe. Other non storage components in the flow path may yield to state transformation. Note that this generally leads to nonlinear equation systems if multiple static pipes, or other flow models without storage, are directly connected.

Extends from Modelica.​Fluid.​Pipes.​BaseClasses.​PartialStraightPipe (Base class for straight pipe models).

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)
AbsolutePressurep_a_startsystem.​p_startStart value of pressure at port a
AbsolutePressurep_b_startp_a_startStart value of pressure at port b
MassFlowRatem_flow_startsystem.​m_flow_startStart value for mass flow rate

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)

Model Modelica.​Fluid.​Pipes.​DynamicPipe
Dynamic pipe model with storage of mass and energy

Information

Model of a straight pipe with distributed mass, energy and momentum balances. It provides the complete balance equations for one-dimensional fluid flow as formulated in UsersGuide.ComponentDefinition.BalanceEquations.

This generic model offers a large number of combinations of possible parameter settings. In order to reduce model complexity, consider defining and/or using a tailored model for the application at hand, such as HeatExchanger.

DynamicPipe treats the partial differential equations with the finite volume method and a staggered grid scheme for momentum balances. The pipe is split into nNodes equally spaced segments along the flow path. The default value is nNodes=2. This results in two lumped mass and energy balances and one lumped momentum balance across the dynamic pipe.

Note that this generally leads to high-index DAEs for pressure states if dynamic pipes are directly connected to each other, or generally to models with storage exposing a thermodynamic state through the port. This may not be valid if the dynamic pipe is connected to a model with non-differentiable pressure, like a Sources.Boundary_pT with prescribed jumping pressure. The modelStructure can be configured as appropriate in such situations, in order to place a momentum balance between a pressure state of the pipe and a non-differentiable boundary condition.

The default modelStructure is av_vb (see Advanced tab). The simplest possible alternative symmetric configuration, avoiding potential high-index DAEs at the cost of the potential introduction of nonlinear equation systems, is obtained with the setting nNodes=1, modelStructure=a_v_b. Depending on the configured model structure, the first and the last pipe segment, or the flow path length of the first and the last momentum balance, are of half size. See the documentation of the base class Pipes.BaseClasses.PartialTwoPortFlow, also covering asymmetric configurations.

The HeatTransfer component specifies the source term Qb_flows of the energy balance. The default component uses a constant coefficient for the heat transfer between the bulk flow and the segment boundaries exposed through the heatPorts. The HeatTransfer model is replaceable and can be exchanged with any model extended from BaseClasses.HeatTransfer.PartialFlowHeatTransfer.

The intended use is for complex networks of pipes and other flow devices, like valves. See, e.g.,

Extends from Modelica.​Fluid.​Pipes.​BaseClasses.​PartialStraightPipe (Base class for straight pipe models) and Modelica.​Fluid.​Pipes.​BaseClasses.​PartialTwoPortFlow (Base class for distributed flow models).

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)
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
final Lengthlengths[n]fill(length / n, n)lengths of flow segments
final AreacrossAreas[n]fill(crossArea, n)cross flow areas of flow segments
final Lengthdimensions[n]fill(4 * crossArea / perimeter, n)hydraulic diameters of flow segments
final Roughnessroughnesses[n]fill(roughness, n)Average heights of surface asperities
final Lengthdheights[n]height_ab * dxsDifferences 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
Booleanuse_HeatTransferfalse= true to use the HeatTransfer model
final Realdxs[n]lengths / sum(lengths) 

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)
HeatPorts_aheatPorts[nNodes]