modelDynamicPipe

Dynamic pipe model with storage of mass and energy

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

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.,

Parameters

TypeNameDefaultDescription
SI.VolumeV (from PartialStraightPipe)crossArea*length*nParallelVolume size
Integern (from PartialDistributedVolume)2Number of discrete volumes
Medium.AbsolutePressureps_start (from PartialDistributedVolume)if n > 1 then linspace(p_a_start, p_b_start, n) else {(p_a_start + p_b_start)/2}Start value of pressure
IntegernFM (from PartialTwoPortFlow)if useLumpedPressure then nFMLumped else nFMDistributedNumber of flow models in flowModel
IntegernFMDistributed (from PartialTwoPortFlow)if 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 - 1Number of distributed flow models
IntegernFMLumped (from PartialTwoPortFlow)if modelStructure == Types.ModelStructure.a_v_b then 2 else 1Number of lumped flow models
IntegeriLumped (from PartialTwoPortFlow)integer(n/2) + 1Index of control volume with representative state if useLumpedPressure
Realdxslengths/sum(lengths)Normalized lengths
Assumptions
BooleanallowFlowReversal (from PartialTwoPort)system.allowFlowReversal= true to allow flow reversal, false restricts to design direction (port_a -> port_b)
Geometry
RealnParallel (from PartialStraightPipe)1Number of identical parallel pipes
SI.Diameterdiameter (from PartialStraightPipe)Diameter of circular pipe
Modelica.Fluid.Types.Roughnessroughness (from PartialStraightPipe)2.5e-5Average height of surface asperities (default: smooth steel pipe)
SI.Lengthlengths (from PartialTwoPortFlow)Lengths of flow segments
SI.AreacrossAreas (from PartialTwoPortFlow)Cross flow areas of flow segments
SI.Lengthdimensions (from PartialTwoPortFlow)Hydraulic diameters of flow segments
Modelica.Fluid.Types.Roughnessroughnesses (from PartialTwoPortFlow)Average heights of surface asperities
General › Geometry
SI.Lengthlength (from PartialStraightPipe)Length
BooleanisCircular (from PartialStraightPipe)true= true, if cross sectional area is circular
SI.AreacrossArea (from PartialStraightPipe)Modelica.Constants.pi*diameter*diameter/4Inner cross section area
SI.Lengthperimeter (from PartialStraightPipe)Modelica.Constants.pi*diameterInner perimeter
Static head
SI.Lengthheight_ab (from PartialStraightPipe)0Height(port_b) - Height(port_a)
SI.Lengthdheights (from PartialTwoPortFlow)zeros(n)Differences in heights of flow segments
Assumptions › Dynamics
Types.DynamicsenergyDynamics (from PartialDistributedVolume)system.energyDynamicsFormulation of energy balances
Types.DynamicsmassDynamics (from PartialDistributedVolume)system.massDynamicsFormulation of mass balances
Types.DynamicssubstanceDynamics (from PartialDistributedVolume)massDynamicsFormulation of substance balances
Types.DynamicstraceDynamics (from PartialDistributedVolume)massDynamicsFormulation of trace substance balances
Types.DynamicsmomentumDynamics (from PartialTwoPortFlow)system.momentumDynamicsFormulation of momentum balances
Initialization
Medium.AbsolutePressurep_a_start (from PartialDistributedVolume)system.p_startStart value of pressure at port a
Medium.AbsolutePressurep_b_start (from PartialDistributedVolume)p_a_startStart value of pressure at port b
Booleanuse_T_start (from PartialDistributedVolume)trueUse T_start if true, otherwise h_start
Medium.TemperatureT_start (from PartialDistributedVolume)if use_T_start then system.T_start else Medium.temperature_phX((p_a_start + p_b_start)/2, h_start, X_start)Start value of temperature
Medium.SpecificEnthalpyh_start (from PartialDistributedVolume)if use_T_start then Medium.specificEnthalpy_pTX((p_a_start + p_b_start)/2, T_start, X_start) else Medium.h_defaultStart value of specific enthalpy
Medium.MassFraction[Medium.nX]X_start (from PartialDistributedVolume)Medium.X_defaultStart value of mass fractions m_i/m
Medium.ExtraProperty[Medium.nC]C_start (from PartialDistributedVolume)Medium.C_defaultStart value of trace substances
Medium.MassFlowRatem_flow_start (from PartialTwoPortFlow)system.m_flow_startStart value for mass flow rate
Advanced
IntegernNodes (from PartialTwoPortFlow)2Number of discrete flow volumes
Types.ModelStructuremodelStructure (from PartialTwoPortFlow)Types.ModelStructure.av_vbDetermines whether flow or volume models are present at the ports
BooleanuseLumpedPressure (from PartialTwoPortFlow)false= true to lump pressure states together
BooleanuseInnerPortProperties (from PartialTwoPortFlow)false= true to take port properties for flow models from internal control volumes
Assumptions › Heat transfer
Booleanuse_HeatTransferfalse= true to use the HeatTransfer model

Connectors

TypeNameDefaultDescription
Modelica.Fluid.Interfaces.FluidPort_aport_a (from PartialTwoPort)Fluid connector a (positive design flow direction is from port_a to port_b)
Modelica.Fluid.Interfaces.FluidPort_bport_b (from PartialTwoPort)Fluid connector b (positive design flow direction is from port_a to port_b)
Interfaces.HeatPorts_aheatPorts

Components

TypeNameDefaultDescription
Modelica.Fluid.Systemsystem (from PartialTwoPort)System wide properties
SI.VolumefluidVolumes (from PartialDistributedVolume)Discretized volume, determine in inheriting class
SI.EnergyUs (from PartialDistributedVolume)Internal energy of fluid
SI.Massms (from PartialDistributedVolume)Fluid mass
SI.MassmXis (from PartialDistributedVolume)Substance mass
SI.MassmCs (from PartialDistributedVolume)Trace substance mass
SI.MassmCs_scaled (from PartialDistributedVolume)Scaled trace substance mass
Medium.ExtraProperty[n,Medium.nC]Cs (from PartialDistributedVolume)Trace substance mixture content
Medium.BasePropertiesmediums (from PartialDistributedVolume)
Medium.MassFlowRatemb_flows (from PartialDistributedVolume)Mass flow rate, source or sink
Medium.MassFlowRatembXi_flows (from PartialDistributedVolume)Independent mass flow rates, source or sink
Medium.ExtraPropertyFlowRatembC_flows (from PartialDistributedVolume)Trace substance mass flow rates, source or sink
SI.EnthalpyFlowRateHb_flows (from PartialDistributedVolume)Enthalpy flow rate, source or sink
SI.HeatFlowRateQb_flows (from PartialDistributedVolume)Heat flow rate, source or sink
SI.PowerWb_flows (from PartialDistributedVolume)Mechanical power, p*der(V) etc.
Medium.ThermodynamicStatestate_a (from PartialTwoPortFlow)State defined by volume outside port_a
Medium.ThermodynamicStatestate_b (from PartialTwoPortFlow)State defined by volume outside port_b
Medium.ThermodynamicStatestatesFM (from PartialTwoPortFlow)State vector for flowModel model
FlowModelflowModel (from PartialTwoPortFlow)Flow model
Medium.MassFlowRatem_flows (from PartialTwoPortFlow)Mass flow rates of fluid across segment boundaries
Medium.MassFlowRatemXi_flows (from PartialTwoPortFlow)Independent mass flow rates across segment boundaries
Medium.MassFlowRatemC_flows (from PartialTwoPortFlow)Trace substance mass flow rates across segment boundaries
Medium.EnthalpyFlowRateH_flows (from PartialTwoPortFlow)Enthalpy flow rates of fluid across segment boundaries
SI.Velocityvs (from PartialTwoPortFlow){0.5*(m_flows[i] + m_flows[i + 1])/mediums[i].d/crossAreas[i] for i in 1:n}/nParallelMean velocities in flow segments
HeatTransferheatTransferHeat transfer model

Contents

NameDescription
HeatTransfer