modelDHN_Pipe_L4
Information
Purpose of model
A simple model of a discretized pipe for district heating networks. The number of control volumes can be set with a parameter. It consists of two fluid ports and one heat port per control volume. It is based on the three balance equations of energy, mass and momentum. There is one dynamic energy balance per control volume. The heat capacity of the pipe wall is considered. The mass balance is static. The momentum balance is static, but mass flow states can be activated to improve the numerics of large-scale simulations. Further explanations can be found in Westphal et. al. Constant fluid properties are assumed for this control volume. Pressure losses due to friction are considered and calculated with a model of the fluid dissipation library (Darcy-Weisbach equation). Pressure changes due to gravity are not considered. Heat losses are considered with a heat loss per meter depending on the temperature difference. A temperature source is implemented in this model and connected to the heat ports of the control volume. The control volume is connected to two fluid ports.
The control volume is discretized with an upwind scheme. For the implementation of the occuring case distinction the semiLinear operator is used. A number between 100 and 1000 control volumes per kilo meter is suitable for a district heating network simulation. If a large number of states appear in the DHN simulations due to a large number of control volumes the sparse solver should be activated. In Dymola this can be for example done with the command: Advanced.Translation.SparseActivate=true. This will improve the simulation speed significantly. Also the appearance of implicit non-linear systems of equations should be avoided.
The physical effects described are implemented in the control volume model used in this component.
Level of detail, physical effects considered, and physical insight
L4 (defined in the CodingConventions)
- static mass balance
- constant fluid properties
- dynamic and discretized energy balances
- consideration of pressure losses due to friction but not pressure differences due to gravity
- consideration of heat losses
- reverse flow is supported
Interfaces
Governing Equations
Mass balance: m_in+m_out=0
Energy balance: (V_pipe+V_pipe_w)/N_cv*rho*der(u) =m_flow*(h_in-h_out) + Q_flow_loss (for N_cv control volumes)
Heat transport: Q_flow=-u*l/N_cv*(T[i]-heatPort[i].T) for N_cv control volumes
References
The model was used in several publications:
[1] Westphal, J.; Brunnemann, J.; Speerforck, A.; Enabling the dynamic simulation of an unaggregated, meshed district heating network with several thousand substations;Energy; 2025
[2]Vieth, J.; Westphal, J.; Speerforck, A.; District heating network topology optimization and optimal co-planning using dynamic simulations; Advances in Applied Energy; 2025
Version History
Model was created by Jan Westphal (j.westphal@tuhh.de) August 2025
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| SI.Length | d | 0.1 | Inner diameter of the pipe |
| SI.Density | rho | 983 | Density of the fluid |
| Real | k | 1e-3 | Surface factor of the pipe |
| SI.MassFlowRate | m_flow_nom | 15 | Nominal mass flow rate |
| Real | delta_p_nom | 150 | Nominal pressure drop over the pipe |
| SI.SpecificHeatCapacity | cp | 4183 | Specific heat capacity of water |
| SI.Length | l | 10 | Length of the pipe |
| Real | L | 100 | |
| Boolean | MassFlowState | false | |
| Integer | N_cv | 10 | |
| Real | u | 0.3 | |
| SI.MassFlowRate | m_flow_start | 1 | |
| SI.Density | rho_pipe | 960 | |
| SI.SpecificHeatCapacity | c_pipe | 1900 | |
| SI.Length | wall_thickness | 0.0026 | |
| SI.Volume | V_pipe_wall | Modelica.Constants.pi*(((d + 2*wall_thickness)/2)^2 - (d/2)^2)*l | |
| Boolean | useInput | false |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| TransiEnt.Basics.Interfaces.Thermal.FluidPortIn_simple | inlet | ||
| TransiEnt.Basics.Interfaces.Thermal.FluidPortOut_simple | outlet | ||
| Modelica.Blocks.Interfaces.RealInput | soilTemp |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| SI.HeatFlowRate | Q_flow_loss | ||
| SI.PressureDifference | delta_p_fric | ||
| Modelica.Thermal.HeatTransfer.Celsius.PrescribedTemperature[N_cv] | UndergroundTemperature | ||
| Modelica.Blocks.Sources.RealExpression | Temperature | ||
| TransiEnt.Components.Heat.VolumesValvesFittings.Pipes.ControlVolumeL4_HeatLoss | controlVolumeL4_HeatLoss |