modelControlVolumeL4_HeatLoss
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
| Type | Name | Default | Description |
|---|---|---|---|
| Real | L | l/A | Momentum factor for a straight pipe |
| SI.Length | l | 10 | Length of the pipe |
| SI.Length | d | 0.3 | Inner diameter of the pipe |
| SI.Area | A | Modelica.Constants.pi*(d/2)^2 | Cross sectional area of the pipe |
| SI.Area | A_s | 2*Modelica.Constants.pi*(d/2)*l | |
| SI.Volume | V_pipe | l*A | Volume of the pipe |
| SI.Density | rho | 1000 | Density of the water |
| Real | delta_p_nom | 100 | Nominal pressure drop at a nominal mass flow rate |
| SI.MassFlowRate | m_flow_nom | 100 | Nominal mass flow rate |
| Real | k | 0.02 | Rouhgness factor for the surface |
| SI.SpecificHeatCapacity | cp | 4200 | Specific heat capacity of the water |
| Boolean | MassFlowState | true | |
| Integer | N_cv | 30 | |
| Real | u | 0.15 | heat loss factor in watt per meter kelvin |
| SI.MassFlowRate | m_flow_start | 1 | |
| SI.DynamicViscosity | eta | 4.66e-4 | |
| 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 | |
| SI.Volume | V_pipe_w | (V_pipe_wall*c_pipe)/cp |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| TransiEnt.Basics.Interfaces.Thermal.FluidPortIn_simple | inlet | ||
| TransiEnt.Basics.Interfaces.Thermal.FluidPortOut_simple | outlet | ||
| Modelica.Blocks.Interfaces.RealOutput | y | ||
| Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a[N_cv] | heatPort |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| SI.MassFlowRate | m_flow | ||
| SI.Temperature | T_in | ||
| SI.Velocity | v | ||
| SI.Temperature | T_out | ||
| SI.SpecificEnthalpy[N_cv] | h | ||
| SI.Temperature[N_cv] | T | ||
| Modelica.Fluid.Dissipation.PressureLoss.StraightPipe.dp_overall_IN_con | inCon | ||
| Modelica.Fluid.Dissipation.PressureLoss.StraightPipe.dp_overall_IN_var | inVar |