modelPlugFlowPipeDiscretized

Discretized pipe model using spatialDistribution for temperature delay

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

Information

Wrapper around Buildings.Fluid.FixedResistances.PlugFlowPipe which allows to specify nSeg successive segments of pipes (connected in series).

This wrapper simplifies use-cases where different segments of the same pipe might have different boundary conditions. This would be the case, for instance, for sufficiently long stretches of buried pipes.

To reduce coupled nonlinear equations, the pipe flow resistance is aggregated to a single instance of Buildings.Fluid.FixedResistances.HydraulicDiameter rather than being instantiated separately for each segment.

Parameters

TypeNameDefaultDescription
BooleanhomotopyInitializationtrue= true, use homotopy method
IntegernSeg1Number of axial segment
Realn2Flow exponent, n=1 for laminar, n=2 for turbulent
RealReC4000Reynolds number where transition to turbulence starts
Realfac1Factor to take into account flow resistance of bends etc., fac=dp_nominal/dpStraightPipe_nominal
Modelica.Units.SI.Velocityv_nominalm_flow_nominal/(APip*rho_default)Velocity at m_flow_nominal
Assumptions
BooleanallowFlowReversal (from PartialTwoPort)true= false to simplify equations, assuming, but not enforcing, no flow reversal
Advanced
Booleanfrom_dpfalse= true, use m_flow = f(dp) else dp = f(m_flow)
Booleanhave_pipCaptrue= true, a mixing volume is added to each segment that corresponds to the heat capacity of the pipe segment wall
Booleanhave_symmetrytrue= false, the mixing volume is only on port_b of each segment, which improve performances, but reduces dynamic accuracy
Modelica.Units.SI.MassFlowRatem_flow_small1E-4*abs(m_flow_nominal)Small mass flow rate for regularization of zero flow
Booleanlinearizedfalse= true, use linear relation between m_flow and dp for any flow rate
BooleandisableComputeFlowResistancefalse=false to disable computation of flow resistance
Material
Modelica.Units.SI.LengthdhHydraulic diameter
Modelica.Units.SI.Heightroughness2.5e-5Average height of surface asperities (default: smooth steel pipe)
Modelica.Units.SI.LengthtotLensum(segLen)Total pipe length (used to compute segment length)
Modelica.Units.SI.Length[nSeg]segLenfill(totLen/nSeg, nSeg)Pipe segment length
Modelica.Units.SI.Lengththickness0.0035Pipe wall thickness
Modelica.Units.SI.SpecificHeatCapacitycPip2300Specific heat of pipe wall material. 2300 for PE, 500 for steel
Modelica.Units.SI.DensityrhoPip930Density of pipe wall material. 930 for PE, 8000 for steel
Nominal condition
Modelica.Units.SI.MassFlowRatem_flow_nominalNominal mass flow rate
Thermal resistance
Modelica.Units.SI.LengthdInsThickness of pipe insulation, used to compute R
Modelica.Units.SI.ThermalConductivitykInsHeat conductivity of pipe insulation, used to compute R
Initialization
Modelica.Units.SI.Temperature[nSeg]T_start_infill(Medium.T_default, nSeg)Initialization temperature at pipe inlet
Modelica.Units.SI.Temperature[nSeg]T_start_outT_start_inInitialization temperature at pipe outlet
BooleaninitDelayfalseInitialize delay for a constant mass flow rate if true, otherwise start from 0
Modelica.Units.SI.MassFlowRatem_flow_start0Initial value of mass flow rate through pipe

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)
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a[nSeg]heatPortsHeat transfer to or from surrounding for each pipe segment (positive if pipe is colder than surrounding)

Components

TypeNameDefaultDescription
Modelica.Units.SI.HeatFlowRateQEnv_flowsum(heatPorts.Q_flow)Heat transfer to or from surroundings of total pipe length (positive if pipe is colder than surrounding)
Modelica.Units.SI.PressureDifferencedpres.dpPressure difference between port_a and port_b
Modelica.Units.SI.MassFlowRatem_flowport_a.m_flowMass flow rate from port_a to port_b (m_flow > 0 is design flow direction)
Modelica.Units.SI.VelocityvpipSeg[1].vFlow velocity of medium in pipe
FixedResistances.HydraulicDiameterresPressure drop calculation for this pipe

Revisions

  • June 17, 2026, by Michael Wetter:
    Updated implementation to allow a flow coefficient n that is different from 2. This allows use of the model for not fully turbulent flow.
    This is for Buildings, #4620.
  • January 5, 2026, by Michael Wetter:
    In Buildings.Fluid.FixedResistances.BaseClasses.PlugFlowPipe, conditionally removed connect statements to conditional removed components.
    This is for IBPSA, #2071.
  • July 29, 2025, by Fabian Wuelhorst:
    Add option to disableComputeFlowResistance.
    See #2035.
  • May 17, 2021, by Baptiste Ravache:
    First implementation.