WOLFRAM SYSTEMMODELER

DynamicPipe

Dynamic pipe model with storage of mass and energy

Diagram

Wolfram Language

In[1]:=
SystemModel["Modelica.Fluid.Pipes.DynamicPipe"]
Out[1]:=

Information

This information is part of the Modelica Standard Library maintained by the Modelica Association.

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 (40)

length

Value:

Type: Length (m)

Description: Length

isCircular

Value: true

Type: Boolean

Description: = true if cross sectional area is circular

diameter

Value:

Type: Diameter (m)

Description: Diameter of circular pipe

crossArea

Value: Modelica.Constants.pi * diameter * diameter / 4

Type: Area (m²)

Description: Inner cross section area

perimeter

Value: Modelica.Constants.pi * diameter

Type: Length (m)

Description: Inner perimeter

roughness

Value: 2.5e-5

Type: Roughness (m)

Description: Average height of surface asperities (default: smooth steel pipe)

V

Value: crossArea * length * nParallel

Type: Volume (m³)

Description: volume size

height_ab

Value: 0

Type: Length (m)

Description: Height(port_b) - Height(port_a)

allowFlowReversal

Value: system.allowFlowReversal

Type: Boolean

Description: = true to allow flow reversal, false restricts to design direction (port_a -> port_b)

n

Value: nNodes

Type: Integer

Description: Number of discrete volumes

energyDynamics

Value: system.energyDynamics

Type: Dynamics

Description: Formulation of energy balances

massDynamics

Value: system.massDynamics

Type: Dynamics

Description: Formulation of mass balances

substanceDynamics

Value: massDynamics

Type: Dynamics

Description: Formulation of substance balances

traceDynamics

Value: massDynamics

Type: Dynamics

Description: Formulation of trace substance balances

p_a_start

Value: system.p_start

Type: AbsolutePressure (Pa)

Description: Start value of pressure at port a

p_b_start

Value: p_a_start

Type: AbsolutePressure (Pa)

Description: Start value of pressure at port b

ps_start

Value: if n > 1 then linspace(p_a_start, p_b_start, n) else {(p_a_start + p_b_start) / 2}

Type: AbsolutePressure[n] (Pa)

Description: Start value of pressure

use_T_start

Value: true

Type: Boolean

Description: Use T_start if true, otherwise h_start

T_start

Value: if use_T_start then system.T_start else Medium.temperature_phX((p_a_start + p_b_start) / 2, h_start, X_start)

Type: Temperature (K)

Description: Start value of temperature

h_start

Value: if use_T_start then Medium.specificEnthalpy_pTX((p_a_start + p_b_start) / 2, T_start, X_start) else Medium.h_default

Type: SpecificEnthalpy (J/kg)

Description: Start value of specific enthalpy

X_start

Value: Medium.X_default

Type: MassFraction[Medium.nX] (kg/kg)

Description: Start value of mass fractions m_i/m

C_start

Value: Medium.C_default

Type: ExtraProperty[Medium.nC]

Description: Start value of trace substances

nParallel

Value: 1

Type: Real

Description: Number of identical parallel flow devices

lengths

Value: fill(length / n, n)

Type: Length[n] (m)

Description: lengths of flow segments

crossAreas

Value: fill(crossArea, n)

Type: Area[n] (m²)

Description: cross flow areas of flow segments

dimensions

Value: fill(4 * crossArea / perimeter, n)

Type: Length[n] (m)

Description: hydraulic diameters of flow segments

roughnesses

Value: fill(roughness, n)

Type: Roughness[n] (m)

Description: Average heights of surface asperities

dheights

Value: height_ab * dxs

Type: Length[n] (m)

Description: Differences in heights of flow segments

momentumDynamics

Value: system.momentumDynamics

Type: Dynamics

Description: Formulation of momentum balances

m_flow_start

Value: system.m_flow_start

Type: MassFlowRate (kg/s)

Description: Start value for mass flow rate

nNodes

Value: 2

Type: Integer

Description: Number of discrete flow volumes

modelStructure

Value: Types.ModelStructure.av_vb

Type: ModelStructure

Description: Determines whether flow or volume models are present at the ports

useLumpedPressure

Value: false

Type: Boolean

Description: =true to lump pressure states together

nFM

Value: if useLumpedPressure then nFMLumped else nFMDistributed

Type: Integer

Description: number of flow models in flowModel

nFMDistributed

Value: 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 - 1

Type: Integer

nFMLumped

Value: if modelStructure == Types.ModelStructure.a_v_b then 2 else 1

Type: Integer

iLumped

Value: integer(n / 2) + 1

Type: Integer

Description: Index of control volume with representative state if useLumpedPressure

useInnerPortProperties

Value: false

Type: Boolean

Description: =true to take port properties for flow models from internal control volumes

use_HeatTransfer

Value: false

Type: Boolean

Description: = true to use the HeatTransfer model

dxs

Value: lengths / sum(lengths)

Type: Real[n]

Inputs (1)

fluidVolumes

Default Value: array(crossAreas[i] * lengths[i] for i in 1:n) * nParallel

Type: Volume[n] (m³)

Description: Discretized volume, determine in inheriting class

Connectors (3)

port_a

Type: FluidPort_a

Description: Fluid connector a (positive design flow direction is from port_a to port_b)

port_b

Type: FluidPort_b

Description: Fluid connector b (positive design flow direction is from port_a to port_b)

heatPorts

Type: HeatPorts_a[nNodes]

Components (7)

system

Type: System

Description: System properties

mediums

Type: BaseProperties[n]

state_a

Type: ThermodynamicState

Description: state defined by volume outside port_a

state_b

Type: ThermodynamicState

Description: state defined by volume outside port_b

statesFM

Type: ThermodynamicState[nFM + 1]

Description: state vector for flowModel model

flowModel

Type: FlowModel

Description: Flow model

heatTransfer

Type: HeatTransfer

Description: Heat transfer model

Used in Examples (6)

HeatingSystem

Modelica.Fluid.Examples

Simple model of a heating system

BatchPlant_StandardWater

Modelica.Fluid.Examples.AST_BatchPlant

IncompressibleFluidNetwork

Modelica.Fluid.Examples

Multi-way connections of pipes and incompressible medium model

BranchingDynamicPipes

Modelica.Fluid.Examples

Multi-way connections of pipes with dynamic momentum balance, pressure wave and flow reversal

NonCircularPipes

Modelica.Fluid.Examples

Comparing a circular with a non-circular pipe

RoomCO2WithControls

Modelica.Fluid.Examples.TraceSubstances

Demonstrates a room volume with CO2 controls

Used in Components (1)

BasicHX

Modelica.Fluid.Examples.HeatExchanger.BaseClasses

Simple heat exchanger model