modelControlVolumeL4_HeatLoss

Discretized control volume of a district heating network pipe using simple fluid ports

Information

Purpose of model

A simple model of a discretized control volume. 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). Heat losses are considered with a heat loss per meter depending on the temperature difference.

The control volume is discretized with an upwind scheme. For the implementation of the occuring case distinction the semiLinear operator is used.

This control volume is used in pipe models for district heating networks. It considers the thermal inertia of the pipe as well as heat and pressure losses.

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
  • 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

TypeNameDefaultDescription
RealLl/AMomentum factor for a straight pipe
SI.Lengthl10Length of the pipe
SI.Lengthd0.3Inner diameter of the pipe
SI.AreaAModelica.Constants.pi*(d/2)^2Cross sectional area of the pipe
SI.AreaA_s2*Modelica.Constants.pi*(d/2)*l
SI.VolumeV_pipel*AVolume of the pipe
SI.Densityrho1000Density of the water
Realdelta_p_nom100Nominal pressure drop at a nominal mass flow rate
SI.MassFlowRatem_flow_nom100Nominal mass flow rate
Realk0.02Rouhgness factor for the surface
SI.SpecificHeatCapacitycp4200Specific heat capacity of the water
BooleanMassFlowStatetrue
IntegerN_cv30
Realu0.15heat loss factor in watt per meter kelvin
SI.MassFlowRatem_flow_start1
SI.DynamicViscosityeta4.66e-4
SI.Densityrho_pipe960
SI.SpecificHeatCapacityc_pipe1900
SI.Lengthwall_thickness0.0026
SI.VolumeV_pipe_wallModelica.Constants.pi*(((d + 2*wall_thickness)/2)^2 - (d/2)^2)*l
SI.VolumeV_pipe_w(V_pipe_wall*c_pipe)/cp

Connectors

TypeNameDefaultDescription
TransiEnt.Basics.Interfaces.Thermal.FluidPortIn_simpleinlet
TransiEnt.Basics.Interfaces.Thermal.FluidPortOut_simpleoutlet
Modelica.Blocks.Interfaces.RealOutputy
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a[N_cv]heatPort

Components

TypeNameDefaultDescription
SI.MassFlowRatem_flow
SI.TemperatureT_in
SI.Velocityv
SI.TemperatureT_out
SI.SpecificEnthalpy[N_cv]h
SI.Temperature[N_cv]T
Modelica.Fluid.Dissipation.PressureLoss.StraightPipe.dp_overall_IN_coninCon
Modelica.Fluid.Dissipation.PressureLoss.StraightPipe.dp_overall_IN_varinVar