Cost-Optimized Heat and Power Supply for Residential Buildings: The Cost-Reducing Effect of Forming Smart Energy Neighborhoods

: The Clean Energy for all Europeans Package by the EU aims, among other things, to enable collective self-consumption for various forms of energy. This step towards more prosumer-based and decentralized energy systems comes at a time when energy planning at a neighborhood scale is on the rise in many countries. It is widely assumed that—from a prosumer’s cost-perspective—shared conversion and storage technologies supplying more than a single building can be advantageous. However, it is not clear whether this is the case generally or only under certain conditions. By analyzing idealized building clusters at different degrees of urbanization (DOU), a linear-optimization approach is used to study the cost difference between shared energy infrastructure (smart energy neighborhoods, SENs) and individually planned buildings. This procedure is carried out for various emission reduction targets. The results show, that with higher emission reduction targets the advantage of SENs increases within rural environments and can reach up to 16%. Nevertheless, there are constellations in which the share of energetic infrastructure among buildings does not lead to any economic advantages. For example, in the case of building clusters with less than four buildings, almost no cost advantage is found. The result of this study underlines the importance of energy system planning within the process of urban planning.


Introduction
In May 2019, the Clean Energy for all Europeans Package [1] was passed. It is "the most comprehensive EU legislative package ever on energy and climate policy" [2] and it introduces, among other things, the concept of energy communities. It recognizes, "for the first time under EU law, the rights of citizens and communities to engage directly in the energy sector" [3] and it confirms that energy citizens have the right to generate, store, sell, and self-consume renewable energy. Further, they have the right to participate in energy communities [4]. It formally acknowledges and sets out legal frameworks for certain categories of community energy. Article 21 sets new ground rules for self-consumption, including collective self-consumption. Article 22 defines the concept of renewable energy communities, including the sharing of energy within an entity [5].
The new EU legislation comes at a time when energy communities such as smart energy neighborhoods (SENs) are on the rise in many countries. According to [6] there are about 3500 renewable energy cooperatives in Europe and this only counts a certain type of community energy initiative. The number is even higher when including eco-villages, small-scale heating organizations, and other projects led by citizen groups. Although, these concepts and initiatives seem to spread rapidly, "it is not clear how the scale or the density of the community should be determined to reduce its costs to a minimum" [6]. It is widely agreed that energy planning at a scale beyond the single-building "could provide several advantages, in terms of both energy management and the reduction of

•
Providing a comprehensive analysis on the circumstances under which SENs are advantageous compared to individually planned buildings.

•
The analysis should be detached from specific case studies and take into account key parameters like neighborhood scale, population density, and emissions reduction targets.

Conception and Experimental Setup
To achieve the objective stated in the introduction, the method of linear optimization is used and the total annual system costs are chosen as the comparative figure. A variety of neighborhoods are then analyzed using two different model configurations: In the first model configuration, the calculation nodes of the optimization model are not connected. This approach represents a considered area with individually planned buildings regarding their options of heat and electricity demand coverage. In the second model configuration, the interaction between the nodes is enabled. In this configuration, also the installation of technologies at a common calculation node is allowed. This model configuration represents an SEN where the buildings can share energy and where it is possible to have a common energy infrastructure. To get to the second model configuration, the model structure of the first configuration is expanded through a parent node. A scheme of the two different model configurations is shown in Figure 1. The parent node allows investments into technologies of bigger size (and therefore of lower specific costs) and the exchange of energy between the individual nodes. Heat can be exchanged via a thermal network (which comes along with additional costs) and electric energy can be exchanged through an internal electric grid (which also comes along with additional costs). Two demand time series (heat and electricity) are assigned to each calculation node. There is no energy demand at the parent node. Finally, the total annual system costs of the two model runs are compared and graphed for a variety of neighborhoods. The analyzed neighborhoods differ in size (number of buildings) and their degree of urbanization (i.e., population density).

Modelling Approach
The modeling approach chosen is the energy hub concept-a concept that has been extensively described in the literature [18]. It is widely used to model multi-energy systems at different spatial scales-often with the objective of minimizing total costs or carbon emissions. According to [19], most studies use mixed-integer linear programs (MILPs) but also bi-level formulations [20], machine learning formulations [21], and nonlinear formulations [22] can be found. Optimized variables can include installation and sizing of technologies and the dispatch schedules. The concept has been used extensively to identify optimal designs for buildings, districts, or urban energy systems. The interaction between multiple conversion and storage technologies is conveniently represented by a C-matrix. This matrix links a vector of energy inputs I to the energy outputs L.
The C-matrix contains the efficiency of conversion between all inputs and outputs, with zero terms if conversion is not possible. This representation is one strength of the concept, leading to high flexibility. The number of calculation nodes can be conveniently increased or decreased. Technologies and energy carriers can interlink in any possible way. This high flexibility is considered outstanding in the wide range of modeling approaches, making the concept ideal for the above research task. There are also tools available that can help in the writing of energy hub source codes, which makes the creation of models more convenient, for example [8,19]. Since a good foundation regarding technology options and costs is seen in the former mentioned, the modeling tool was adopted from this study. Another reason for choosing the approach of this study is that the modeling structure used there to analyze a case study already corresponds closely to the structure needed (Figure 1) for the above research objective.
The approach from [8] was further developed in the following way: Various procedures are implemented which allow to drastically reduce calculation time. The time-saving procedures used within the present study are the following:

•
Aggregation of multiple nodes to one node; • Time slices to reduce time steps within one year (for the calculations in the results section, 48 representative days are selected). These procedures allow performing about two hundred optimization runs per day. This high number of calculations makes it possible to analyze a broad spectrum of different neighborhoods. The measures to reduce calculation time-and the resulting error-will be described separately in a future study.

Objective Function and Constraints
One key constraint in energy hub formulations is the load balance constraint, which ensures that energy supply matches the demand at each time step. Other examples of important constraints are the capacity constraint, storage continuity constraint, area constraints, and carbon constraint. The latter is to limit the total allowable carbon emissions over a given time horizon. "Numerous additional constraints are included in different energy hub formulations, depending on the characteristics of the case, the purpose of the study, and the assumptions underlying the analysis" [19]. A comprehensive overview of additional formulations in energy hub concepts can be found in [23].
The mentioned load balance constraint for a specific energy carrier i can be stated as follows where L is the demand for the energy carrier i, X is the amount of energy exported from the system, P refers to the output of i by a conversion technology, and Q is input (Q i,in ) or output (Q i,out ) of storage technology. The aim of the present study is to minimize total annual costs C total as shown in Equation (3) C total = C capit. + C operat. + C maint.
with the capital costs C capit. , the operating costs C operat. and the maintenance costs C maint. . While the latter two are annual costs, the former is a one-time payment. To make them comparable, either the annual costs can be transformed to a net present value or the capital costs can be annualized. In the present study, the second option was chosen. To annualize the capital costs Equation (4) is used where NPV C capit. is the net present value of an investment and A is the annualizing factor (with the time horizon T and the interest factor i).

Considered Pathways and Technologies
A simplified overview of the technologies under consideration is shown in Figure 2. The scheme shows an exemplary SEN consisting out of two buildings with an enabled parent node. For a more detailed scheme-including the regarded energy carriers-the reader is referred to Appendix A.
It is assumed that there is always the possibility of investing in a grid connection (national electricity grid and/or long-distance heat) instead of buying technologies for local energy conversion. In the case of the electricity grid, a combination of grid consumption and local power generation is also possible. The prices, as well as the emission factors for grid consumption, are chosen based on the situation in Germany. It was also taken into account that prices and emissions factors may change over the time horizon of system planning. Taxes and other apportionments are not included. This approach leads to an electricity price of 13.2 ct/kWh and a long-distance heat's price of 7.2-10.6 ct/kWh (depending on the DOU). Table 1 provides an overview of the included technologies and their energy inputs and outputs (more cost and efficiency parameters are presented in Appendix A):

Variation of Neighborhood Structures
To obtain a broad variety of different building clusters, the neighborhood structure is defined according to its degree of urbanization (DOU). The DOU can be seen as a collection of different parameters that are typical for either rural or urban environments. This collection contains values such as the distance between buildings, the size of buildings, or the number of households within a building, to name a few. The range of DOU is defined from 1 to 10, with 1 being a rural and 10 being an urban environment. Table A5 in the Appendix A gives an overview of the most relevant parameters going along with the DOU and their respective values. Three relevant simplifications regarding the building clusters are worth mentioning:

•
The building clusters are homogenous, i.e., consist out of identical building types.

•
The buildings spread along one axis.

•
The spaces between the buildings are regular and occur repeatedly.
With these axioms, it is possible to derive important values, for example, the length of the heating network or the potential area for energetic use either through photovoltaic systems or solar thermal systems.

Heating Network
With the simplifications from Section 2.5., it is possible to derive the length of a heating network connecting the buildings in the regarded area. The length is calculated according to Equation (5) where n is the number of buildings within the neighborhood and a, b, c, and d are distance parameters as shown in Figure 3: Better thermal insulation of the building -Reduction of heat demand Wood chip boiler Wood chips Heat Local electricity grid Electricity Electricity Local heating network Heat Heat Connection to the national electricity grid -Electricity Connection to long-distance heat -Heat

Variation of Neighborhood Structures
To obtain a broad variety of different building clusters, the neighborhood structure is defined according to its degree of urbanization (DOU). The DOU can be seen as a collection of different parameters that are typical for either rural or urban environments. This collection contains values such as the distance between buildings, the size of buildings, or the number of households within a building, to name a few. The range of DOU is defined from 1 to 10, with 1 being a rural and 10 being an urban environment. Table A5 in the Appendix A gives an overview of the most relevant parameters going along with the DOU and their respective values. Three relevant simplifications regarding the building clusters are worth mentioning: • The building clusters are homogenous, i.e., consist out of identical building types.

•
The buildings spread along one axis.

•
The spaces between the buildings are regular and occur repeatedly.
With these axioms, it is possible to derive important values, for example, the length of the heating network or the potential area for energetic use either through photovoltaic systems or solar thermal systems.

Heating Network
With the simplifications from Section 2.5., it is possible to derive the length of a heating network connecting the buildings in the regarded area. The length is calculated according to Equation (5) where n is the number of buildings within the neighborhood and a, b, c, and d are distance parameters as shown in Figure 3:  The pipe diameter, network losses, and amount of electricity for pumping are endogenously calculated by the model in a pre-analysis step. In addition, the pre-analysis takes into account decreasing efficiency of the heating network with length. To give some exemplary numbers: the calculated efficiency range goes from 80% to 96% (depending on the DOU) for two connected buildings. In contrast to that, it goes from 72% to 92% (depending on the DOU) for 20 connected buildings.

Potentials of Renewables
It is assumed that 40% of the buildings' net ground area is available for energetic use (i.e., either photovoltaic or solar thermal systems). Therefore, the total available area A is calculated according to Equation (6).
As in [8] the availability of wood for heating purposes E SEN is restricted through a fixed ratio of individuals by Equation (7). Thus, the amount of energy available from wood depends on the inhabitant within the building cluster (I SEN ) compared to the total inhabitants of Germany (I Ger ). As starting point, the total available free potential of wood in Germany, E Ger according to [24], is taken and modified to E Ger according to Equation (A3) in Appendix A. The resulting potential is multiplied by the function f (details in Appendix A), which is used to stretch the maximum amount in rural areas and to reduce the maximum amount in urban areas.
The maximum amount of energy E wind that can be generated by small wind turbines is calculated according to Equation (8).The assumption is made that each building can host not more than one turbine and that there is a maximum diameter d rot that can be installed per turbine.

Implementation of Cost-Reducing and Cost-Increasing Effects within SENs
The assumption that SENs can lead to cost-reducing effects is often justified with the economies of scale (in this study, the term economies of scale is understood as specific technology costs that decrease with size) and due to the more efficient use of energy. In the present study, these effects are methodologically, firstly, considered by fixed and linear costs for each technology and, secondly, by aggregating load profiles, which leads to a profile smoothening that increases with the number of households. While the economy of scale and the smoothing of demand profiles imply the conclusion "the bigger the energy community, the lower the costs", certain counteracting problems set limitations to these cost-reducing effects: firstly, the losses of the heating network increase with the length of the network (see Section 2.6). Secondly, the assumptions in terms of idealized building clusters (see Section 2.5) are not infinitely scalable-while the assumption that 100% of the local actors are willing to be part of the heating network is reasonably valid in the case of two buildings, this assumption becomes rather unrealistic in case of an infinite number of buildings. In Germany, energy planners often calculate with a connection rate of 75% [25]. Each deviant leads to additional costs for the rest of the actors. To consider this problem, a function is implemented into the model, putting the additional costs of deviants C hn,dev on top of the original costs C hn,opt leading to the final costs of the heating network C hn .
C hn = C hn,opt + C hn,dev = C hn,opt + s deviant × c deviant (9) With c deviant being the specific deviants' costs and s deviant being the share of deviants, ranging from lim

Demand Profiles
Demand profiles are taken from one representative, exemplary household (electricity demand [26], heat demand [27]). The load profiles are duplicated many times, forming a pool of identical profiles. In the next step, a Gaussian distribution curve is applied to the pool giving a specific value from the Gaussian distribution to each one of the profiles. The value from the Gaussian distribution represents a time shift, giving an offset to the-apart from that offset-identical profiles. Finally, each household in the considered neighborhood stochastically picks a profile from the pool.

Results and Discussion
As described in Section 2.1, this study's goal is to compare the total annual system costs of two different model runs: the first configuration gives the total annual system costs of a building cluster consisting out of individually planned buildings in terms of their heat and power supply. The second configuration leads to the total annual system costs of the same buildings cluster-this time including the option of shared energy infrastructure and the option of energetic interaction.
The cost difference between these two model configurations can be interpreted as the cost advantage (CAS) of a smart energy neighborhood compared to individually planned buildings. Figure 4 shows the CAS as a function of the neighborhood size defined by the number of buildings (x-axis) and by the population density defined by the DOU (y-axis). The CAS is calculated at four different levels of emission reduction targets. At all four levels of emission reduction targets, a mixed picture becomes visible: in some cases, the energy community is advantageous (colored areas in the result figures). In other cases, there is no measurable advantage regarding total annual system costs (uncolored areas in the result figures). In other words, only in the case of a neighborhood that can be assigned to a colored area (by size and DOU), forming an energetically interconnected neighborhood leads to an (economic) advantage.
At all four levels of emission reduction targets, there is a maximum point where the CAS is highest. In the case of (a), where no emission reduction is implied, this center is at a DOU of 9. There is no advantage at DOUs < 5. This can be explained by a closer look at the optimization results: if no emission reduction is implied, a natural gas-fueled, commonly shared CHP plant can play an important role. The CHP plant comes along with electrical self-consumption rates of 60% and higher. Economic advantages can be achieved through this high self-consumption rate. While higher heat demands are in favor of a CHP unit, this technology is not part of the optimization results in the case of small neighborhoods with a low DOU.
When the emissions cap is set at 500 kg/a, the maximum CAS is seen at a DOU of 2. At the same time, the CAS within urban neighborhoods decreases. Latter can be explained by the disappearance of CHP plants within the optimization results. Because of the emissions cap, natural gas as fuel is no longer an option. At the same time, the annual system costs for individually planned buildings increase faster at low DOUs than at high DOUs. This leads to the increasing CAS at low DOUs. This effect increases when lowering the emissions cap to 400 kg/a and 300 kg/a. At 400 kg/a, the CAS remains rather low at high DOUs, whereas at 300 kg/a the CAS increases again. This is due to the appearance of biomethane-fueled CHP plants in the optimization results. This energy carrier is more expensive than natural gas but comes along with lower emissions. This entails an effect comparable to the situation without an emission cap. The maximum CAS at 400 kg/a is observed at a DOU of 1. Compared to 500 kg/a, the CAS is also higher. When lowering the emissions cap to 300 kg/a, the CAS increases again. The same can be observed in more urban structures. A second peak becomes visible at a DOU of 7.
The results show many dependencies regarding the CAS: it is influenced by the number of buildings as well as by the population density of the neighborhood. Another important factor is the emission reduction target: generally spoken, when there is a strict emission reduction target, SENs lead to a significant CAS within a rural environment.
Consequently, the maximum CAS of 16% is reached in the case of a rural settlement with 15 buildings and a high emissions reduction target of 300 kg/a. There is a remarkable consistency of these results with the findings in [6]. Although the authors use a different set of technologies as well as a different approach regarding their neighborhood settings, they similarly conclude: "under certain circumstances, community-level solutions are indeed superior to building-level solutions from a cost perspective". They also find that there are "circumstances when this is not so". Their study quantifies the extent of energy cost savings to 15%, which is in accordance with the present study. On top of that, they look for optimal settlement scales and find it at 7 to 14 buildings, which is also in remarkable accordance with the present research. On the other hand, the findings of [6] as well as of the present study are partly contradicting the results of [28]. The authors find within a case study that the total cost at the neighborhood level is always lower than at the building level, no matter how strict the emissions cap is set. This can be concluded from their result section, where the neighborhood level's Pareto curve is always left of the building level's Pareto curve. In contrast to that, the present study suggests that the CAS among others is dependent on the emissions cap.
To analyze the robustness of the above findings, the transmission costs are varied (see Appendix A for detailed information on the transmission costs). It is assumed that these costs are highly relevant in terms of the cost-reducing effect of SENs. Table 2 shows the four representatives of SENs that are taken from the results by looking for the maximum CAS at each level of emission reduction target: Table 2. Four representatives of the analyzed SENs are selected for a closer look at the sensitivity of the results. The transmission costs-according to Equations (A1) and (A2) in Appendix A-consist out of two components: firstly, the connection costs per building and secondly the routing costs. Since there is high uncertainty in the latter, this component is varied in Figure 5.  The slope of the straight lines can be interpreted as the share of total annual system costs that are allocated to the heating network and the electricity network, respectively. Looking at Figure 5 one can see from the slopes that heating network costs have a higher impact on the CAS than electricity grid costs (since the specific costs of the heating network are assumed to be higher than the specific electricity grid costs). Furthermore, it can be seen that the share of network costs is the highest in the case of (III) (shows the steepest slope among the four cases). In that case, an increase of heating network costs by 50% halves the CAS. The share of network costs is the lowest in the case of (I) (shows the lowest slope among the four cases). In that case, an increase of heating network costs by 100% halves the CAS.
In addition to the cost variation, a variation in terms of the heating network efficiency µ hn is made (see Figure 6). The efficiency of the heating network is varied to µ hn according to Equation (10) where ζ represents the x-axis in Figure 6. It can be seen from the figure, that the heating network efficiency has a significant impact on the CAS. There is a slight tendency for this effect to be greater in the negative direction than in the positive In addition to the uncertainty regarding some input parameters, certain conceptual limitations restrict the applicability of the study: The cost assumptions underlying the calculations presented are based on small to medium-sized systems. When analyzing spatially larger areas-such as cities or countries-other cost assumptions may be more appropriate. It should also be emphasized that the results of the study do not apply to every real-world settlement, as the DOU variation only considers certain configurations. Contextual conditions that lead to other energy concepts are conceivable. For example, there may be local energy potentials such as industrial waste heat, hot water sources, or energetic river water-energy sources that are not considered in this modeling approach. In addition, there may be energy consumers such as industrial machinery or cooling devices that are not part of the idealized neighborhoods in this study. All in all, the above study covers a wide range of different neighborhood types, but it is not a substitute for a comprehensive analysis when dealing with a specific, real-world settlement.

Conclusions
In this research, a linear-optimization approach is used to study the cost-effectiveness of forming smart energy neighborhoods (SENs) compared to individually planned buildings. For that purpose, idealized building clusters varying in size and degree of urbanization are analyzed. Numerous case studies in the literature suggest going beyond the building in energy planning. The meso level between building and city seems to become especially interesting in combination with renewable energy conversion and storage systems. This level is generally assumed to provide cost advantages for prosumers resulting from economies of scale and more efficient energy use. Until now, studies investigating these effects at the neighborhood level, detached from specific case studies, have been rare.
The present research tries to shift the analysis from a level of case studies to a more general approach. Thus, the study confirms: from a prosumer's economic perspective, SENs are indeed advantageous compared to the single-building level under certain circumstances. This benefit can reach up to 16% in a rural environment and with high emissions reduction targets. However, the study finds cases when SENs do not lead to any cost advantages compared to single-building planning. For example, in the case of clusters with less than four buildings, the forming of a common energetic infrastructure does not offer significant economic advantages. The results also indicate a complex interaction of different parameters. For example, the number of buildings within an SEN is as important as its degree of urbanization. Furthermore, environmental aspects such as emission reduction targets impact the extent of an SEN's economic advantage. Regarding the optimal scale of SENs, the highest CAS is shown in a range of 7 to 16 buildings, depending on how high the emission reduction target is set. To give a generic conclusion, it can be stated that with increasing emission reduction targets the financial advantage of SENs increases within rural conditions. In contrast to that, this correlation does not apply to more urban neighborhoods: without emission reduction targets, the CAS can reach up to 7%. When the emissions cap is lowered, the CAS initially falls before rising again. It reaches the initial value at an emissions cap of 300 kg/a.
The presented approach can support further research to gain a better understanding of SENs. Such research could include changes in the cost and efficiency assumptions that were made in this research as well as changes in the energy demand structure within the neighborhoods. This could lead to better insights into the benefits of SENs and the optimal way to generate and share energy locally. We hope that this study can contribute to this ongoing discussion and provide an impetus for future research.
Author Contributions: C.B. carried out the data collection and literature review, developed the methodology, and performed the data analysis with the optimization model; C.B. and L.E. contributed to writing the paper; L.E. reviewed and edited the manuscript; L.E., as the main supervisor, followed up all study steps and gave helpful advice. All authors discussed the results, and read and approved the manuscript. Both authors have read and agreed to the published version of the manuscript.
Funding: This research received no external funding.

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

SEN
Smart energy neighborhood DOU Degree of urbanization CAS Cost advantage of a smart energy neighborhood compared to individually planned buildings CHP Combined heat and power electricity grid: C hn,opt = C hn,rout + C hn,con = c hn,rout * l hn + c hn,con * n (A1) C gr = C gr,rout + C gr,con = c gr,rout * l hn + c gr,con * n (A2) C: Total cost c: specific cost l: routing distance n: number of buildings Indexes: hn = heating network; opt = optimal; rout = routing; con = connection; gr = electricity grad The potential of wood available for energetic use is calculated according to Equation (A3) (values of parameters: s = 0.26; t = 0.10; u = 0.30). As a starting point, the value of 697 PJ from [24] is taken. Considering that two-thirds of that potential is already in use and converted to the unit of Wh this leads to the value of 64 TWh (E Ger ). This value is reduced by a certain share s reserved for industrial purposes and by a certain share t reserved for transportation purposes. It is increased by a certain share u which can be imported. The resulting value E Ger is modified by Equation (A4) (values of parameters: A1 = 0.19643; A2 = 0.0012; A3 = 5.17348; A4 = 3.85704). This function is used to stretch the wood potential with the DOU. It is derived from the correlation between population density and the total share of national forest in Germany.