Design and Assessment of District Heating Systems with Solar Thermal Prosumers and Thermal Storage

: In this study, a holistic energy, economic and environmental assessment was performed on a prosumer-based district heating system, including scenarios with varying district size, retroﬁtting stages and system conﬁgurations. A modeling framework was built which comprises a thermal network design and simulation model; a building energy demand model for districts; and supply and storage technology models that allow assessing system solar fraction, equivalent annual cost and greenhouse gas emissions of district heating systems (DHS). Furthermore, the approach allows comparing the performance of a DHS with individual heating systems (IHS) for the district with the same set of technology options (rooftop-mounted solar thermal collectors, gas boilers and thermal storage tanks). The framework was applied to a Swiss case study. The results of the case study show that DHS often outperform IHS; however, parameters such as the district size, the retroﬁtting stage of buildings and the system conﬁguration have impacts on the performance of the DHS. The most important parameter lies in the adequate selection of the storage volume over solar collector area ratio, which indicates that DHS solutions are only advantageous if they are properly sized. Smaller districts and districts with retroﬁtted buildings especially beneﬁt from DHS solutions in terms of energy, economic and environmental performance. Maximum solar fractions of 50% (non-retroﬁtted case) and 63% (retroﬁtted case) were reached with the DHS solutions.


Introduction
Of global primary energy consumption, 40% is due to buildings [1]. Switzerland is located in a cold climate where the heating season lasts for about 5 months of the year; 73% of residential and office buildings are still heated with fossil fuel based heating systems (e.g., oil boiler and gas boiler [2]). Only 11% of buildings are equipped with heat pumps [2], which is typically a cleaner solution; however, its environmental performance is strongly dependent on the local electricity grid mix. Another relatively clean option is the district heating system, which typically achieves higher overall system efficiency and benefits from economy of scale.
Extensive advancements in research on district heating systems have been achieved in recent decades, including the change from the 1st generation to the 4th generation [3] of networks. The focus was put on: (1) lower temperature levels, due to the transition from mostly fossil fuel based systems with high temperature water steam to lower temperature (e.g., 70/30 • C, 50/25 • C) and ultra-low temperature levels (<50 • C) of renewable based systems; (2) the shift from conventional hierarchical systems with a single central source to multiple energy sources at multiple locations, and (3) smart control systems to allow buildings' participation as prosumers. All the different elements and developments need to be optimally integrated and managed in sustainable district heating systems.
A particular challenge lies in the integration of renewable based distributed heating sources, such as waste heat or rooftop solar energy, due to their limitations in local availability and varying potential over time. New system configurations which are based on multiple sources, and buildings participating as prosumers, need to be integrated into future district heating solutions.
A prosumer is defined as a unit which both consumes and produces energy in the form of electricity or heat [4]. The thermal network allows shifting the diurnal mismatch between surplus solar energy and heat demand between buildings. In addition, thermal storage tanks are typically included, which allows one to overcome the seasonal discrepancy between solar supply in summer and the heating load, which is dominant in winter. However, despite many advantages of district heating systems, they are still very costly and require long term planning and significant changes in infrastructure. Additionally, the operation of district heating networks results in high operational costs due to thermal losses of the pipes and additional pumping energy for distributing the heat. Investment costs and operating costs highly depend on the district size and load characteristics. The overall cost effectiveness, energy performance and environmental impact require a comprehensive evaluation, which might differ from case to case.
Extensive studies have been carried out on analyzing the technical and economic performance of conventional district heating systems [5][6][7][8], which included different district scales, climates, design and operational conditions. For example, Wang et al. optimized the economic interests for the design of a conventional district heating network model [9]. Ljubenko et al. investigated the exergetic efficiency optimization procedures for a branch network [10]. In both works, the focus was only on the network model, regardless of supply energy sources. In regard to solar-based district heating systems, the majority of the research is still focused on centralized solar systems. For example, Lizana et al. conducted a feasibility study for the impact of district scale (identified by heat load density) on the payback time of central solar-based district heating systems in Mediterranean areas [11]. The Drake Landing Solar Community in Canada is one of the first and most famous pilot projects on central and semi-central (distributed) solar thermal-based district heating systems [12,13]. It demonstrates the operation of a large scale system with seasonal storage, reaching a solar fraction above 90% after 5 years of operation. The cost effectiveness and the environmental impact are not mentioned in the studies. Very little research has been done on distributed solar-based district heating systems with storage technologies. Brand et al. conducted a technical and environmental study with a simulation model in NetSim for the case of introducing solar prosumers to an existing district heating system in Malmo, Sweden [14]. Ben Hassine et al. [15] developed a quasi-dynamic thermal network simulation model to study different supply scenarios for solar thermal collectors integrated in an existing district heating network in Germany. In the system, solar thermal collectors were only used as auxiliary heat sources, and no storage technologies were included; thus, the renewable integration was very low with a solar fraction of 0.3%. Both studies from Brand et al. and Ben Hassine et al. were carried out for existing district heating networks. The design of the networks and implementation of thermal storage were not covered. Yang et al. [16] investigated the impacts of solar thermal integration into a community-level district heating system with distributed and centralized thermal storage technologies with a simulation model built in TRNSYS. Overall energy consumption and greenhouse gas emissions were analyzed and compared. A shortcoming of the modeling methodology lies in its very simplified distribution network model with a unified pipe design, and the system design and costs are not addressed.
To summarize, until now analytical results of the different studies were mostly case specific, and a generalized approach and conclusion is lacking. Based on existing studies, it is difficult to determine whether prosumer-based district heating systems with storage are a valid option in terms of their economic, energy and emissions-based performance.
A holistic evaluation for solar prosumer-based district heating systems (DHS) is neededone which quantifies the advantages and drawbacks depending on the size of the district and load profile characteristics, to address not only the energy performance but also the economic and environmental performance of the system solution.
Existing district heating network simulation models vary among steady-state [17], quasi-dynamic [15] and dynamic models [18]. Differences lie in whether time-dependent state variables are captured and represented in the models. Highly detailed models ensure modeling precision within high time resolution, which at the same time requires large numbers of design and operational input data, technical parameters and control variables. Thus, the total modeling effort and model complexity rise tremendously from steady-steady, quasi-dynamic models to dynamic models. The majority of steady-state and quasi-dynamic models are used for high level feasibility analyses, such as energy and economic analysis. These models are sufficient to support operational simulation for longer time steps (e.g., hours) and long time periods (e.g., 1 year of simulation), which have been adopted by many studies. Most dynamic models are used for operational control purposes with fast dynamics (in seconds or minutes' response) and are simulated for short time periods (e.g., hours and days), for example [18]. Some existing commercial software packages support network simulation modeling, for example, TRNSYS [19,20], EnergyPlus [21], Termis [22], NetSim [23] and Dymola with Modelica as an object-oriented language [24]. However, most tools are still under development for implementing a prosumer-based district heating system simulation model that serves multiple ends, such as (1) being flexible and autonomous for design of both the pipes and the network layout of a general district, (2) supporting flow direction changes during operations and (3) remaining computationally light for long simulation period (e.g., 1 year).
In this paper, a steady-state thermal hydraulic district heating network model (DHN model) is presented, which is based on hourly time steps, to facilitate the design and operational evaluation of DHS with distributed sources. A holistic framework incorporates the DHN model, a demand simulation model and other energy supply and thermal storage technologies. With such a framework, a quantitative analysis of a prosumerbased solar DHS with thermal storage was performed, based on its energy, economic and environmental impacts. The aim was to investigate which kind of district benefits from this type of DHN (retrofitted or not, load density, etc.), and to evaluate its performance compared to individual heating system solutions with the same setup of technologies.
The paper is structured as follows: Section 2 describes the modeling framework and the different simulation scenarios. Section 3 provides details on the artificial case study, including underlying data and assumptions. Section 4 presents the results and discussion of the case study. Section 5 concludes the study and indicates further research directions.

Framework Overview
A modeling framework was developed for evaluating the design and operation of district heating systems with distributed energy sources based on their energy, economic and environmental performance. The framework builds on geo-spatial urban data from a geographical information system (GIS), and is composed of a building energy demand model, a district heating network model and supply and storage technology models. A general overview of the methodology is shown in Figure 1 and described below. As a start, district and building information from different databases is retrieved and accessed through GIS. The information includes general building information (3D geometry) [25], building locations and characteristics and local weather information [26], which is used in the demand model, to compute heating energy demand for all buildings within the district with hourly resolution. Additional inputs (e.g., building layouts and street network layouts) pertain to potentials for supply and storage technologies, including their specific installation locations (both centralized within the district and distributed at individual building level). Inputs from the different sub-models are then used in the DHN model for assessing the design and operational performance of the overall energy system. The DHN model is based on a thermal-hydraulic physical model built in MATLAB to perform a holistic energy and economic analysis of the overall energy system of the district.

Demand Model
To design DHN for a district, information on heating demand of each building, including space heating and domestic hot water, is required. Peak heating demand is important for the sizing of technology capacities and the piping network. High time resolution heating profiles (in hourly or sub-hourly resolution) are important for the operational analysis of the network performance. In this modeling framework, the urban scale building simulation tool CESAR (Combined Energy Simulation and Retrofitting) [27] is applied to generate demand profiles of the district. The tool, which is based on the building simulation engine EnergyPlus [28], automatically creates bottom-up building simulation models based on inputs from GIS data and building information collected from GWR (Department of Buildings and Apartments Registry) [29]. Archetypical information on building construction, together with a stochastic model for usage schedules according to SIA 2024 [30], specifies a heterogenic performance given occupancy, thermostat settings, ventilation rate, etc. Additionally, CESAR is capable of evaluating retrofit strategies for urban districts to predict the changes in energy demands under different retrofitting conditions. As a result, dynamic hourly space heating and domestic hot water demand profiles are generated for both the status-quo and potential retrofitting conditions for the district in question. The energy demand is then used as input for the DHN model.

District Heating Network Model
The core of the framework is the DHN model, which allows for the network layout design, piping design and the network operation. The simulation model is based on a multi-time step steady-state thermal hydraulic model to evaluate the network performance with multiple energy sources at distributed locations. The model was programmed within MATLAB. The output of the model includes the network layout design, design of pipes, hourly mass flow rate, temperature distribution and hydraulic losses within the network. A schematic description of the workflow within the DHN model is shown in Figure 2. Further details of the different steps (network layout design, pipe design and simulation) are described in the following sections. Please note that only branch network layouts are considered in this model, which is the most typical network configuration at the moment.

• Network layout design
With the retrieved geo-spatial information of building location and street network layouts, representative points to build the network pipelines are identified through Ar-cGIS [31]. For each building, the building footprint centroid is perpendicularly connected to the nearest street. Then these connecting points are regarded as representative points. Geographical coordinates of these representative points are exported from ArcGIS as input data to the district heating network layout design in the DHN model. A detailed graphical example of this process is demonstrated in Section 4.1 for the network layout design of the case study.
Starting from the imported representative points from ArcGIS, all possible network connections are calculated, the network structure is represented with graph theory. Graph theory is a method of mathematical structure to model pairwise connections between objects. It has been applied for complex network modeling in cases such as water networks and district heating networks [15,17,32,33]. Connections of pipes are formulated as a graph composed of edges and nodes, where edges denote the pipes and nodes denote the energy sources (producer) or sinks (consumer). The minimum spanning tree algorithm is applied to create a branch network layout that minimizes the total network pipe length. An incidence matrix A is used to orient the given signed graph. Network variables and parameters representing pipe characteristics are coupled with edge and node properties. Edge properties from node i to j include pipe length L ij , pipe mass flow rateṁ ij and pipe characteristics (such as thermal conductivity, roughness and diameter). The direction of the directed graph sets the sign convention of edge-variable mass flow rate. When the flow direction is aligned with the graph's direction, the value is positive. When the flow direction is against the graph's direction, the value is negative. Network temperature T i , pressure P i , source and sink mass flow rateṁ si at each node i are defined as node properties. A source node represents an energy supplier and a sink node represents an energy consumer.The sign ofṁ si differs, depending on whether the node is a source node (-) or a sink node (+).

• Pipe design and mass conservation
For network pipe design, specific design guidelines from manufactures are taken into account, which either limit the maximum allowable flow speed or target the pressure loss of pipes [8,34]. Peak mass flow rates throughout the year depend on required supply and return temperatures. They are calculated in order to determine the pipe design. Pipe diameter d ij is sized such that the peak flow velocity does not exceed the allowable value ν max , which is specified by available pipe products, as shown in Equation (1), where ρ is the water density.
For district heating networks with multiple sources and multiple consumers, the total mass flow rate is conserved at all nodes, as shown in Equation (2), where n is the number of nodes in the network. For mass conservation at each node i, the sum of the flow rates that enter the node equals the sum of the flow rates that leave the node. The system of linear continuity equation is expressed in Equation (3), whereṁ s is the matrix form ofṁ si at all nodes, andṁ is the matrix form ofṁ ij at all edges.
The designed network is then simulated with a multi-time step steady-state thermal hydraulic model [35]. The operation strategy of the district heating network was chosen to be fixed supply temperature and variable flow rate [8]; this means that supply temperatures are fixed for all the energy sources. The mass flow rate is controlled by a valve based on a fixed temperature drop on the consumer substation side. This assumption has been widely applied in network modeling approaches [6,8,15,36,37]. By using this assumption, the thermal calculation is decoupled from the hydraulic calculation. The hydraulic calculation is carried out to decide on the values and flow directions of mass flow rates in pipes. Equations (1) and (2) are solved first by using a MATLAB solver for the system of linear equations. The pressure drop due to pipe friction is calculated according to the Darcy Weisbach equation [38]. In Equation (4), the pressure drop along a circular pipe is formulated as a quadratic correlation with respect to mass flow rate. f D is the friction factor, which is highly dependent on the flow regime (laminar flow or turbulent flow) and the relative roughness of the pipe /d ij , expressed in Equations (5) and (6), where is pipe roughness and Re is Reynolds number. To derive f D , mathematical formulation is required, either with an implicit equation solved with an iterative method or an explicit equation derived through mathematical approximation. In this model, the Swamee-Jain equation [39] is used as an explicit expression to calculate the friction factor, as shown in Equation (6).
laminar flow regime : After deriving the hydraulic balance in the distribution network, the thermal energy balancing is performed. The temperature loss along the pipe flow direction is calculated by using the heat transfer model of a single circular underground pipe in Equation (7), where T in and T out represent pipe inlet and outlet temperature, T g is the ground temperature, k ij is the pipe thermal transfer coefficient and c p is water heat capacity.
For conventional district heating networks with a single central source, the modeling of thermal propagation along the pipeline is straightforward, as energy flow travels along the supply pipe in one direction only. However, for district heating networks powered by multiple distributed sources, consumers are supplied from different energy sources from multiple locations. Depending on consumer's hourly demand and heat generation from non-dispatchable energy sources, such as solar energy and waste heat from distributed locations at different time steps, the flow direction might differ. To model the thermal behavior in the distribution network, it is very important to track the flow directions of energy sources at every time step, and define the upstream and downstream flows from multiple sources and their mixing at the various nodes. At each mixing node, an enthalpy balance equation is used to derive the mixing temperature, as shown in Equation (8). For diverter nodes, where water flow splits to multiple streams, the outlet temperature equals the inlet temperature, as shown in Equation (9).

Supply and Storage Technology Models
The following modeling formulations are used to represent solar thermal collectors, gas boilers and thermal storage tanks: • Solar thermal collector (STC) Flat plate solar thermal collectors (STC) were chosen as a renewable energy source to cover heating loads of buildings in the district. The performance of STC is calculated based on the classical model described in [40]. The efficiency of the STC (η col ) depends on the available solar radiation I solar , the air temperature T air and the return flow from the building T in,col [40], as shown in Equation (10). The hourly output energy from the STCQ STC out is given in Equation (11). To feed in energy from STC to the thermal network, the supply temperature from STC is the same as the network supply temperature. For periods with low solar radiation, wherein the targeted supply temperature of the STC can not be met, STC do not operate.
• Gas boiler (GB) A natural gas boiler (GB) is used in the district energy system to cover peak loads of the district. The gas boiler can either be located at a central location to supply a district heating network or at individual buildings to cover peak loads of buildings. As the efficiency of a gas boiler is generally very high (above 90%), no capacity-based difference on GB operational performance is taken into account between different system scenarios. The hourly output energy from a GB is given in Equation (12).
• Thermal Energy Storage (TES) A simplified thermal storage tank model is incorporated in the workflow which is based on the mathematical formulation derived by Vandewalle et al. [41]. It is a twolayer, stratified tank model which assumes perfect stratification, with one thermocline that separates the hot and cold water layers. Detailed model derivation can be found in [41]. Assumptions are based on a cylindrical tank fully buried underground, with the temperatures of the hot layer T h , cold layer T l inside the tank and soil T o surrounding the tank as constant values. The model is detailed enough to account for the thermal transfer between the two water layers and thermal losses though the wall, top and bottom of the tank, which both depend on the TES charging status. The State of Charge (SOC) is derived as shown in Equation (13).
whereQ TES char (t) represents the time series of the charging rate (positive for charging; negative for discharging). The loss coefficients α and β are dependent on a time constant The time constant τ is given in Equation (14).Q loss,ct represents a constant loss term which is independent of the status of charge, as shown in Equation (15). It is assumed that the material and thickness are the same for the top wall, bottom wall and cylindrical wall; thus they have a uniform wall heat transmittance U. A W and A t are cylindrical wall surface area and top (bottom) wall area. m tank is the total water mass in the tank.
For a solar thermal collector-based heating system with TES, the TES volume is a very important design parameter. It does not only impact investment costs but also the operational performance. SOC is highly dependent on τ andQ loss,ct , as shown in Equations (14) and (15). τ andQ loss,ct are based on TES design parameters, including the tank geometry (volume and aspect ratio), wall thickness, wall insulation materials, ground soil temperature and storage temperature levels.

Simulation Analysis and Scenarios
The goal of this simulation analysis is to evaluate the performance of STC and TES in combination with and without a district heating network for a typical district in Switzerland. Different parameters are varied within this analysis to identify driving parameters for the design of a network.

Simulation Scenarios
Two heating system configurations are considered in the analysis, a district heating system and an individual heating system. Technologies comprise rooftop solar thermal collectors (STC), gas boilers (GB) and thermal storage water tanks (TES) buried underground, which operate for both long term and short term.
A summary of the heating system scenarios is as following, with a brief illustration shown in Figure 3:  The main heat sources of the district are solar thermal collectors, which are mounted on the roof surfaces of buildings. The same areas of STC on building's rooftops are considered for both heating system scenarios. Additionally, a centrally located natural gas boiler is used, to cover peak loads of the district in the DHS scenario. For IHS, smaller gas boilers which are placed at building level are installed and sized to cover individual peak loads of buildings. In addition, TES are either installed at the district level for the DHS scenario or at the building level for IHS scenario. The relative storage volume and solar area play an important roles in solar-based heating systems [42]; the so called storage volume to solar collector area ratio (VAR = V TES A STC ) is therefore considered in the analysis. The optimal system performance requires a case by case analysis. The VAR is varied between 1 and 10 to evaluate the system level energy and economic performances and the environmental impact.

District Scenarios
As the performance of DHS is highly dependent on the type of district, its size and heat load density, additional district scenarios are considered where heat load density is varied in the district. Respective assumptions include a non-retrofitted and a retrofitted scenario of buildings. Additionally, the distances between buildings are varied, whereby the distances in the existing situation are enlarged by 5 and 10 times. This gives us six different district scenarios for DHS configurations, and two scenarios of the IHS configuration. Please note that the scenarios for the district size are only considered for the DHS configuration since the size of the district does not impact the results of individual heating systems. A summary of the case study scenarios is displayed in the Figure 4.

System Operation Strategies, Boundary Conditions and Energy Balance
Simulations were performed in hourly time steps for a whole year of operation. The supply (hot) and return (cold) temperature levels of the TES were aligned with the supply and return temperature levels of the thermal network. An empty tank was assumed as the initial state: SOC(t = 0) = 0. All further technical design parameters which were used for the DHN, GB, STC and TES are given in Table A1 in Appendix A.
It is assumed that for DHS scenarios, each building with solar thermal collectors covers first its own consumption, and only when there is surplus heat available is it fed into the thermal network. This is regarded as the "prosumer state". When available solar energy is lower than the heating load, the buildings withdraw heat from the thermal network, referred to as a "consumer state". Furthermore, it is assumed that buildings are controlled by a virtual central unit, which has full information about the status of each building during the consumer or prosumer state. When surplus heat from multiple buildings is sufficient to supply the entire district, which mostly happens in summer when heat load is low, surplus solar heat is fed into the thermal network and pumped to the central location where a centralized TES is charged. As for the control of the TES, it is assumed that the TES is fully discharged to cover the heating loads before the gas boiler is utilized. During summer, TES is charged from multiple distributed prosumers.
The thermal network is operated with a supply temperature T supply and a return temperature T return of 70 • C and 30 • C respectively. The supply temperature of every energy source (both centralized and distributed) us assumed to be the same. For buildings that are in the consumer state, the mass flow rate to withdraw from the network is calculated by Equation (16). A fixed temperature difference (∆T) is assumed for the primary side of the substation, whereQ net demand,i is the net energy demand covered by the network. In prosumer state, the mass flow rate fed to the network is calculated by Equation (17), where the surplus solar energy is represented as the output from the STC (Q STC out,i ) deducted by the heating loadQ load,i . To retain symbol consistency for the DHN model, here the mass flow rate is shown in a negative sign. A substation efficiency (η sub ) of 95% is taken into account.
For the DHS scenario, the energy balance is for all time steps {T 1 , T 2 } in a year is differentiated by whether heat is provided by a central technology such as the gas boiler or the TES (t ∈ T 1 ) or all prosumers are charging the central TES (t ∈ T 2 ), as shown below: For the IHS scenario, the heat load is primary covered by the different technologies in the following order: first by STC, as long as sufficiently available, then from the storage tank and then the gas boiler. The energy balance equation is expressed below:

Performance Indicators
Different indicators are used in the analysis for network operation performance (thermal loss and pumping energy) and the overall system level evaluation, which pertain to total equivalent annual costs, total green house gas emissions and solar fractions.

• Network thermal loss
Total network thermal losses are calculated for each pipe segment within the network over the year, which is defined by Equation (21).
• Pumping Energy The pressure drop along the pipeline (including supply, return and pressure drop at the substation) is represented by Equation (22). The pressure drop along the substation is assumed to be 0.5 bar. Resulting pressure drops along the supply pipeline ∆P sj are determined by the simulation at every hourly time step. As the flowrate is identical in the return pipeline, only with reverse flow direction is the pressure drop along the return pipeline ∆P rj the same as that of the supply pipeline.
For networks with distributed sources, controlling multiple pumps at decentralized locations can be very demanding. Usually, one central pump and multiple distributed pumps which are located at the distributed energy source side are installed. The calculation of pumping energy at each decentralized pump is assumed under ideal operating conditions, where multiple distributed pumps and valves at the consumers could coordinate perfectly. Pumps are assumed to have isentropic efficiency η s and motor efficiency η m . During hourly simulations, the pressure distribution within pipelines is computed, and then the pressure cone is mapped for the thermal network. For each distributed pump, pumping energy is calculated by Equation (23), where ∆P i is the pressure difference derived between supply and return lines at each source node i.
• Equivalent Annual Cost (EAC) Total system costs in the form of equivalent annual costs (EAC) are calculated based on Equation (24). EAC are defined as the net value of energy costs over the life time of an energy system, which are composed of annualized investment costs of key technologies and annual operational costs. Due to lacking the full scope of repair and maintenance data, EAC are neglected in our analysis at the moment. Investment costs include costs for GB, STC and TES for all system scenarios. Additional costs of the distribution networks (including pipes and pumps) are accounted for in the DHS scenarios. The annual operational costs include the fuel costs (natural gas consumption) and electricity consumption of the pumps in the DHS scenario.
AF tech is the annuity factor of a specific technology, where r is the local interest rate and n is the life time of the technology. All cost data for technologies used in the analysis are based on Swiss market prices and reflect the economy of scale. Detailed information is given in Table A2 in Appendix A. As the economic performance of different systems is highly sensitive to the costs of TES and networks, costs for TES and networks are varied in a sensitivity analysis. A variation of ±30% is applied for the network costs based on the reference data. To show the sensitivity of economy of scale for TES costs, a range of costs representing the specific costs per volume is created, and is represented in Figure A1 in Appendix A.

• GHG emissions
Annual CO 2 emission accounts for the operational emissions during the year, including fuel and electricity for pumps. Em = ∑ e f uel · c f uel + e electricity · c el (26) Emission factors of fuel and the electricity grid mix in Switzerland are given in Table A3 in Appendix A.
• Solar fraction (SF) Solar fraction (SF) is defined as the fraction of the annual heating load Q load covered by solar energy [43]. It is an important indicator to evaluate the capability of a solarbased energy system to utilize solar energy. It shows how much renewable energy is used compared to conventional fossil fuel based systems [39], as expressed in Equation (27): where Q aux is auxiliary energy provided by other sources than solar energy, which is in this case, natural gas used in the gas boiler. For the DHS scenario, only one SF for the district is evaluated. Likewise, for IHS scenario, the total load of the district and the total auxiliary energy consumed is aggregated to calculate a SF value.

Case Study
An artificial case study district that represents a typical Swiss urban district is used for this analysis. The motivation for using an artificial district is to give more flexibility in adjusting building energy demand profiles, district size, availability of energy resources and spatial constraints (e.g., building rooftop area).
The urban district is designed to be located in Zurich, Switzerland, and is composed of 24 buildings of multiple building types (residential buildings, office buildings and mixed use). Details of designing the urban district are described in Mavromatidis [38]. A map of the urban district illustrating corresponding building types and building ages is shown in Figure 5. A detailed summary of all building information is given in Table A4 in Appendix B. The information pertains to building type, conditioned floor area, construction age and available solar area (south and east-facing rooftop area). The total solar area is 2149 m 2 and total conditioned heating area is 23,779 m 2 . For the district without retrofitting, the total simulated annual heating demand (including both space heating and domestic hot water demand) is 2.42 GWh. For the district with full building retrofitting strategies applied, which include retrofitting of walls, windows, roof and floors, the total simulated heating demand is reduced to 1.24 GWh. The heating load duration curve for one year is shown in Figure 6. The peak heating load and load patterns are quite similar for both the current and the retrofitted cases.  Figure 7 shows the hourly heating demand for one typical winter week and one summer week for two representative building types (building R2: residential building and building M3: office building). Solar energy potential is plotted in green, which is based on fully covering a building's available roof area. Two important observations are shown in these figures. On the one hand, a very distinct seasonal mismatch between solar energy potentials and heating demand can be observed. During summer, domestic hot water demand is usually the only heating demand; however, at the same time solar potentials are the highest during this time of the year. On the other hand, comparing the load curve between two building types with very different usage behavior shows the potential for sharing surplus solar energy between different building types through the network. For the retrofitted case, heating loads are significantly reduced, which increases the surplus solar energy that can be stored or utilized by other buildings.  Figure 8 shows the results of the network layout design, whereby (a) shows the identified connection points of all buildings in ArcGIS and (b) shows the final design of the network layout. Red nodes represent connecting nodes from buildings to the network, black nodes represent mixer or diverter nodes and node 1 (in green) is the central location where central technologies such as TES and GB are installed. As a design criterion, total piping length is minimized while following the street layout.

District Heating Network Design and Operations
The design of the network layout is the same for all scenarios; only the total network length varies among the three different district sizes. The resulting network lengths are 438, 2190 and 4380 m respectively. The resulting linear heat load densities are 5.53, 1.10 and 0.55 MWh/km for the cases without building retrofitting, and 2.83, 0.57 and 0.28 MWh/km for cases with building retrofitting. Detailed pipe diameter designs corresponding to all scenarios are given in Table A5 in Appendix C. For the investment costs of the network, both the piping costs (including pipes and trench costs) and pump costs are taken into account. Total investment costs for the 6+six district Scenarios are shown in Figure 9.
It is shown that costs for pumps are relatively small, compared to the piping costs, amounting for less than 5% of the total network costs. The total network investment costs increase with the growth of district area-4.7 times and 9.3 times higher than district x 1, which are close, but not strictly proportional to the increases in size by 5 and 10 times. This is due to the fact that the detailed model considers pipe design per segment, and the cost are not linear for network length, but also account for the designed pipe diameter. Results show that for the scenarios with building retrofitting where total annual heating demand reduced by half, the network investment costs did not change significantly. This is due to the fact that building retrofitting does not significantly make an impact on the peak heating demand.    When evaluating the networks' energy performance, pumping energy was found to play a less significant role compared to the heat loss in the total energy consumption of the DHS scenarios. Depending on the size of the district, heat loss increased from less than 2% to around 12.3%. Additionally, pumping energy increased significantly from around 0.6% to 5.7%. Similarly to the network investment costs, energy consumption is not linearly proportional to the size increases of the district. For the scenarios with retrofitting, both heat loss and pumping energy were reduced compared to the non-retrofitted scenario. Additionally, the reduction was much more significant for larger districts.

Economic, Energy and Environmental Analyses of Scenarios
This section shows the results of the economic, energy and environmental analyses for the DHS and IHS scenarios. As mentioned earlier, the operational performance of a solar-based heating system is highly dependent on the TES capacity relative to the installed STC area. The volume of TES is varied as the solar area ratio (VAR) from 1 to 10 in the scenario analysis. Figure 11 displays a detailed breakdown of system investment costs for both heating system scenarios (DHS and IHS), which includes costs for the network (evaluated in the previous section), gas boiler (GB), solar thermal collectors (STC) and thermal storage tank (TES) for the 10 different VAR scenarios. The error bars in the figure illustrate the ranges between the lowest and highest costs. The results show that for all VAR scenarios, total investment costs for the IHS were higher than in DHS scenarios, even for the biggest district case scenario (DHS_10). This is mainly due to higher investment costs of smaller GB and TES, if they are installed at the individual building level, which overtakes the extra investment costs for the network in the DHS scenarios. As shown by the cost curve in Figure A1 in Appendix A, the cost of TES is strongly dependent on economy of scale. From the data which reflect the least impact from economy of scale (bottom curve in Figure A1) shown in the lower bar, it is observed that IHS is much more costly than DHS. For the retrofitted building results, the same observations apply in terms of investment costs, since peak demands, which are used for system sizing, do not vary significantly based on whether a building is retrofitted or not. It is worth mentioning that retrofitting costs for buildings were not included in this analysis, since the focus was on the system scenarios. Figure 12 shows the annual operational costs for the same set of scenarios. In the non-retrofitted scenarios, a decreasing trajectory of operational costs appeared with larger VARs until hitting a minimal point, and then it started rising again. This minimal point (highlighted with bold edges in Figure 12) occurred at different VAR values depending on the case. With increasing storage capacity for larger VARs, all surplus solar energy can be stored in the summer, until the turning point, whereat the capacity is bigger than it needs to be, which results in higher thermal losses compared to a properly sized, smaller storage tank. After that point, operational costs rise again and the additional storage volume remains unused, which demonstrates the trade-offs between increased investments in storage size and the potential to reduce operational costs. The same effect can be observed for retrofitted buildings-less pronounced, however.
For the original district size, operational costs of DHS were lower than for the IHS scenario for all VARs. This means that gains from the thermal networks, such as higher utilization rates of energy, surpass the additional distribution costs of the thermal network due to additional thermal losses and pumping energy for smaller districts. For bigger districts (district x5 and x10), the operational costs for DHS were higher than IHS if VAR was small (as shown in Figure 12). However, with a properly sized storage tank (VAR above 6), DHS_5 still outperformed IHS, whereas operational costs for DHS_10 remained higher for all VARs in the non-retrofitted scenario.
For the retrofitted case, operational costs decreased significantly (as shown in Figure 12 on the bottom), but the overall trend was similar. In this case, DHS scenarios can be attractive for district x10 if the storage tank is properly sized (starting from VAR 6).
To summarize, the operational costs of solar-based district heating network solutions with storage outperform individual solar-based heating system solutions in many cases, if the storage volume to solar area ratio is properly sized. Figure 13 shows the annual specific GHG emissions per heated area for all district and system scenarios for the different VARs. First of all, GHG emissions reduce almost half from the non-retrofitted to the retrofitted case. As a general trend, GHG emissions reduce with increased TES size for all system scenarios. However, similarly to operational costs, if the storage volume is oversized, emissions increase again (as highlighted in the graph with bold edges). For districts DHS_1 and DHS_5, DHS outperforms IHS for all storage volumes in terms of emissions. Only when comparing DHS_10 with IHS, does IHS have lower emissions for most VAR scenarios (VAR < 7). Furthermore, for the case with retrofitting, DHS performs better for almost all district sizes with VAR > 5. Only when a smaller storage volume is chosen, is IHS more advantageous compared to DHS_5 and DHS_10.
To summarize, GHG emissions of small scale retrofitted districts are typically lower for DHS than IHS cases. IHS only performs better if the storage tank is undersized, which means that available solar potential is not fully utilized. Figure 14 shows solar fractions for all district case and system scenarios for different VARs.
It was observed that the solar fraction increases significantly with TES volume, and stagnates after reaching its maximum (highlighted with bold edges), and then decreases gradually. For the non-retrofitted DHS scenarios, the maximum SF for district sizes x1, x5 and x10 were 49.8%, 45.0% and 40.0% respectively. The maximum SF for IHS was 35.2%. For the retrofitted scenario, the overall SF was much higher than in the non-retrofitted case, with a maximum above 63%. It is important to mention that the improved SF resulted in a lower heating demand and therefore in a higher surplus of solar energy; the district heating network contributed to a shift in diurnal mismatch between buildings. Among the different district sizes, it is clear that IHS only outperforms DHS for bigger districts (e.g., size x5 and x10) if the storage is significantly undersized (with VAR < 3).
Finally, for all scenarios the VARs with the lowest carbon emissions are selected. The solar fraction, equivalent annual cost and annual emissions respectively, among each system, are compared and shown in Figure 15. Hatched lines represent the results for retrofitting scenarios.  When comparing the carbon optimal solutions, it is clear that for all district case scenarios, whether with retrofitting or not, DHS outperforms IHS in terms of energy (SF), economic (costs) and environmental (emissions) performance indicators.
From an energy viewpoint, DHS resulted in higher solar fractions compared to IHS for all districts. However, a higher load density leads typically to better results than sparsely populated districts due to higher distribution losses in the network. This effect is even more pronounced for retrofitted buildings.
Economically, district heating solutions with central thermal storage and distributed solar thermal collectors benefit significantly from lower investment costs compared to IHS. Only in terms of operational costs do results differ depending on district size and retrofitting conditions. The operational costs of IHS are higher than those of DHS for high load density districts (district x1), but are generally lower than DHS for low density districts (x5 and x10). Similar observations apply to the retrofitted cases, with minor differences in absolute values.
From an environmental viewpoint, DHS also outperforms IHS. The benefits are much more significant for high-load-density districts than low-load-density districts. With retrofitting measures, the total emissions are significantly reduced by more than half compared to the non-retrofitted case.
To summarize, despite differences in performances among the different scenarios, DHS is typically a more attractive solution compared to IHS in regard to energy, economic and environmental performance if systems are properly sized. Even though this methodology can be applied to multiple district cases and system scenarios, the optimal solution in terms of economic or environmental performance is strongly dependent on input data, which require reliable data sources. Conclusions were drawn based on specific datasets for a typical Swiss district. However, the sensitivity analysis showed that even with varying costs for storage and the network, the conclusions are still valid. Moreover, the framework can be applied to districts in other countries, with different input data and climate conditions. A current limitation of this work lies in a single combination of technologies, including solar thermal collectors with a simple thermal storage tank model. For more robust system operation in real practice, other more sophisticated thermal storage models (e.g., stratified water tank model) could be investigated. In addition, the framework could be combined with non-linear optimization algorithms (e.g., genetic algorithms) for identifying the optimal selections of design and location for systems and technologies.

Conclusions
To evaluate the energy, economic and environmental performance of a prosumer-based district heating system with storage, typically a case by case analysis is required. In this paper, we demonstrateda modeling framework for such networks, which is flexible so that it can be applied to any district in Switzerland. In particular, a framework was developed to evaluate the energy, economic and environmental benefits and potential drawbacks of district heating systems compared to individual building heating systems. The model was applied to an artificial case study, which included rooftop mounted solar thermal collectors, gas boilers and thermal storage tanks. Different scenarios were investigated, including varying sizes and load densities (retrofitted buildings or the existing situation), which resembled different district characteristics with a heat load density ranging from 0.28 MWh/km (low rural density) to 5.23 MWh/km (high urban density).
Results highlighted that for the specific system configuration investigated in this paper, DHS typically outperforms IHS in terms of solar fraction, costs and GHG emissions, when a proper storage volume over solar area ratio is selected. However, varying the size of the district and different load densities significantly influence the overall performance of the district heating system. Thus, it requires a detailed design and operation model to analyze the performance of such a network and requires optimal sizing of the technologies involved. The results also showed that a proper design of thermal storage capacities played an important role in the overall system performance. By increasing the size of thermal storage tanks, solar fractions significantly improved until a turning point whereat the additional storage volume was not utilized anymore and solutions became uninteresting in terms of the investment costs. It is interesting to see that this turning point varies depending on the district, and the design of a district or individual heating system, which makes it difficult to define a "rule of thumb" for the optimal design of solar-based thermal storage systems.
Secondly, benefits of DHS over individual systems are greater for low-heat-loaddensity districts. For the lowest heat load density district having 0.25 MWh/km, which resembles a rural district's load density, DHS was still cheaper than IHS; however, the total emissions were almost the same. This implies that for low load densities in rural districts, district heating systems with solar prosumers may not be advantageous anymore from an environmental perspective.
Additionally, it was observed that surplus solar energy increases due to the retrofitting of buildings. As a result, thermal networks are an attractive solution to share the surpluses of energy between buildings. Funding: This research has been financially supported by CTI within the SCCER FEEB&D (CTI. 1155000149) and by SNF within the SNF project (Renewable powered district heating networks number 165978).

Institutional Review Board Statement:
We declare that this study did not involve humans or animals.

Informed Consent Statement:
We declare that this study did not involve humans or animals.

Data Availability Statement:
The data that support the findings of this study are available on request from the corresponding author D.W.

Acknowledgments:
The authors thank Robert Weber and Matthias Sulzer for their valuable knowledge input and Georgios Mavromatidis for kindly providing data for the case study and time for multiple discussions.

Conflicts of Interest:
The authors declare no conflict of interest.

Abbreviations
The following abbreviations are used in this manuscript: TES 114-1300 CHF/m 3 (based on TES volume) shown in Figure A1 [45] Pipe 5.36d ij + 139.15 CHF/m (linear extrapolation based on data from [46]) (In the sensitivity analysis, a variation of ±30% is applied)

Pump
Big central pump: 0.25 · (Cap 2 pump + 203.38Cap pump + 3390.10) · 1.36 [8] Small decentral pumps at prosumer: 295 CHF/pump Figure A1. TES cost per volume: The specific cost per volume for TES was extrapolated from [47,48]. The green area is for building level TES costs [48] and the blue area is for centralized TES costs [47].