Control development and sizing analysis for a 5th generation district heating and cooling network using Modelica

5th generation district heating and cooling system (5GDHC) are a relatively new concept. They use a single district loop near ambient temperature to provide heating and cooling. This paper improves on the modelling and control of a 5GDHC system called the reservoir network. The study updates the sewage heat exchanger plant model to more realistically represent seasonal changes, uses refined pump models with variable efficiency, introduces a ground coupled district pipe model to consider the inertia of the district network and implements a new control strategy for geothermal storage and sewage heat exchanger. The new approach reduced operating costs, mainly due to pumping cost for storage, sewage heat exchanger plant and distribution pump, while increasing the overall robustness of the approach in different sizing conditions. Thanks to the new controller, the pumping consumption was reduced by 21% with respect to the original baseline. Furthermore, the new control makes the system take better advantage of design changes, when reducing borehole field size and increasing the sewage heat exchanger size, the pumping energy savings become 29% with respect to the original baseline. Lastly, borehole field temperature stability was analyzed through 40 years of simulation.


Introduction
The rapid pace of urbanization has transformed the world's population distribution, with an increasing number of people residing in urban areas.Currently, 55% of the global population lives in cities, and this figure is projected to rise to 68% by the year 2050 Nations et al. (2012).This urbanization presents both challenges and opportunities.Regarding energy consumption and sustainability, one advantage of urbanization is the potential for implementing centralized heating systems, which offer numerous benefits such as increased overall efficiency and reduced emissions Lake, Rezaie, and Beyerlein (2017).Historically, separate centralized plants were built for heating and cooling purposes.For heating, four generations of district plants have been developed over the last century, each aiming to improve efficiency and integrate more sustainable heat sources, especially renewable Lund et al. (2014).The first generation involved steam plants, while the fourth generation operates at temperatures between 60 and 70 • C, with a focus on incorporating renewable and waste heat sources like solar energy while reducing the primary energy consumption and operating costs of the district Averfalk and Werner (2020).On the other hand, cooling districts traditionally relied on large chillers with evaporative towers, operating at temperatures ranging from 7 to 18 o C. In recent years, the growing need for cooling, driven by global warming and rising temperatures, as well as opportunities for heat recovery, have given rise to a new concept: the simultaneous provision of heating and cooling referred to as 5th generation combined district heating and cooling networks (5GDHC).Various approaches were proposed in the literature to achieve this goal, including cold district heating Pellegrini and Bianchini (2018), bi-directional lowtemperature networks Bünning et al. (2018), anergy networks Sulzer (2011), natural temperature district heating, and the ambient network Calixto, Cozzini, and Manzolini (2021).Among these different concepts, this paper will focus on a type of ambient network, called the reservoir network as presented by Sommer et al. (2020), which works by distributing water in a single loop at ambient temperature maintaining the temperature between a predefined interval (i.e. 6 -17 o C).The single loop improves hydronic balancing among network participants and ambient temperature facilitates integration of waste heat sources.One crucial aspect highlighted by Sommer et al. (2020) is the significant impact of pumping energy in a network with a lower temperature range.Their research demonstrates that a variable flow approach, which keeps the temperature within a specific interval, can drastically reduce pump consumption.This paper improves on the reservoir network concept by focusing on the flow rate control in specific components of the system, namely a borehole field storage and a sewage water heat exchanger plant.Although the temperature range in this type of network may be relatively small, it has a considerable impact on pumping energy Maccarini et al. (2023) and is closely correlated with the current demand of the district.Therefore, to improve the performance of the reservoir network and further reduce pump energy consumption, a better rule-based controller was designed.The control output is the mass flow rate of each agent and it is calculated accounting for current de-mand and temperature level of the agent and district loop.Furthermore, a sensitivity analysis was carried out for the borehole field and sewage water plant sizes on the performance of the system.The idea is to show the potential of reducing the number of boreholes, which lead to lower capital costs, and increasing the waste heat plant capacity, which lead to greater waste heat utilization, with the new control.The analysis and new control implementation is carried out using the Modelica Buildings Library Wetter et al. (2014), which enables modeling of network mass flows, temperatures, and control logic important for analyzing this type of system.Our model extends from the original model used in Sommer et al. (2020).

Methodology
This section presents the case study, the modeling assumptions and the changes to the overall Modelica model used with respect to Sommer et al. (2020).Component level models come from the Modelica Buildings Library Wetter et al. (2014).Dymola 2023x was used to run the simulations on Linux with a Radau solver and tolerance set at 1E-6.

Case Study Description
The case study expands the Modelica model presented in Sommer et al. (2020).The network consists of a single hydronic loop, where the various agents, consisting of prosumers, storage and plants, take water from the reservoir loop and inject it back into the same loop.This ensures decoupling of the differential pressure fluctuations between agent pumps and the main reservoir loop.The reservoir loop includes a borehole field and sewage heat-exchanger, which can be considered the storage and plant of the district able to compensate for the load.Three representative buildings, a residential, an office and a hospital represent the prosumers.The term prosumer is used because the building Energy Transfer Stations (ETS) include a heat pump that can draw thermal energy from the network and a heat exchanger for direct cooling that provides thermal energy back to the network.A schematic view of the network topology and associated controls are shown in Figure 1.

Load Profiles
The loads are pre-calculated as hourly profiles and based on Swiss archetypes Murray, Niffeler, et al. (2019), Kristina Orehounig,Matthias Sulzer (2019), and Murray, Marquant, et al. (2020) and scaled up to provide demand profiles for a typical Swiss district.The ETS in each building will instantaneously compensate for the load while keeping a ∆T of 4 K between district water supply and return.The space heating demand in the residential building is 2.40 GW h/year, corresponding to around 60,000 m 2 considering average Swiss space occupation and consumption SIA et al. (2015), Staub, Rütter, et al. (2014), andWohnfläche (2017).The heating demand of the office building is 0.19 GW h/y or 8 % of the heating demand of the residential building.This consumption ratio corresponds to typical values in Switzerland.For the residential building and the office building, the ratio of annual heating to cooling demand is 7.8 and 2.1, respectively.This ratio is in line with the expected increase in cooling demand scenario for Switzerland Settembrini et al. (2017).The hospital has a heating demand of 0.97 GW h/year and a cooling demand of 0.23 GW h/year, with a ratio of heating to cooling of 4.3.In comparison to the residential or office demand profiles, the main difference of the hospital is the large share of domestic hot water.In total for all prosumers, the heating demand is 3.55 GW h/year and the cooling demand is 0.62 GW h/year.The overall ratio of heating to cooling demand for all prosumers is 5.7. Figure 2 presents a summary of the yearly loads for cooling, heating and domestic hot water of the three buildings.

Heat Pumps and Cooling Heat Exchanger
Each prosumer utilizes two heat pumps: one for space heating and another for domestic hot water.Regarding space heating, the condenser outlet temperature is set at 38 o C when demand is at its design value, and it is reset linearly to 28 o C when there is no demand.For domestic hot water, the set point temperature is 63 o C. The heat pumps are based on the Fluid.HeatPumps.Carnot_TCon model, which includes an ideal internal control system that enables the heat pump to track the setpoint temperature leaving the condenser.The heat pump coefficient of performance (COP) is calculated using a Carnot effectiveness of η carnot,re f = 0.5.For space cooling, direct cooling is provided by a heat exchanger that instantly provides the scheduled cooling demand.

Mass Flow Rates and Pressure Drops
The mass flow rates on the network side of the heat pumps and heat exchangers are controlled to keep the nominal temperature difference of ∆T = 4 K.The pressure drops at nominal mass flow rate for the distribution network between prosumers and plants are assumed to be 50 kPa or 250 Pa/m, with a nominal flow rate of 97.3 kg/s and a pipe diameter of 18 cm.The pressure drops for the sewage heat exchanger (HX) plant are 50 kPa at design flow rate 11.46 kg/s as for the baseline case study in Sommer et al. (2020), while in this study we consider also a scenario where we consider three heat exchangers in parallel instead of one, leading 34 kg/s.For the borehole fields the nominal pressure drop for each bore is 30 kPa and the nominal flow rate depends on the number of boreholes used in the simulation.In Sommer et al. (2020) a total of 350 boreholes were considered, in this study we also added two simulations that consider 250 boreholes and the flow rate is also adjusted considering 0.3 kg/s in each probe for a total of 105 kg/s in one case and 75 kg/s in the other.

Plant and Storage Models
The sewage heat exchanger plant model is based on the Fluid.HeatExchangers.ConstantEffectiveness model.This model is based on the following key assumptions: The soil's thermal properties, such as conductivity and diffusivity, remain constant, homogeneous, and isotropic.Similarly, the ground and pipe material exhibit constant, homogeneous, and isotropic values for conductivity, capacitance, and density.Before the simulation begins, there is no heat extraction or injection.All boreholes in the field have uniform dimensions, including the pipe dimensions.Inside the boreholes, heat transfer occurs solely in the radial direction with no advection.

Circulation Pumps
The circulation pumps provide enough head to overcome the pressure losses occurring in the network.To estimate the electricity consumption, the model Fluid.Movers.FlowControlled_m_flow model was used.The motor and hydraulic efficiency nominal values are η m = 0.8 and η h = 0.6.Furthermore, the motor efficiency η m changes according to U.S. Department of Energy (2014), while the hydraulic efficiency η h changes according to Fu, Blum, and Wetter (2022).

Ground Coupling
Thermal ground coupling of the distribution pipes adds heat capacity to distribution network and ground heat exchange that were not present in the previous study.This allows to have a more accurate estimation of thermal losses and of the inertia of the distribution network, which were absent in the previous work.The new controller introduced in this study for the borehole field storage, described in Section 2.1.7,can turn off the borehole field pump.When the pump is off, the heat capacity of the borefield is decoupled from the district network.As a consequence, if the district network has no storage capacity modelled, its temperature changes instantaneously, e.g., the rate of change in temperature is fast and non-physical.Therefore, we modelled the heat transfer between the pipes and the ground, as shown in Figure 4.The model represents a radial 1D discretization of the conduction heat transfer between the pipe wall and the undisturbed ground.The pipe is assumed to be made of uninsulated plastic with a thickness of 1 cm and a heat conductivity of u = 0.2W /mK.Omitting the pipe thickness in the conduction calculation would lead to an overestimation of the heat transfer between the distribution network and the ground.For the discretization, a capacitance-resistance approach was used, dividing the radial direction into five volumes.The ground temperature was assumed to reach equilibrium with the undisturbed ground temperature T g after 0.5 m and the BoundaryConditions.GroundTemperature.UndisturbedSoilTemperature model from the Buildings Library is used, which is based on Smith (1996).Soil data comes from the ASHRAE climatic constants to calculate subsurface temperature.
The pipe is placed 1 m below ground.Furthermore, a discretization is also carried out in the axial direction where the 500 m of distribution pipes are divided in 100 m segments between supply, return of the plant and storage and each prosumer supply, each pipe is discretized with 10 volumes to approximate the water outlet temperature after exchanging heat with the ground.The yearly temperature variation for the ground is shown in Figure 3.

Network Controllers
The main distribution controller for variable flow operation was developed in Sommer et al. (2020) and works as follows: The controller will reduce the network water flow rate until the water temperature at the outlet of the different prosumers becomes too close to user-provided upper or lower bounds.Let T MixMin and T MixMax be the minimum and maximum measured outlet temperatures from each prosumer, let T Min and T Max be the lower and upper bounds for the mixing temperatures and dT slo a tuning parameter, that can be seen as the slope along which the main pump controller curve is defined for partial load.If T MixMin − T Min > dT slo = 2K or T Max − T MixMax > dT slo = 2K then the pump speed is set to the minimum speed yPumMin.Otherwise, it is linearly increased to the full speed until T Min = T MixMin or T Max = T MixMax, where the pump will work at nominal capacity.This calculation is done for the lower and upper bound and the actual pump speed is the larger of the two pump signals.This control logic is implemented in the model Experimental.DHC.Networks.Controls.MainPump.In Figure 5 the logic is represented visually.
In this study, we developed a rule-based controller for the sewage heat exchanger plant and the borehole field storage control, each of them has a separate instance of the controller.The controller takes as input the average source temperature (i.e.sewage water or average borehole field temperature), the inlet and outlet temperature of the agent, and the supply to the first prosumer and return temperature from the last.These supply and return temperatures are used to estimate the net need of the district for heating or cooling by looking at their difference.Then, the agent outlet is used as the measured input to a proportional controller that controls the mass flow rate through the agent pump.This controller's setpoint is the source temperature adjusted with a negative shift for heating and a positive shift for cooling to account for a pinch point temperature difference between source temperature and outlet temperature.Lastly, an on/off controller with hysteresis based on the difference between inlet temperature to the agent and shifted source temperature is used to determine when to turn on and off the agent circulation pump and avoid frequent switching behavior.

Baseline Case Study Hypotheses and Changes
In Sommer et al. (2020), the main assumptions for the network side are: Control development and sizing analysis for a 5th generation district heating and cooling network using Modelica 1.The pumps use a constant motor and hydraulic efficiency of η m = 0.7 and η h = 0.7.
2. The annual energy balance of the storage has to be zero.The sewage heat exchanger plant will provide the net heating and cooling demand.
3. The water temperature in the reservoir loop must always be between 6 and 17 o C.This ensures that direct cooling is possible and that with a nominal ∆T = 4 K the heat pumps can draw heat without danger of freezing.
4. The sewage water temperature is a constant value at 17 o C for the whole year.
5. The distribution pipes are simplified as adiabatic and hence do not exchange heat with the ground.
6.The sewage heat exchanger circulation plant is always working at nominal flow rate.The storage circulation pump uses the same control signal as the main network circulation pump according to the logic explained in Section 2.1.7.
In this study, these assumptions are modified in the following ways: 1. Since an objective of this study is to reduce pump consumption through better control logic, we updated the pump models to account for variable efficiency at part loads, as described in Section 2.1.5.
2. In this case the yearly energy balance of the storage does not need to be zero, however, it has to reach a reasonable steady state condition after a certain period of , for this study 40 years were considered.The borehole average temperature difference between the initial condition should be within an acceptable range of around 1 o C, for example the minimum temperature of the borehole has to be above freezing point to avoid potential damage to the borehole filling.3. Instead of keeping a constant upper limit of 17 o C, the temperature limit can be increased if no prosumer requires cooling.This can be done by checking the cooling pump signal.In the case no prosumer requires cooling, the 17 o C temperature limit is increased to 19 o C.This is to avoid that during periods with low heating demand, such as Spring and Autumn in this study, the sewage heat exchanger plant will bring the district temperature close to 17 o C causing the distribution pump controller to rise the flow rate according to the logic in Figure 5, which only causes an increase in electricity consumption with no benefit.
4. The distribution network pipes now have a ground thermal coupling with an approach similar to the one presented in Maccarini et al. (2023) and described in Section 2.1.6.
5. Instead of considering a constant sewage temperature value for the whole year, a variable temperature profile is derived from Schmid (2008) under the hypothesis of placing the sewage heat exchanger at the effluent water of waste water treatment plant.The yearly temperature variation for the sewage water is shown in Figure 3.
6.The new rule based controller for the sewage heat exchanger and borehole field is used as described in Section 2.1.7.

Simulation Scenarios
A total of six scenarios were considered in this study described as follows and summarized in Table 1: 1. bs nbor350mpla11 : considered the baseline scenario, since the model used is identical to the one used in Sommer et al. (2020) apart from the sewage temperature profile, the distribution pipe coupling and the pump efficiency modelling.
2. bs nbor250mpla11 : the model is similar to bs nbor350mpla11 , however, the borehole number is downsized to 250.The reasoning is to carry out a small sensitivity analysis and see how the baseline controller behaves when the storage capacity is reduced by around 30%, and so is the investment cost.Looking at the technical report Oakridge national laboratory (2018), the drilling cost of a borehole can be assumed to be between 30 and 50 $/m, considering that each borehole is 250 m deep, this would amount to around $1M saved with respect to baseline.

bs nbor250mpla34 :
the model is similar to bs nbor250mpla11 , however, the nominal flow rate of the sewage plant is increased to 34.5 kg/s.The reason for this sensitivity analysis is to give more room to the sewage plant heating capacity while keeping the overall investment cost equal or lower.The cost increase of the heat exchanger can be calculated according to the cost per area needed Hewitt and Pugh (2007).We can calculate the area starting from the effectiveness value ε model, under the following assumptions: • The sewage heat exchanger is a plate heat exchanger with enough plates to be approximated at counter flow so that ε = NTU/(1 + NTU) • The global heat transfer coefficient U = 2000W /(m 2 K), which is an average value for such heat exchangers • The minimum fluid heat capacity rates of for the two cases are C min = 50 kJ/(K s) and C min = 150 kJ/(K s) Under these assumptions the area is Doing this calculation for our case leads to a total area of 315 m 2 when m f low = 11.46kg/s and 945 m 2 when m f low = 34.45kg/s.This leads to average investment cost of $20,000 and $60,000.This exercise does not account for the increase in price for the sewage heat exchanger pump and pipes, which are likely smaller components.The increase in cost for the sewage heat exchanger is smaller than the decrease in cost for the reduced number of boreholes, making this scenario cheaper than the baseline.
4. nc nbor350mpla11 : similar to bs nbor350mpla11 , but the sewage heat exchanger plant and the borehole field storage circulation pumps are controlled with the new rule based controller.Furthermore, the relaxation logic for the upper temperature bound is used in the main distribution pump controller and the parameter dT slo = 1.5K, slightly increasing the main distribution pump controller dead band.
5. nc nbor250mpla11 : similar to nc nbor350mpla11 , but the size of the borehole field is also downsized to 250.
6. nc nbor250mpla34 : similar to nc nbor250mpla11 , but the nominal flow rate of the sewage heat exchanger plant increased to 34.45 kg/s.

Borehole Field Temperature Drift
In Subsection 2.1.8we state the requirement that the borehole field energy balance does not need to be zero at the beginning, however the average borehole field temperature needs to reach a reasonable equilibrium point.In New 250 m_ f low =34.45 Figure 6, the evolution of the average ground temperature at the interface with the borehole for the scenarios nc nbor250mpla11 and nc nbor250mpla34 are shown.The temperature reaches a new equilibrium point after around 35 years of simulation, as it can be seen from Table 2.For scenario nc nbor250mpla11 the temperature difference after 40 years of simulation is 3.2 K, while for scenario nc nbor250mpla34 it is 1.6 K.This is to be expected since increasing the size of the sewage plant heat exchanger satisfies the heating demand during winter, reducing the depletion of the borehole field.This is also reflected in the total energy cost, which in scenario nc nbor250mpla11 increases by 20%, while in scenario nc nbor250mpla34 it increases by only 0.8%.The larger increase in total energy consumption for the first scenario is due to a lower average district temperature during winter, affecting the heat pump COP and leading to an increase in average mass flow rate for the main distribution pump to maintain the minimum temperature constraint of 6 o C.However, as mentioned in Subsection 2.1.1,the cooling demand is expected to increase in Zurich, further reducing the negative temperature shift of the borehole field.Furthermore, with such a large time span, the district could also expand or differentiate its demand due to more prosumers connecting, which increases the uncertainty.A sensitivity analysis on such a long period of time would be a separate study.The current Modelica models are computationally efficient enough to carry out such a study since the current implementation of the model takes less than 5 h to run on a single thread Lenovo workstation with a Xeon(R) W-2245 CPU @ 3.90GHz for a 40 year simulation.

District Energy and Temperature Profile Analysis
This section presents the results from the scenarios introduced in Table 1. Figure 7 presents the yearly cumula- tive energy and temperature profiles for each scenario for the first year of operation.Plot a) shows the yearly total thermal demand of the buildings, which is net heating of almost 3 GW h/year.Plot b) shows the losses through the distribution pipes for each scenario.This chart indicates that the distribution losses are generally between 2% and 4% of the overall thermal demand.Furthermore, the new controller (nc) scenarios have lower distribution losses with respect to the baseline bs nbor350mpla11 , by 25% in scenarios nc nbor350mpla11 and nc nbor250mpla11 by 7% in scenario nc nbor250mpla34 .This is due to an average lower temperature during the summer months for the (nc) scenarios, as shown by the flatter slope of the cumulative energy curve during this period.Instead, for the baseline (bs) scenarios, the losses remain the same for bs nbor250mpla11 and increase by 40% for scenario bs nbor250mpla34 with respect to bs nbor350mpla11 .The reason for this increase in losses is due to the increase of average temperature of the district for bs nbor250mpla34 with respect to the ground temperature.
Plots c) and d) of Figure 7 show the cumulative energy flows from the borehole field and sewage heat exchanger to the network in each scenario.Looking at the baseline (bs) vs. new controller (nc) scenarios, the cumulative energy supply for borehole field and sewage HX are very close for the initial winter season.The reason is that, in winter, only heating is present as shown in Figure 2, meaning that both in bs and nc scenarios, the sewage HX pump will run most of the time.In the summer, the situation changes because the bs scenarios continuously run the sewage heat exchanger pump at nominal capacity, while the nc scenarios only turn it on when the domestic hot water demand surpasses the cooling demand.
In the (bs) scenarios, since the average temperature of the sewage is higher than the network limit for cooling and the sewage plant pump is continuously running, this causes the storage to have to overcompensate to keep the network temperature lower than in the case of just serving the building cooling load.This phenomenon is exacerbated in the scenarios with reduced number of boreholes and increased mass flow rate in the sewage heat exchanger.On the other hand, the nc scenarios can turn off the sewage plant production when the demand is cooling dominated, and it benefits from any increased sewage plant capacity by supplying more heat during heating dominated periods.This not only improves performance, but makes the overall operation more robust to cases of adding more waste heat capacity, or changing demand due to connecting new prosumers or climate change.
Plots e) and f) report the daily maximum and minimum network temperatures and their limits over the year.Starting from the bs scenarios, the default bs nbor350mpla11 is able to satisfy the temperature constraints in heating and cooling seasons, while bs nbor250mpla11 and bs nbor250mpla34 violate the constraints.The reason is that by increasing the size of the sewage heat exchanger plant and reducing the number of boreholes, it becomes impossible for the borehole field to compensate for cooling demand and heat injected by the sewage water plant into the reservoir loop, as described previously.Among the nc scenarios, scenario nc nbor250mpla11 slightly violates the constraint in the worst months of winter, and both nc nbor250mpla11 and nc nbor250mpla34 slightly violate the constraint in the summer.Furthermore, the plot shows the nc scenarios using the flexible upper boundary as a function of current district demand.This relaxes the upper limit, making the district circulation pump controller dead band larger, and ultimately slowing down the pump, according to the logic presented in Figure 5.The reason for the upper bound being increased during the summer is due to times when no cooling demand is present, but domestic hot water demand is.

Summary Results and KPI Analysis
This section shows a KPI analysis on the performance of the district for the various scenarios described in Table 1. Figure 9 reports the overall electrical consumption of the district and the circulation pumps of the network.The top chart shows that, in general, the heat pump and prosumer pumps make up 87.5% of the overall electricity demand of the district, while the remaining 12.5% is due to the main circulation, sewage heat exchanger plant and borehole field pumps.Therefore, the new controller nc scenarios show only moderate total electricity savings with respect to the baseline.However, it is interesting to notice the increase in electricity consumption for the baseline bs scenarios bs_nbor250mpal11 and bs_nbor250mpal34 with respect to the other scenarios.In these two scenarios, the temperature constraints are often violated as shown in Figure 7, causing the main distribution pump to      run more often at nominal capacity as explained in Subsection 2.1.7.The situation is further exacerbated in scenario bs nbor250mpla34 .This indicates that the nc scenarios are more robust towards sizing changes, which allow for more sizing choices of different components (i.e.plant and storage), which is critical for opportunities to reduce capital costs.For example in this study, Section 2.1.9described how reducing the borefield size could save approximately $1M dollars in capital cost.As shown with scenario nc_bor250mpla11, the new control enables this without an increase in operating costs from electricity consumption.Furthermore, scenario nc_bor250mpla34, with only slightly higher capital cost of around $100k dollars than nc_bor250mpla11 to pay for higher sewage plant capacity, though still cheaper than the cases with full 350 boreholes, further reduces the overall electricity consumption thanks to increase in additional heating energy provided by the sewage heat exchanger.Lastly, if we consider the absolute savings for nc_bor250mpla34 compared to bs_bor350mpla11, they equate to 40 MW h/year of electrical energy, $12,000/year assuming an average electricity price of $0.3/kW h, and 1.3 tonCO2/year, assuming 330 kgCO2/kW h.Furthermore, the bottom chart of Figure 9 shows the nc_bor250mpla34 scenario reduces the total pump consumption by 29% compared to bs_bor350mpla11.
Figure 8 presents a summary of the hydraulic and thermal performance of the district in the different scenarios, where the top chart represents the yearly hourly mass flow rate distribution for the different network agents, the middle chart shows the yearly seasonal COP for the three prosumers, and the bottom chart shows the yearly aver-age circulation pump efficiency, only when the flow rate is 10% higher than the nominal value to avoid fast transients.Looking at the top and bottom chart together, it is clear that the nc scenarios reduce the agent mass flow rates, thanks to the better control strategy that is able to maintain the average district temperature further from the upper and lower boundaries, running the main circulation pump at partial load according to the logic in 2.1.7,and using the storage and plant in more effective ways depending on the current demand and loop temperature levels.However, the partial load utilization in these scenarios increases the variability in the agents pump efficiency as shown in the bottom chart.Furthermore, looking at the pump efficiency box plot, we can see that using more realistic efficiency curves lead to an average efficiency of the pumps that is relatively low.There is certainly room to improve the pump sizing coupled with control that uses the pumps at partial load.
Lastly, looking at the middle chart, it can be seen that the increase in size of the sewage heat exchanger helps increase the seasonal COP in scenarios bs nbor250mpla34 and nc nbor250mpla34 with respect to the other scenarios, since it increases the average temperature of the district during winter, as shown in Figure 7 bottom plot.However, in bs nbor250mpla34 , this causes a great penalty in the summer since the sewage water heat exchanger pump is always running, while in the nc nbor250mpla34 , the pump is mostly turned off during the summer period.

Conclusions
This study extended Sommer et al. (2020) reservoir network with an updated sewage heat exchanger plant model to more realistically represent seasonal changes, new pump models with variable efficiency, ground-coupled district pipe model to consider the inertia of the district network, which is important for control stability, and a new control strategy for the distribution network, sewage heat exchanger, and borefield pumps.The updated model was used to carry out a sensitivity analysis on the size of the borehole field and sewage heat exchanger, using the baseline and the new controller.
The analysis shows the robustness and performance enhancement of the new control approach nc over the baseline bs.The new nc approach leads to a $4800 dollars increase in operational costs when reducing the size of the borehole field by 30%, saving $1M in investment cost, reducing the overall life cycle cost.Furthermore, when additionally increasing the capacity of the sewage heat exchanger, the new control better exploits the additional waste heat capacity, as shown in scenario nc nbor250mpla34 , where the overall investment cost is reduced compared to the baseline by around $0.9M, and operational costs are reduced by $12,000 per year thanks to the electrical energy saved.This sensitivity analysis shows the importance of coupling design, sizing and control to reduce first and life cycle costs.Future studies will include a more extensive sensitivity analysis and the introduction of control and design optimization to explore the untapped potential of the reservoir loop system and the model updates.

Data Availability
Results can be reproduced running Experimental.DHC.Examples.Combined.SeriesVariableFlowUpdate in branch commit a64685e3ac of repository modelicabuildings.

Figure 1 .Figure 2 .
Figure 1.Network scheme represented in Modelica.Each box is a main component of the district model.Solid lines represent physical and digital connections, while dashed lines represent control inputs and outputs

Figure 3 .
Figure 3. Effluent sewage water and undisturbed ground temperature profiles used for simulations.

Figure 4 .
Figure 4. Representative diagram of the radial heat transfer between the distribution pipe T p and the ground T soi (left).Axial discretization of the pipe water volumes T w,i (right).Below is a diagram view of the ground coupling model.

Figure 5 .
Figure 5. Distribution pump controller.On the x-axis there is the district temperature, while on the y-axis there is the main pump control signal as a function of the minimum and maximum prosumer outlet temperatures T MixMin and T MixMax as explained in Subsection 2.1.7.The dotted lines show the effect of shifting T Max or T Min.

Figure 6 .
Figure6.The average borehole temperature is plotted on the y-axis for scenarios newcon_nbor250mpla11,black, and newcon_nbor250mpla34,red, while on the x-axis the time in years is shown up to 40 years.This plot shows the temperature drift of the ground in the borehole.

Figure 7 .
Figure7.Visualization of energy flows and temperature distributions across the district network.For all the figures the x-axis is time shown for the first year of simulation from January (1) to December (12).a) chart shows the overall cumulative thermal demand of the district buildings, b) chart shows the cumulative energy flow from the distribution pipes to the ground c) and d) show the cumulative energy flows from the sewage plant (dashed lines) and borefield (solid lines) to the reservoir loop for the baseline bs (left) and new controller nc (right) scenarios e) and f) show the district loop daily minimum and maximum temperatures for the different scenarios and the temperature limits of the main distribution pump control.

Figure 8 .
Figure8.The x-axis shows the different scenarios presented in Table1.The y-axis shows the water mass flow rate for each agent (top), the COP for the each prosumer (middle), and pump efficiency for the network pumps (bottom).The numbers for each plot corresponds to the yearly average value of the mass flow rate and efficiency (only when flow rate is 10% higher than nominal value to avoid quick transients) and the Seasonal COP for the COP plot.
b sn b o r3 5 0 m p la 1 1 b sn b o r2 5 0 m p la 1 1 b sn b o r2 5 0 m p la 3 4 n cn b o r3 5 0 m p la 1 1 n cn b o r2 5 0 m p la 1 1 n cn b o r2 5 0 m p la 3 This research was supported by the Assistant Secretary for Energy Efficiency and Renewable Energy, Industrial Efficiency and Decarbonization Office and Office of Building Technologies of the U.S. Department of Energy, under Contract No. DE-AC02-05CH11231.

Table 1 .
Summary of simulation scenarios considered.Thermal coupling, variable sewage heat exchanger temperature and variable efficiency pump are included in all scenarios.

Table 2 .
Summary of borehole field average temperature evolution T N and total electrical energy consumption Eel N at a given year, where N is the year number.

Table 1 .
The y-axis shows the water mass flow rate for each agent (top), the COP for the each prosumer (middle), and pump efficiency for the network pumps (bottom).The numbers for each plot corresponds to the yearly average value of the mass flow rate and efficiency (only when flow rate is 10% higher than nominal value to avoid quick transients) and the Seasonal COP for the COP plot.
The x-axis shows the different scenarios presented in Table1.The y-axis shows the total yearly electrical consumption by the whole network (top) and only distribution, plant, and stroage pumps (bottom).The % number in white corresponds to the difference with respect to the baseline scenario bs_bor350mpla11.