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
| Type | Name | Default | Description |
|---|---|---|---|
| Boolean | homotopyInitialization | true | = true, use homotopy method |
| Integer | nSeg | 1 | Number of axial segment |
| Real | n | 2 | Flow exponent, n=1 for laminar, n=2 for turbulent |
| Real | ReC | 4000 | Reynolds number where transition to turbulence starts |
| Real | fac | 1 | Factor to take into account flow resistance of bends etc., fac=dp_nominal/dpStraightPipe_nominal |
| Modelica.Units.SI.Velocity | v_nominal | m_flow_nominal/(APip*rho_default) | Velocity at m_flow_nominal |
| Assumptions | |||
| Boolean | allowFlowReversal (from PartialTwoPort) | true | = false to simplify equations, assuming, but not enforcing, no flow reversal |
| Advanced | |||
| Boolean | from_dp | false | = true, use m_flow = f(dp) else dp = f(m_flow) |
| Boolean | have_pipCap | true | = true, a mixing volume is added to each segment that corresponds to the heat capacity of the pipe segment wall |
| Boolean | have_symmetry | true | = false, the mixing volume is only on port_b of each segment, which improve performances, but reduces dynamic accuracy |
| Modelica.Units.SI.MassFlowRate | m_flow_small | 1E-4*abs(m_flow_nominal) | Small mass flow rate for regularization of zero flow |
| Boolean | linearized | false | = true, use linear relation between m_flow and dp for any flow rate |
| Boolean | disableComputeFlowResistance | false | =false to disable computation of flow resistance |
| Material | |||
| Modelica.Units.SI.Length | dh | Hydraulic diameter | |
| Modelica.Units.SI.Height | roughness | 2.5e-5 | Average height of surface asperities (default: smooth steel pipe) |
| Modelica.Units.SI.Length | totLen | sum(segLen) | Total pipe length (used to compute segment length) |
| Modelica.Units.SI.Length[nSeg] | segLen | fill(totLen/nSeg, nSeg) | Pipe segment length |
| Modelica.Units.SI.Length | thickness | 0.0035 | Pipe wall thickness |
| Modelica.Units.SI.SpecificHeatCapacity | cPip | 2300 | Specific heat of pipe wall material. 2300 for PE, 500 for steel |
| Modelica.Units.SI.Density | rhoPip | 930 | Density of pipe wall material. 930 for PE, 8000 for steel |
| Nominal condition | |||
| Modelica.Units.SI.MassFlowRate | m_flow_nominal | Nominal mass flow rate | |
| Thermal resistance | |||
| Modelica.Units.SI.Length | dIns | Thickness of pipe insulation, used to compute R | |
| Modelica.Units.SI.ThermalConductivity | kIns | Heat conductivity of pipe insulation, used to compute R | |
| Initialization | |||
| Modelica.Units.SI.Temperature[nSeg] | T_start_in | fill(Medium.T_default, nSeg) | Initialization temperature at pipe inlet |
| Modelica.Units.SI.Temperature[nSeg] | T_start_out | T_start_in | Initialization temperature at pipe outlet |
| Boolean | initDelay | false | Initialize delay for a constant mass flow rate if true, otherwise start from 0 |
| Modelica.Units.SI.MassFlowRate | m_flow_start | 0 | Initial value of mass flow rate through pipe |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Fluid.Interfaces.FluidPort_a | port_a (from PartialTwoPort) | Fluid connector a (positive design flow direction is from port_a to port_b) | |
| Modelica.Fluid.Interfaces.FluidPort_b | port_b (from PartialTwoPort) | Fluid connector b (positive design flow direction is from port_a to port_b) | |
| Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a[nSeg] | heatPorts | Heat transfer to or from surrounding for each pipe segment (positive if pipe is colder than surrounding) |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Units.SI.HeatFlowRate | QEnv_flow | sum(heatPorts.Q_flow) | Heat transfer to or from surroundings of total pipe length (positive if pipe is colder than surrounding) |
| Modelica.Units.SI.PressureDifference | dp | res.dp | Pressure difference between port_a and port_b |
| Modelica.Units.SI.MassFlowRate | m_flow | port_a.m_flow | Mass flow rate from port_a to port_b (m_flow > 0 is design flow direction) |
| Modelica.Units.SI.Velocity | v | pipSeg[1].v | Flow velocity of medium in pipe |
| FixedResistances.HydraulicDiameter | res | Pressure drop calculation for this pipe |
Revisions
-
June 17, 2026, by Michael Wetter:
Updated implementation to allow a flow coefficientnthat is different from2. 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 todisableComputeFlowResistance.
See #2035. -
May 17, 2021, by Baptiste Ravache:
First implementation.