Heat Consumer Model for Robust and Fast Simulations of District Heating Networks

Dynamic thermo-hydraulic simulations of district heating networks are an essential tool to investigate concepts for their sustainable design and operation. The way the numerous heat consumers are modeled has crucial impact on the simulation performance. The proposed model for heat consumers is designed to require low computational effort by using a simplified modeling approach, avoiding state events and limiting its dynamics, while still reproducing their main characteristics. It is tested for a demonstration network, showing its ability to yield plausible results throughout the whole range of operational states including undersupply situations. The results show that the heat consumer model itself requires little time to simulate but significantly influences the simulation time for the district heating network. Fast dynamics and including a bypass in the model increase the simulation time, so that users should sensibly choose how to use these options. Furthermore, heat consumer models triggering many state events result in the highest computational effort.


Introduction
In light of the man-made climate crisis, a fast decarbonization of heating has to be achieved.Within this transition of the heat sector, district heating is a recommended solution, especially for densely populated areas, as it facilitates a combination of various renewable heat sources, excess heat usage and heat accumulators (even seasonal) and coupling to the electricity sector to reach a economically viable sustainable heat supply system, so called 4 th generation district heating (Lund et al. 2014).
Models for dynamic thermo-hydraulic simulations of the district heating networks (DHN) are an essential tool within the transformation towards 4 th generation DH.Their purpose is to investigate how decentralized or fluctuating renewable heat supply units and heat accumulators may be integrated into DHNs (understand dynamic effects, develop control strategies), how and to what extent the DHN itself acts as a heat storage and which sideeffects, such as pipe fatigue through temperature cycles or hydraulic bottlenecks, new units and operating strategies entail.
A major challenge in the simulation of DHNs is to find a compromise between model accuracy and computational effort.Within a DHN the heat consumers (HC) are very numerous so that the effort for simulating them is crucial for the overall simulation time.Moreover, the HCs have a major impact on dynamics of mass flows and temperatures within the network and thus determine the effort to compute the fluid and temperature propagation in the pipes.Within this contribution a HC model for simulations of DHNs is described and evaluated.The goal of the proposed HC model is to provide plausible behavior throughout the whole range of possible operation states (including undesirable situations, such as too low supply line temperatures or differential pressures) while keeping the computational effort for simulations as low as possible.

Simulation of DHN Using Modelica
Modelica, being an acausal multi-physics modeling language, is generally well suited for dynamic simulations of DHNs with their thermal and hydraulic effects and the option of flow-reversals.

Models for DHN and HC
The Modelica Standard Library (Modelica Association 2019) provides a large number of base models (such as the fluid-connector) and component models for thermofluid systems.Moreover, van der Heijde et al. (2017) developed and validated a dynamic plug-flow pipe model, that is freely available via the Modelica IBPSA Library (International Building Performance Simulation Association 2018) and which is used within other libraries with models specialized for the simulation of DHN.

AixLib
AixLib is an open-source Modelica library for the simulation of energy systems on building to district scale developed at RWTH Aachen University (Müller et al. 2016;Maier et al. 2022;RWTH-EBC 2021).It extends the Modelica IBPSA Library and has a section DistrictHeat-ingCooling with models specialized for the simulation of DHN.
Within this section, the library provides so called "open-loop" models for HCs, which are similar to the HC model presented in this contribution.The open-loop design means, that the models do not contain a fluid model that connects flow and return line, which allows to decouple the respective equation systems for fluid flow and pres-sures in the DHN.Stock et al. (2023) state that open-loop models reduce the computational effort and yield valid results when the research focus is on heat distribution and not on control of the HCs or heat sources.They successfully evaluate the hydraulic effects of the integration of a waste heat source into an existing DHN at different temperature levels.
The HC models determine the required mass flow based on a heat load input and the temperatures.The return line temperature is either a constant value or set to achieve a constant temperature difference to the supply line.A bypass that maintains a minimum mass flow may be included.It is active whenever the HC mass flow would drop below a threshold (irrespective temperatures and pressures), sets the heat flow to zero and triggers state events, whenever activated or deactivated.

DisHeatLib
Leitner et al. ( 2019) describe a method to assess the operation of coupled heat and power networks and published their Modelica models within the library DisHeatLib (AIT-IES 2022), which builds upon the Modelica IBPSA Library and contains a variety of models for DHN Simulations.
To model HCs, the library provides models for demand (intended as a simple representation of a heat load) and substation (modeling heat transfer from the network to the HC).The substation models provide a variety of technical configurations (with or w/o heat exchanger, optional storages, optional bypass), so that these technical options and their behavior within a DHN can be examined.However all HC models in DisHeatLib include control loops, fluid models that connect supply to return line and some have a high degree of detail as the various components are explicitly modeled, which results in high computational effort to simulate a DHN with numerous HCs.

DHNSim
At the Department of Solar and Thermal Engineering of the University of Kassel, Modelica models for long-term simulation of whole DHNs have been developed within the in-house library DHNSim.The pipe model in DHNSim builds upon the plug-flow pipe model by van der Heijde et al. (2017).Furthermore, the library contains models for supply units, the HCs (described in this contribution, see section 3) and the required environment to easily build a consistent DHN model.Zipplies, Orozaliev, and Vajen (2023, in press) give an overview on the structure, goals and general implementation of the models.

Strategies for Fast Simulations of DHN
Figure 1 illustrates a general consideration of the drivers for computational effort of DHN simulations.On the one hand, the pipe network model results in a large system of equations that has to be solved for each simulation step and numerous states to integrate.Thus, it determines the effort to calculate one simulation step.On the other hand, the models of the supply unit and HCs will not cause much computational effort themselves, if they are simple.However, as they determine the mass flows, temperatures and pressures in the network (and their derivatives), they will have a crucial impact on the number of steps that a variable step size solver will have to calculate.Given this consideration, the following subsections describe general strategies for fast simulations of DHN that apply to the proposed HC model, which is described in detail in section 3.

Simplified Modeling Approach of HCs
The simulation of a large branched or even meshed pipe network is a complex task that requires high computational effort.Therefore it is recommendable, or even absolutely necessary, to limit the degree of detail of the models of the supply unit and the HCs in the DHN to a minimum extent that still leads to valid results.This applies especially to the HCs, as they are numerous and determine the mass flows and return temperatures for the pipe network.Thus, the proposed HC model does not contain detailed physical models for the actual components of substation and secondary side (pipes, valves, heat exchangers, pumps, heat storage, radiators, floor heating etc).This simplified modeling approach allows to follow the openloop design implemented in AixLib (see section 2.1.1).
The HC model simply uses a prescribed heat flow (or optionally mass flow) as input and uses the actual temperature in the supply line and a prescribed return line temperature (constant value or as additional variable input) to calculate the mass flow.While this seems to be a very simple modeling task at first glance, some more details and features are needed to obtain fast, stable and valid simulations with such a HC model.These are described in section 3 and include major improvements compared to the open-loop models in AixLib.

Avoiding Events
Simulation models may include equations or algorithms that abruptly change the model behavior.Examples are flow reversals (mass flow changes sign) or switching units on and off (boolean variable changes value).Within Modelica these moments are called "events" and whenever the integration algorithm detects such an event, the integrator tries to determine the exact point of time, when this abrupt change occurs, and restarts the simulation with the changed model behavior from this point, so that the transition from one state to the other is simulated correctly.
While this approach avoids inaccurate results or even failures of the simulation that might occur otherwise, it also adds computational effort to the simulation.Thus, models should generate events only if necessary and high numbers of events should be avoided in the use case of long-term simulations of large DHNs.
If a variable is continuous at an event, it is possible to prevent the event using the Modelica builtin function smooth() (Fritzson 2015).Furthermore Heat consumers Supply unit & pressure control • Large system of equations • Numerous states Determine: ሶ ,  RL (and their 1 st and 2 nd derivatives) Determines:  SL ,  SL ,  RL (and their 1 st and 2 nd derivatives) Pipe Network Effort to calculate one simulation step

Number of steps to calculate
Figure 1.Drivers for computational effort of DHN simulations: While the model of the pipe network dominates the effort to calculate one step, models of the supply unit and even more of the HCs determine the number of steps, that the simulation requires.
the Modelica Standard Library provides the function Modelica.Fluid.Utilities.regStep() to approximate a step by a smooth transition, that is once continuously differentiable and prevents events (Modelica Association 2019).Both functions are very useful to avoid events in the HC model and are used in the implementation wherever applicable.

Limiting Dynamics of the Models
When modeling DHNs, it is useful to define which time scale of dynamic effects is within scope and which not.
Then, the dynamics of the models can be restricted to this time scale, so that the effects out of scope are not modeled and simulated to avoid computational effort.In fact, preventing the HC model from imposing instant changes of mass flows is not a limitation of the model, but a realistic feature, because the actuators need some time to react to changing set-points (e.g.valve opening/closing time, usually seconds to a few minutes).

Description of the Proposed Heat Consumer Model
The implementation of the proposed HC model follows the previous considerations to keep computational effort for the simulation of the DHN low.

Determining Load Mass Flow
The determination of the load mass flow .m load within the load control block deserves special attention.It is calculated from the prescribed heat flow .Q load , the heat capacity of water c p and the temperatures in supply T SL and return line T RL according to equation 1. .
However, a robust implementation of this simple equation according to the previously described goals and strategies requires some more details. First, .
m load is limited to a meaningful range between 0 and a maximum mass flow m_flow_max.
Second, there may be situations, when the supply line temperature is close to or even below the set-point return line temperature, causing equation 1 to yield infinite or negative values.In such cases, it can be assumed that the set point temperature for the supply line of the secondary side of the substation is not reached, causing the controller and regulator of the substation to increase the primary mass flow as much as possible.Furthermore, it is assumed that in these situations the amount of heat extracted from the mass flow is negligibly small.The increase in primary mass flow is modeled as a smooth transition between normal and undersupply operation with a regStep() formula, increasing the mass flow from .m load (calculated according to equation 1) to m_flow_max.The prescribed return line temperature changes to the actual supply line temperature when the difference between flow and return line temperature crosses zero using a smooth() operator to avoid events.
Third, the HC model is intended to be used within a DHN model with a differential pressure control that assures a minimum differential pressure.In cases where the heat supply unit is not able to provide sufficient differential pressure at HCs (below 90 % of the rated minimum differential pressure), the model reduces m_flow_max with another regStep() formula, finally reaching 0 when the differential pressure is 0 or below.This simple and computationally light implementation allows to detect such pressure undersupply situations and provides insight into which units would be affected to what extent.However, it is not a physically exact representation of the mass flow and pressure loss conditions in such a situation.This feature might add an algebraic loop to the model, as it introduces an interdependence of differential pressure and mass flows at the HCs.The resulting nonlinear equation system would be solved during each time step at high computational effort.This is avoided by the next feature.
Fourth, in line with section 2.2.3, the mass flow variable has a time constant tau_m_flow.This is implemented by introducing two mass flow variables: m_flow_fast is calculated according to equation 1, while the mass flow to be set in the model m_flow_set is delayed by using the time constant tau_m_flow, as shown in listing 1 (implementation adapted from Lawrence Berkeley National Laboratory (2023, Section 3.3.4)).This feature introduces state variables into the mass flow calculation, so that the algebraic loop mentioned in the previous paragraph is avoided.
Listing 1. Implementation of the mass flow time constant der(m_flow_set) = (m_flow_fast-m_flow_set) / tau_m_flow; Finally, as an optional feature, the consumer model is able to include a hysteresis: Whenever the prescribed heat flow falls below the switch-off threshold, .m load is set to zero until the value rises again above the switch-on threshold.This feature may reduce computational effort if the time series of the prescribed load value includes longer periods of negligibly low values: Instead of simulating them in detail, they are omitted.However, this feature will trigger events whenever the thresholds are crossed at the cost of additional computational effort so that the simulation time may even increase.

Determining Bypass Mass Flow
The bypass is intended to maintain a certain minimum temperature in the supply line before the HC.To that end, the bypass control sets the bypass mass flow depending on this temperature: When it is high enough, the mass flow is 0. Once the temperature approaches the set-point temperature, that the bypass shall maintain, the mass flow is gradually increased within a bandwidth around the setpoint temperature until it finally remains at a maximum mass flow, if the supply line temperature is at or below the lower end of the bandwidth.Once again, this behavior is implemented using regStep(), as this yields a smooth characteristic and does not trigger events.
In addition, alike in load control, the maximum bypass mass flow is reduced in cases of pressure undersupply.
The return temperature of the bypass mass flow is simply set to the actual supply line temperature, as it is assumed that no heat is extracted from this mass flow.

Evaluation of the Heat Consumer Model
To evaluate the HC model concerning the results and its effects on simulation performance, a demonstration network is modeled and simulated in Dymola using the models of the in-house library DHNSim.The simulations are run with the same network and heat load data for different HC model configurations to investigate their effects on simulation results and performance.Additionally, simulations are also performed with the two open-loop demand models from AixLib.Fluid.DistrictHeatingCooling (VarTSupplyDp and VarTSupplyDpBypass, constant return temperature) and the most simple configuration of DisHeatLib.Demand.Demand (constant return temperature, linearized flow characteristic in the flow unit).For the last, it was a difficult task to obtain stable operation of the HCs due to oscillations in the internal control loops.
Table 1 gives an overview on the simulation runs and their specifications.

Demonstration Network
The basic demonstration network is a fictional, simple DHN with one supply unit and 6 HCs.The pipe network consists of 17 pairs of pipes (supply and return line), including house lead-in pipes, and contains one loop to introduce a certain degree of complexity (the loop results in a non-linear system of equations for the mass flows and pressures).The pipe closing the loop (DN 50) has been split into two parts to obtain a temperature value in the middle of the pipe for analysis.To analyze the effect of different network sizes, this basic layout ("small") was repeated 3 times ("medium") and 9 times ("large"), branching off after the first network pipe.The layout and the main parameters are depicted in Figure 3.
The HCs are simulated with 6 real, measured heat load profiles from an existing DHN with a resolution of 15 min.For the "medium" and "large" simulation, the profiles were reused with random variations (normal distribution, standard deviation 10 %), so that the peaks and valleys do not perfectly coincide.The heat load profiles consist of exemplary periods for high load, medium load, low load (each three days) and an undersupply situation (two days, with temporary drop of supply line temperature to 50 °C).The supply line temperature at the supply unit is set via a temperature curve between 70 -80 °C, apart from the undersupply situation, where the actual measured supply temperatures are used.During the simulation, these values are interpolated using smooth splines with Modelica.Blocks.Sources.CombiTimeTable.
The heat load profiles, being real measurement data, show higher dynamics (frequent peaks and valleys) than common synthetic heat load profiles.This is most pronounced during medium and low load period at HC 5 and HC 6, which show frequent switching between zero and substantial load values.Furthermore, most of the load profiles include periods with zero load for some hours.Thus, these heat load profiles are challenging, but yet realistic, examples of heat load profiles that may be used in the simulation of DHNs.

Evaluation of Simulation Results and Performance
To check if the demonstration network is configured realistically, some general indicators are estimated from the results of the main simulation run (low load = winter, medium load = spring and autumn, high load = summer).
For the basic small demonstration network and the main simulation run, the estimation yields a total annual heat demand of 3.2 GWh/a, relative heat losses of 12 % and a relative hydraulic energy for the circulation of 0.22 %.
Given the route length of 2.2 km, the linear heat density is 1.3 MWh/(m a).The mass flow weighted mean temperatures at the supply unit are 72 °C in the supply line and 48 °C in the return line.These values are considered plausible for a medium sized DHN with network temperatures as low as possible while still supplying old buildings and preparation of domestic hot water.

Comparison of General Simulation Results
In general, the simulation results of the different HC models should be similar.In the following, the results are compared to the main simulation run and major differences are reported and explained.The total heat from the supply unit does not differ more than 3 % compared to the main result for all models and periods, which indicates a good agreement of the models.
During the low load period, it makes a major difference whether the HC model includes a bypass.Compared to main, models without bypass (noBypass, AixLib and DisHeatLib) result in about 9 % less heat losses, because the network is not kept hot and lower return temperatures occur.Furthermore, they yield a 20 to 30 % higher maximum heat flow due to mass flow peaks after the supply line temperature had cooled down.In addition, the maximum pressure difference at the supply unit is 13 to 19 % lower, due to less mass flow in the network.Accordingly, the total hydraulic energy at supply unit is about 30 % less than with bypasses in this period.
Furthermore during the low load period AixLibBypass has 7 % less heat losses than main, as the constant bypass flows are not sufficient to keep the network hot (but also should not be tuned to the necessary value, because too much load would be omitted then).
In the undersupply period, the AixLib models have 13 % lower maximum pressure differences, as they assume a constant minimum temperature difference (set to 5 K in this case), while DHNSim models set mass flows to a maximum allowed value.Furthermore, the hydraulic energy is 20 to 30 % less without bypasses (noBypass, DisHeatLib) and 60 % less for the AixLib models, due to lower mass flows in both cases.
Another difference is that the maximum differential pressure at the supply unit is 16 % higher for the AixLib models during the high load period, due to a single, probably faulty, data point in the heat load profile of HC 4 (critical path), with a prescribed heat flow of 35 kW (al-though rated to 17.5 kW).The DHNSim models limit the mass flow to twice the nominal mass flow (parameter may be changed to other values) which limits the heat load in this case to 25 kW.

Effect of Mass Flow Time Constant
The comparison of the heat and mass flows at HC 6 for the simulation runs main and fastDynamics in Figure 4 demonstrates, how a heat load peak is delayed and has a reduced peak value compared to the input signal due to the added dynamics.The smaller the value of tau_m_flow, the more immediate is the reaction of the HC model to the input signal.Depending on the goals and available input data, the user of the model shall choose a sensible value for tau_m_flow.For input time series at a resolution of 15 min to 1 h a value of 180 s has proven to be suitable in previous simulation studies.
Figure 4 also shows, that tau_m_flow has an impact on bypass operation.After 130 h, the heat flow signal, and subsequently the mass flow, drops to zero.However, after a short zero flow period, the supply line temperature (not shown for clarity), drops below the set point of the bypass, causing it to increase the mass flow.The bypass in fastDynamics reacts earlier, so that the cooled house lead-in pipe gets flushed within less time than in main.The slower dynamics in main finally cause a slightly higher peak mass flow, while in fastDynamics the slopes of the mass flow are steeper.However both configurations maintain the required supply line temperature at the HC.

Bypass Behavior
Bypasses are intended to maintain a small mass flow through HCs during zero load periods so that the supply line temperature does not drop too much.Figure 5 shows the results for temperatures and mass flows at HC 6 during a period without heat load for main, noBypass and AixLibBypass.In main, the bypass starts to operate once the supply line temperature approaches 65 °C.The mass flow shows an decreasing oscillation, that is caused by the interplay of the thermostatic control approach and the delay due to the dwell time of the water in the house lead-in pipe.As long as the bypass operates and the heat load is zero, the return line temperature equals the supply line temperature.The bypass successfully maintains the required temperature of about 65 °C.Once the heat load rises (at 133.5 h), the return temperature smoothly drops.
In contrast, in noBypass the mass flow is zero during the period without heat load and the supply line temperature continuously drops.As a consequence, a mass flow peak occurs afterwards until the supply line temperature rises, causing steep slopes of mass flow and temperature.Nevertheless, the implementation of the HC is robust also without bypass, due to the limited dynamics and maximum value of mass flow and its reduction, if the differential pressure is too low.This prevents the HC model from imposing too high mass flows after zero flow periods, that might cause a simulation failure.AixLibBypass maintains a constant minimum mass flow.If tuned properly, this approach succeeds to maintain a sufficient supply line temperature.However, the bypass is active irrespective the supply line temperature, whenever the load mass flow reaches the set point, as can be seen at 134.5 h.The implementation of the return line temperature is not robust (switches at an undetermined time instant, here 131.7 h) and causes abrupt changes.
For the demonstration network, the noBypass implementation requires substantially less time to compute (see section 4.2.6), which indicates that the reduced effort (no state for and calculation of bypass mass flow) outweighs the computational effort to simulate the higher dynamics after zero flow periods.In the end, it is up to the user, if a bypass shall be included, depending on whether it is intended and realistic to have them.
In general, the proposed bypasses work as intended: In the main simulation run, only HC 6 has supply line temperatures below 64 °C in the three days low load period, in total during 1 h, affecting a heat consumption of 9 kWh.In contrast, without a bypass, at all HCs supply line temperatures below 64 °C occur, with the strongest effect at HC 6 during the low load period for 30 h and 300 kWh.
The bypass implementation of AixLib does not reduce the duration of temperature undersupply significantly for two reasons.First, bypass operation does not depend on temperature but on heat load, so that in some periods the bypass would not act, although the supply line temperature is low.Second, and more important, it was not possible to tune the bypasses of critical consumers to a value that always maintains the supply line temperature, because it was chosen to limit the maximum allowed bypass mass flow to 10 % of nominal mass flow, as too much heat load was omitted otherwise.

Load Hysteresis
The hysteresis feature explained in section 3.2 affects the behavior of the HC model when the prescribed load value is close to zero. Figure 6 shows an example for HC 3, comparing the results for heat and mass flows from main and hysteresis.In the period, two very low heat load peaks occur.The first (210.5 -212 h) reaches values above the hysteresis thresholds.While the main result shows a smooth rise of heat flow following the set-point, hysteresis has a zero heat flow until the threshold is reached (right before 211 h), followed by a steep rise of heat flow until the required values is reached.At the falling slope, the heat flow suddenly falls to zero, once the switch-off threshold of the hysteresis is crossed (at 211.7 h).The second heat load peak (212 -213 h) never crosses the switch-on threshold, so that it is completely ignored in hysteresis.The mass flows are very similar, as they are dominated by the bypass mass flow that is similar for both results.This example shows, that the hysteresis approach may avoid the calculation of negligible heat flows.However, it imposes additional computational effort due to the events that are triggered whenever thresholds are crossed and the steep slopes that occur right after every switching.

Undersupply
The proposed HC model is designed to provide plausible results during undersupply situations (supply temperature and/or differential pressure too low).Figure 7 shows the simulation results in such a period for main, noBypass and AixLib at HC 4, which is at the end of the critical path.The supply line temperature (upper graph) falls steadily and approaches the return line temperature, and as a consequence, the proposed HC model increases the mass flow (lower graph) to reach the needed heat flow.
In main the first phase of undersupply starts at about 281 h when the mass flow reaches its maximum (first vertical dotted line).From this point onward, the set point heat flow is not covered.
The second phase, starting after 282 h is marked by insufficient differential pressure: Due to the enormous increase of mass flows in the network, pressure losses in the pipes rise, causing high differential pressures to be provided by the heat supply unit.At a certain point, the upper limit of differential pressure is reached so that the required minimum differential pressure at the HC (here 0.6 bar) is no longer maintained.As a consequence, the load model reduces the mass flow.
Finally, after 284 h (third dotted line) the supply line temperature even drops below the set-point return temperature, so that the heat flow is zero and the return line temperature equals the supply line temperature.
Once the supply line temperature rises substantially at 287 h, the required differential pressure is restored and the HC returns to normal operation.
DisHeatLib behaves similar to main, as the flow unit in the model limits the mass flow to a maximum value according to the available pressure difference.The parameterization is derived from nominal values and results in rather low maximum mass flows and more undersupply than main.
The AixLib model however deals differently with the situation: The model assumes a minimum temperature difference between flow and supply line (here 5 K), that is used whenever the supply line temperature is low.This implementation leads to smaller mass flows compared to the proposed HC model and lets the model follow the set point heat flow, so that no undersupply occurs.However, the return temperature drops to 45 °C, and might even drop further, which would be unrealistic if the secondary return temperature of the actual HC would be higher than that.

Simulation Performance
For a profound analysis of the influence of the different implementations of HC models and network sizes on simulation performance, the CPU-time for integration is evaluated (mean of 3 runs, integration algorithm Dassl, tolerance 1 × 10 −4 , on a machine with CPU Intel i5-4300U @ 4x1.9 GHz, RAM 8 GB). Figure 8 shows the CPU-time relative to the main model.OnePipe requires only a small fraction of CPU-time compared to main, which proves, that the HC model itself does not require much computational effort.However, the implementation of the HC model causes major variations of CPU-time for the same network, with an increasing importance for larger models (more than factor 3 for the large model).The models with open loop design and without bypass (noBypass and AixLib) have the lowest and very similar CPU-times.The proposed model main is the fastest with a bypass.FastDynamics lead to a minor increase in CPU-time.DisHeatLib requires 30 % and AixLibBypass 50 % more computational effort.The hysteresis implementation causes the longest CPU-times.
The absolute values (indicated in Figure 8 as well) show that CPU-time scales non-linear with model size, reaching about 900 s (main) for the large demonstration network.Assuming a linear dependence on simulated time, an annual simulation would take about 8 hours, which is acceptable but substantial, which stresses the importance of a careful design of the HC models.
The results also reveal, that both, the number of result points and the number of events have a direct, and almost linear impact on CPU-time: A simple linear fit of CPUtime as a function of these two quantities yields a high coefficient of determination of 0.72. Figure 9 shows both, measured and fitted CPU-times for the large model.The AixLib implementation and the proposed HC model without bypass noBypass yield the fastest simulation with a low number of state events, followed by main (with bypasses).Increasing the dynamics of the proposed model (fastDynamics) increases the number of steps to be calculated and subsequently the CPU-time.AixLibBypass has a high CPU-time due to more events and an increase of time steps, while the hysteresis triggers by far most events and has thus highest CPU-times.Therefore, hysteresis should be used with care, as it may substantially increase the simulation time.DisHeatLib sticks out with almost 50 % higher CPU-time measured than according to the fit, because it is the only HC model that does not follow the open loop design which leads to more complex systems of equations to be solved.

Conclusion
The implementation of the HC model has crucial impact on the computational effort in DHN simulations.The proposed HC model yields plausible results for the whole range of load situations, including undersupply, and requires 50 % less CPU-time than the equivalent HC model from AixLib and 30 % less CPU-time than the most simple demand model from DisHeatLib (without bypass).Users of the model may choose whether their use case requires to use the thermostatic bypass that maintains the supply line temperature and if fast dynamics of the HC model are needed, as both options increase CPU-time.Load hysteresis is not recommendable for the used load profiles, as it triggers many state events, which causes a substantial increase of simulation time.
The main weakness of the proposed HC model is the assumption of a constant return temperature or temperature difference.Future work will focus on an implementation that is more realistic and reflects different operation states.

Figure 2 Figure 2 .
Figure2gives an overview on the design of the proposed HC model.The open-loop design (more detail in section 2.2.1) is obvious as there is no fluid model connecting the supply line with the return line.The model is split into a bypass and a load part, which both are modeled via a control block that calculates set-points for mass flow (and return temperature in the latter case) and two mass flow sources that generate the prescribed in-and outflows.The calculation of the mass flows is based on the input load

Figure 3 .
Figure3.Layout of the demonstration network with the main parameters: Nominal heat load and constant return line temperature of HCs (HC 1 to HC 6), supply line temperature at the supply unit and nominal diameter and length for the pipe segments.Simulations were run for different network sizes where the network part in brackets exists 1, 3 or 9 times after the first pipe.

Figure 4 .Figure 5 .
Figure 4. Example of the effect of the mass flow time constant at HC 6.

Figure 6 .
Figure6.Demonstration of the effect of hysteresis at very small heat load peaks.

Figure 7 .
Figure 7. Demonstration of how the consumer models deal with the undersupply situation.

Figure 8 .
Figure 8.Comparison of CPU-time of the different HC models at different network sizes.Values are shown relative to main.

Figure 9 .
Figure 9. Dependence of CPU-time on number or state events and result points for the large model (54 HCs).

Table 1 .
Overview on the simulation runs Name Specifications (HC model and other) main DHNSim, constant return temperature, with bypass, tau_m_flow = 180 s, no hysteresis fastDynamics alike main , but tau_m_flow = 30 s noBypass alike main , but no bypasses hysteresis alike main , but with hysteresis to swith load mass flow off onePipe alike main , but pipe network contains only one pipe AixLib AixLib open-loop demand model, constant return temperature AixLibBypass AixLib open-loop demand model, constant return temperature, with bypass DisHeatLib DisHeatLib demand model, constant return temperature, linearized flow characteristic