modelPlugFlowPipe
Extends from Buildings.Fluid.Interfaces.PartialTwoPortInterface (Partial model with two ports and declaration of quantities that are used by many models).
Information
Pipe with heat loss using the time delay based heat losses and transport of the fluid using a plug flow model, applicable for simulation of long pipes such as in district heating and cooling systems.
This model takes into account transport delay along the pipe length idealized as a plug flow. The model also includes thermal inertia of the pipe wall.
Implementation
The
spatialDistribution operator is used for the temperature wave propagation
through the length of the pipe. This operator is contained in
Buildings.Fluid.FixedResistances.BaseClasses.PlugFlow.
The model Buildings.Fluid.FixedResistances.BaseClasses.PlugFlowHeatLoss implements a heat loss in design direction, but leaves the enthalpy unchanged in opposite flow direction. Therefore it is used in front of and behind the time delay.
The pressure drop is implemented using Buildings.Fluid.FixedResistances.HydraulicDiameter. This instance is replaceable to allow Buildings.Fluid.FixedResistances.PlugFlowPipeDiscretized to compute the pressure drop only once rather than for each segment.
The thermal capacity of the pipe wall is implemented as a mixing volume
of the fluid in the pipe, of which the thermal capacity is equal to that
of the pipe wall material.
In addition, this mixing volume allows the hydraulic separation of subsequent pipes.
The mixing volume is either split between the inlet and outlet ports
(port_a and port_b) or lumped in at the outlet (port_b)
if have_symmetry is set to false.
This mixing volume can be removed from this model with the Boolean parameter
have_pipCap, in cases where the pipe wall heat capacity
is negligible and a state is not needed at the pipe outlet
(see the note below about numerical Jacobians).
Note that in order to model a branched network it is recommended to use
Buildings.Fluid.FixedResistances.Junction at each junction and to configure
that junction model with a state
(energyDynamics <> Modelica.Fluid.Types.Dynamics.SteadyState),
see for instance
Buildings.Fluid.FixedResistances.Validation.PlugFlowPipes.PlugFlowAIT.
This will avoid the numerical Jacobian that is otherwise created when
the inlet ports of two instances of the plug flow model are connected together.
Assumptions
- Heat losses are for steady-state operation.
- The axial heat diffusion in the fluid, the pipe wall and the ground are neglected.
- The boundary temperature is uniform.
-
The thermal inertia of the pipe wall material is lumped on the side of the pipe
that is connected to
port_b.
References
Full details on the model implementation and experimental validation can be found in:
van der Heijde, B., Fuchs, M., Ribas Tugores, C., Schweiger, G., Sartor, K.,
Basciotti, D., Müller, D., Nytsch-Geusen, C., Wetter, M. and Helsen, L.
(2017).
Dynamic equation-based thermo-hydraulic pipe model for district heating and
cooling systems.
Energy Conversion and Management, vol. 151, p. 158-169.
doi:
10.1016/j.enconman.2017.08.072.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Boolean | homotopyInitialization | true | = true, use homotopy method |
| 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 |
| Assumptions | |||
| Boolean | allowFlowReversal (from PartialTwoPort) | true | = false to simplify equations, assuming, but not enforcing, no flow reversal |
| Nominal condition | |||
| Modelica.Units.SI.MassFlowRate | m_flow_nominal (from PartialTwoPortInterface) | Nominal mass flow rate | |
| Modelica.Units.SI.Velocity | v_nominal | 1.5 | Velocity at m_flow_nominal (used to compute default value for hydraulic diameter dh) |
| Advanced | |||
| Modelica.Units.SI.MassFlowRate | m_flow_small (from PartialTwoPortInterface) | 1E-4*abs(m_flow_nominal) | Small mass flow rate for regularization of zero flow |
| Boolean | from_dp | false | = true, use m_flow = f(dp) else dp = f(m_flow) |
| Real | n | 2 | Flow exponent, n=1 for laminar, n=2 for turbulent |
| Boolean | have_pipCap | true | = true, a mixing volume is added that corresponds to the heat capacity of the pipe wall |
| Boolean | have_symmetry | true | = false, the mixing volume is only on port_b, which improve performances, but reduces dynamic accuracy. |
| Boolean | linearized | false | = true, use linear relation between m_flow and dp for any flow rate |
| Advanced › Diagnostics | |||
| Boolean | show_T (from PartialTwoPortInterface) | false | = true, if actual temperature at port is computed |
| Material | |||
| Modelica.Units.SI.Length | dh | sqrt(4*m_flow_nominal/rho_default/v_nominal/Modelica.Constants.pi) | Hydraulic diameter (assuming a round cross section area) |
| Modelica.Units.SI.Height | roughness | 2.5e-5 | Average height of surface asperities (default: smooth steel pipe) |
| Modelica.Units.SI.Length | length | Pipe length | |
| 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 |
| Modelica.Units.SI.Length | thickness | 0.0035 | Pipe wall thickness |
| 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 | |
| Real | R | 1/(kIns*2*Modelica.Constants.pi/Modelica.Math.log((dh/2 + thickness + dIns)/(dh/2 + thickness))) | Thermal resistance per unit length from fluid to boundary temperature |
| Initialization | |||
| Modelica.Units.SI.Temperature | T_start_in | Medium.T_default | Initialization temperature at pipe inlet |
| Modelica.Units.SI.Temperature | 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 | heatPort | Heat transfer to or from surroundings (positive if pipe is colder than surrounding) |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Units.SI.MassFlowRate | m_flow (from PartialTwoPortInterface) | port_a.m_flow | Mass flow rate from port_a to port_b (m_flow > 0 is design flow direction) |
| Modelica.Units.SI.PressureDifference | dp (from PartialTwoPortInterface) | port_a.p - port_b.p | Pressure difference between port_a and port_b |
| Medium.ThermodynamicState | sta_a (from PartialTwoPortInterface) | if allowFlowReversal then Medium.setState_phX(port_a.p, noEvent(actualStream(port_a.h_outflow)), noEvent(actualStream(port_a.Xi_outflow))) else Medium.setState_phX(port_a.p, noEvent(inStream(port_a.h_outflow)), noEvent(inStream(port_a.Xi_outflow))) | Medium properties in port_a |
| Medium.ThermodynamicState | sta_b (from PartialTwoPortInterface) | if allowFlowReversal then Medium.setState_phX(port_b.p, noEvent(actualStream(port_b.h_outflow)), noEvent(actualStream(port_b.Xi_outflow))) else Medium.setState_phX(port_b.p, noEvent(port_b.h_outflow), noEvent(port_b.Xi_outflow)) | Medium properties in port_b |
| Modelica.Units.SI.HeatFlowRate | QEnv_flow | heatPort.Q_flow | Heat transfer to or from surroundings (positive if pipe is colder than surrounding) |
| Modelica.Units.SI.Velocity | v | del.v | Flow velocity of medium in pipe |
| Buildings.Fluid.FixedResistances.HydraulicDiameter | res |
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:
Conditionally removed connect statements to conditional removed components.
This is for IBPSA, #2071. -
October 15, 2021, by Michael Wetter:
Moved model toBaseClasses. This allows Buildings.Fluid.FixedResistances.PlugFlowPipe to redeclare the resistance as final, thereby avoiding that a GUI presents this instance to users as a replaceable class. -
October 05, 2021, by Baptiste Ravache:
Made model symmetrical and extends from Buildings.Fluid.Interfaces.PartialTwoPortInterface. -
September 14, 2021, by Michael Wetter:
Made most instances protected and exposed main variables of interest. -
July 9, 2021, by Baptiste Ravache:
Replaced the vectorized outlet portports_bwith a single outlet portport_b.
Expanded the core pipe model that was previously a component. This is for IBPSA, #1494.
This change is not backward compatible.
The previous classes definitions were moved to Buildings.Obsolete.Fluid.FixedResistances.PlugFlowPipe. Buildings.Obsolete.Fluid.FixedResistances.BaseClasses.PlugFlowCore. -
April 14, 2020, by Michael Wetter:
ChangedhomotopyInitializationto a constant.
This is for IBPSA, #1341. -
March 6, 2020, by Jelger Jansen:
Revised calculation of thermal resistanceRby using correct radiuses. See #1310. -
October 23, 2017, by Michael Wetter:
Revised variable names and documentation to follow guidelines. Corrected malformed hyperlinks. -
July 4, 2016 by Bram van der Heijde:
IntroducepipVol. -
October 10, 2015 by Marcus Fuchs:
Copy Icon from KUL implementation and rename model. Replace resistance and temperature delay by an adiabatic pipe. - September, 2015 by Marcus Fuchs:
First implementation.