Design Optimization of Centralized–Decentralized Hybrid Solar Heating System Based on Building Clustering

: Clean heating has not been widely applied in rural Chinese areas. Considering the abundance of solar energy resources, harvesting solar energy for heating can be an effective solution to the problem of space heating in most rural areas. As the disperse building distribution in rural areas makes it difﬁcult to implement centralized heating on a large scale, deploying centralized– decentralized hybrid solar heating system can achieve the best result from both the technical and economic perspectives. Taking a virtual village in Tibet as an example, this paper explores how to obtain optimal design of centralized–decentralized hybrid solar heating system based on building clustering. The results show that: (1) Compared with the fully centralized system and fully decentralized system, the centralized–decentralized hybrid solar heating system in the studied case could achieve a life cycle cost (LCC) saving of 4.8% and 2.3%, respectively; (2) The LCC of centralized– decentralized hybrid solar heating system basically decreases when the cost of the heating pipelines in the whole region decreases, but the emergence of single-household solar heating system may greatly increase the operating cost; (3) The necessity of designing a centralized–decentralized hybrid solar heating system can be determined by the pipeline price and building density, but the threshold values of pipeline price and building density are highly case-speciﬁc.


Introduction
Buildings in rural areas of China are commonly dispersed in different locations, making it difficult to implement centralized heating.For this reason, no effective heating solution that can perfectly strike the balance between technical efficiency and economic efficiency [1,2] has been found for rural areas.Abundant solar energy and low population density in rural areas provide favorable conditions for the utilization of solar energy [3,4].However, for rural areas with a scattered building layout, choosing an appropriate solar heating mode is difficult.If a centralized solar energy system is used to provide heating for multiple households, heat loss during long-distance heat transmission will increase heating costs [5,6].If independent solar heating systems are used to provide heating for individual households [7][8][9], the overall energy efficiency of the heating systems cannot be improved [10,11] because it is impossible to fully utilize the complementing effect [12][13][14] between the heating loads of different buildings that are located relatively close to each other.Therefore, neither a fully centralized solar heating system nor a fully decentralized solar heating system is a good solution to space heating in dispersed rural areas; thus, there is an urgent need to raise a new design method for solar heating systems in scattered rural areas.
The energy loads of different types of buildings in an area can differ to varying extents.As the load pattern varies from building to building, demand profiles of several adjacent buildings can be aggregated over the same time horizon to level off the overall heating but each additional one has to traverse the data set, which greatly affects the efficiency of the algorithm.A fast clustering algorithm for DBSCAN was proposed in study [42], which reduces the number of region queries and thus the clustering time by selecting individual representative objects in the core object neighborhood as seed points for class expansion.Liu et al. [43] applied a new density-based spatial clustering algorithm, which is able to detect clusters of arbitrary shape and non-uniform density in the presence of noisy points in spatial objects.However, all of the above studies only performed density clustering for spatial locations but failed to consider the load differential characteristics between demand-side buildings.Wang [44] used a density-based clustering method that considered the complementary effects of spatial dimensions and different demand curves to improve the efficiency and accuracy of large urban energy-water linked system optimization.Marquant [45] considered the building distances along with the load demand of building users based on a density clustering algorithm and divided the urban-scale case into multiple zones to solve the multi-scale energy network planning problem.However, the above studies mostly target large-scale conventional energy systems in urban areas with relatively stable energy production system.Very few studies have examined solar heating systems, which are characterized by large fluctuations of power output.
In summary, although there has been some research focused on combining building clustering with energy system optimization [46,47] to improve the overall financial and technical performance [48], solar heating systems are rarely considered in which hydraulic and thermal characteristics are fully studied in the calculation of transmission loss.In this study, a new methodology is adopted to carry out an in-depth analysis of the impact of building clustering on the design and operation of solar heating systems.After the buildings with an area are clustered into multiple building groups, the designs of the solar heating systems for different building groups are optimized separately, and the optimal design of the centralized-decentralized hybrid solar heating system is obtained by comparing the system life cycle costs (LCCs) [49] under different clustering schemes.The results of this study provide theoretical support for the design of solar heating systems in areas with a dispersed building layout.The main contributions of this study are as follows:

•
An optimization framework is developed for centralized-decentralized hybrid solar heating systems based on building clustering.

•
A building clustering method is proposed by combining the DBSCAN with the Kruskal minimum spanning tree algorithm.

•
A sensitivity analysis is conducted to investigate the impacts of pipeline price and building spacing on the design of solar heating systems.
The remainder of this paper is organized as follows: the methodology is provided in Section 2, the results of the study are presented in Section 3, the discussion is presented in Section 4, and the conclusions of the study are given in Section 5.

Methodology
The flowchart of the combined optimization method proposed in this paper is shown in Figure 1.The process can be roughly divided into the following five steps: (1) Collecting data; (2) Building clustering based on density; (3) Generating pipeline network in each building group; (4) Optimizing the solar heating system design for each building group; (5) Determining optimal building clustering scheme and optimal system design.

From
Step (1) to Step (3), various categories of data are collected, the whole district is divided into several clusters by using the density-based building clustering technique, and the pipeline network is generated by using the Kruskal minimum spanning tree algorithm.In Step (4) the corresponding solar heating systems for all the building clusters are designed.Finally, by comparing the total system cost, the optimal building clustering scheme and optimal system design can be determined in Step (5).The technical details of the involved approaches are described in Figure 1.
Energies 2021, 14, x FOR PEER REVIEW 4 of 22 and the pipeline network is generated by using the Kruskal minimum spanning tree algorithm.In Step (4) the corresponding solar heating systems for all the building clusters are designed.Finally, by comparing the total system cost, the optimal building clustering scheme and optimal system design can be determined in Step (5).The technical details of the involved approaches are described in Figure 1.

Building Clustering
Among density-based building clustering methods, the DBSCAN algorithm is the most widely used because 1) there is no need to specify the number of building groups in advance, 2) building groups with arbitrary shapes can be discovered, 3) noise points can be identified, 4) outliers can be handled properly.Because the DBSCAN algorithm is sensitive to the initial parameter settings, we adjusted the neighborhood radius Eps and minimum number of samples M in p ts within a certain range to obtain different clustering schemes.
The execution steps of the DBSCAN algorithm are as follows: Input: Dataset D , neighborhood radius Eps , and minimum number of samples M in p ts .
Step 1: Randomly select an unprocessed object p from dataset D .If this object meets the requirement of minimum number of samples within its neighborhood radius Eps , it is called "core object".
Step 2: Traverse the entire dataset; find all the objects that are density reachable from object p (Ii an object set D , if there is a point chain 1 p , 2 p ,.., n p , i p D ∈ (1 i n ≤ ≤ ), and Step 3: Generate the final clustering result based on density connections (of there is an object o that makes both object p and object q density reachable from o , then object p and object q are deemed as density connected).
Step 4: Repeat steps 2 and 3 until all objects in the dataset are processed.

Building Clustering
Among density-based building clustering methods, the DBSCAN algorithm is the most widely used because (1) there is no need to specify the number of building groups in advance, (2) building groups with arbitrary shapes can be discovered, (3) noise points can be identified, (4) outliers can be handled properly.Because the DBSCAN algorithm is sensitive to the initial parameter settings, we adjusted the neighborhood radius Eps and minimum number of samples Minpts within a certain range to obtain different clustering schemes.
The execution steps of the DBSCAN algorithm are as follows: Input: Dataset D, neighborhood radius Eps, and minimum number of samples Minpts.
Step 1: Randomly select an unprocessed object p from dataset D. If this object meets the requirement of minimum number of samples within its neighborhood radius Eps, it is called "core object".
Step 2: Traverse the entire dataset; find all the objects that are density reachable from object p (Ii an object set D, if there is a point chain p 1 , p 2 , . . ., p n , p i ∈ D (1 ≤ i ≤ n), and p i+1 is directly density-reachable from p i , then point p n is deemed as density reachable from p 1 ) to form a new group.
Step 3: Generate the final clustering result based on density connections (of there is an object o that makes both object p and object q density reachable from o, then object p and object q are deemed as density connected).
Step 4: Repeat steps 2 and 3 until all objects in the dataset are processed.
It can be seen from the above steps that a density-based cluster is a group of densityconnected objects, and its purpose is to maximize density reachability.After clustering the buildings using the DBSCAN algorithm, we can analyze the distribution of sample points of each building group and set the core object point of each building group as the location to install the centralized solar heating system.

Generation of Pipeline Network in Each Building Group
After the buildings are clustered using the DBSCAN density-based clustering method, it is necessary to determine the pipeline network with minimum length in each building group.The conventional Delaunay triangulation method can generate a two-dimensional planning map of buildings in each group and reduce the pipeline connections between buildings far away from each other, but it cannot generate the pipeline network with minimum length.On the basis of triangulation-based planning, this paper further applies the Kruskal minimum spanning tree algorithm to generate pipeline network with minimum total length while ensuring that all buildings can be connected.
The minimum spanning tree algorithm assumes that in a given undirected graph G = (V, E), (u, v) represents the edge connecting vertex u and vertex v, and w(u, v) represents the weight of this edge.Suppose there exists a subset of E called T; if T is an acyclic graph and w(T) has the minimum value, then T is the minimum spanning tree of G.The minimum edge weight can be calculated using Equation (1): The Kruskal algorithm assumes that the initial state of the minimum spanning tree is a non-connected graph T = (V, {}) with only n vertexes and zero edge, and each vertex in the graph constitutes a connection component.The algorithm selects the minimum cost edge from E. If the vertices attached to the edge are on different connection components in T, the edge is added to T; otherwise, this edge is discarded and the next minimum cost edge is selected.This operation is repeated until all vertices in T end up forming a connection component.Therefore, Kruskal algorithm determines the shortest path connecting all vertices according to the distribution of edge connections in the graph.

Design Optimization of Solar Heating System in Each Building Group 2.3.1. System Structure and Components
After the building groups are determined, a centralized solar heating system for each building group can be constructed.The structure of the solar heating system in this study is shown in Figure 2. The system consists of solar collectors, a natural gas boiler (auxiliary heat source), a water tank, heating pipelines, and multiple heat users.
(1) Solar collector In solar heating systems, a flat plate collector is the most widely used collector type.The formulas [50] for calculating heat collection, inlet water temperature, and outlet water temperature of collectors are as follows: where Q SC (τ) represents the heat collection capacity of collector at the time τ, kJ; F R represents the dimensionless heat transfer factor of collector; A C represents the effective heat collecting area of collector, m 2 ; (τα) e represents the product of effective transmittance τ and absorptivity α; I C (τ) represents the solar radiation intensity, W/m 2 ; U L represents the total heat loss coefficient of collector, W/(m 2 • • C); T ci (τ) represents the inlet temperature of collector at the time τ, • C; and T α (τ) represents the ambient temperature at the time τ, • C. The constant 3.6 in Equation ( 2) is required to convert heat units.The unit of heat collection for solar collectors on the left side of the equation is kJ, while the unit of heat collection on the right side is W. Therefore, the right side is multiplied by 3.6 to unify the units.
where, c s represents the specific heat of thermal mass, kJ/(kg   (2) Water tank In this paper, the short-term water tank is chosen as the heat storage facility, and a single node model is developed.The mathematical expression of the temperature variation of the water in the water tank is as follows [51]: The formula for calculating heat loss of water tank is as follows: (2) Water tank In this paper, the short-term water tank is chosen as the heat storage facility, and a single node model is developed.The mathematical expression of the temperature variation of the water in the water tank is as follows [51]: where ρ w is the water density, kg/m 3 ; C w is the specific heat capacity of water at constant pressure, kJ/(kg• • C); V tan k represents the water tank volume, m 3 ; dτ is the temperature change in the water tank per unit time; Q gb (τ) represents the heat output from gas boiler at the time τ, kJ; Q tan kloss (τ) represents the heat lost to the ambient environment from the water tank at the time τ, kJ; Q pipeloss (τ) is the amount of heat loss from the transmission of the pipe network at the time τ, kJ; Q h (τ) represents the heating demand of the building group at the time τ, kJ.
The formula for calculating heat loss of water tank is as follows: where U tan k represents the heat loss coefficient of water tank, W/(m 3 • • C).
(3) Auxiliary heat source In this paper, the natural gas water boiler is used as the auxiliary heat source in the solar heating system, and its heat output can be calculated using Equation ( 6), Q gb (τ) = 3600η gb η load P gb (6) where η load represents the operating load rate of gas boiler, %; η gb represents the heating efficiency (85%) of gas boiler, %; P gb represents the rated power of gas boiler, kW.
(4) Heat loss during transmission When each clustering scheme is determined, the amount of heat loss Q pipeloss (τ) during transmission to each heat consumer at the time τ can be calculated as follows: where • m p (τ) represents the water flow of primary network at the time τ, m 3 /h; T su (τ) represents the temperature of the water supply out of the tank, • C; T re (τ) represents the final return water temperature of the primary network, • C; T su,n , T re,n represents the primary network inlet and outlet water temperature at user n, • C; T n represents the secondary network inlet water temperature at user n, • C; λ k represents the heat transfer coefficient of the pipe at pipe k, W/(m 2 • • C); L k represents the length of pipe k, m; ε represents the heat transfer efficiency of the heat exchanger at user n, %; • m n represents the water supply flow of primary network at user n, m 3 /h; • m k represents the water supply flow in pipe k, m 3 /h; T in , T out represents the inlet and outlet water temperature of the pipe, • C; and Q h,n represents the heating demand of the building group at user n, kJ.

System Control Strategy
The starting and stopping of the solar collector and auxiliary heat source are affected by the temperature of tank.The control strategy of the solar heating system is shown in Figure 3.The upper limit value of the water tank heating temperature is 85 • C. When the difference between the outlet temperature of the solar collector (T co ) and the water tank temperature (T S ) is larger than or equal to 8 • C and the water temperature of the heat storage tank is less than 85 • C, the circulating water pump at the collector end is turned on; otherwise it is turned off.When the water temperature of the heat storage tank is less than 50 • C, the auxiliary heat source is turned on; otherwise it is turned off.In Figure 3, S represents the start-stop control switch for each device, S co represents the start-stop control switch for the solar collector, and S gb represents the start-stop control switch for the auxiliary heat-source gas boiler.When the device start-stop factor S is equal to 0, the device is off; when S is equal to 1, the device is on.

Objective Function
For each building group, the optimization objective is to minimize the LCC of the centralized solar heating system in that building group.The objective function is where C in represents the total initial investment of all equipment in the system (including the cost of pipe network construction), CNY; C om represents the operation cost of system equipment within the service life, CNY; C rc represents the residual value of system equipment, CNY.The initial investment of the system can be expressed as: where C gb represents the equipment cost per input power of gas-fired boiler, CNY/kW; C co represents the unit price of solar collector, CNY/m 2 ; C tan k represents the equipment cost of unit volume of water tank, CNY/m 3 ; C pipe represents the unit price of pipe network, CNY/m; L pipe represents the total length of pipe network, m; C an represents the cost of accessories, including piping accessories such as water pumps, valves, etc., CNY.
Energies 2021, 14, x FOR PEER REVIEW auxiliary heat-source gas boiler.When the device start-stop factor S is equal to 0 vice is off; when S is equal to 1, the device is on.

Objective Function
For each building group, the optimization objective is to minimize the LC centralized solar heating system in that building group.The objective function is min min( ) where in C represents the total initial investment of all equipment in the system ing the cost of pipe network construction), CNY; om C represents the operatio system equipment within the service life, CNY; rc C represents the residual valu tem equipment, CNY.The initial investment of the system can be expressed as: The annual operating and maintenance (O&M) cost of the heating system the fuel consumption cost incurred by the equipment operation and the related t tation cost.In this study, the O&M cost largely consists of the cost of natural gas co by the heating equipment.Therefore, the operation cost of the system equipmen the operation period is The annual operating and maintenance (O&M) cost of the heating system refers to the fuel consumption cost incurred by the equipment operation and the related transportation cost.In this study, the O&M cost largely consists of the cost of natural gas consumed by the heating equipment.Therefore, the operation cost of the system equipment during the operation period is where C uhgb represents the unit heat price of the gas-fired boiler, CNY/kJ; Q hgb represents the annual heat output of gas boiler, kJ; C E represents the unit electricity price, CNY/kWh; L pump represents the cumulative power consumption of the pump in a year, kWh; ζ represents the ratio of equipment maintenance cost to equipment purchase cost, which is set to 2%.The unit heat price of the gas-fired boiler can be calculated as where C gas represents the unit price of the gas, CNY/m 3 , and Cal gas represents the calorific value of natural gas, kJ/m 3 .The residual value of system equipment is calculated using Equation ( 16): where C rc represents net residual value of fixed assets (portion of the residual value of a fixed asset at the end of its useful life, less any fixed asset liquidation costs payable), CNY, and r represents the ratio of the net residual value of fixed assets to the original value of fixed assets (varies in the range of 3-5% [52], set to 4% in this paper).The capital payback factor is calculated as follows: where i is the annual interest rate, set to 8%, and y is the service life of the system, set to 15 years [53].

Constraints (1) Equality constraints
For each building group, the hourly heating supply of the solar heating system should always be equal to the hourly heating demand of all users in the building group.The mathematical expression of the equality constraint is where Q tan k (τ) represents the amount of heat stored by the water tank at the time τ, kJ.
(2) Inequality constraints The system inequality constraints are expressed as follows.
where A co represents the total area of all solar collectors, m 2 ; V sx represents the volume of water tank, m 3 ; and Q hmax represents the maximum heating demand of building group, in this case the maximum hourly heating load is set as 6.55 kW.The maximum area limit for solar flat plate collectors is taken from a simulated typical building, whose roof area is 65.88 m 2 .The related parameter settings are shown in Table 1.At the beginning, the water temperature in the water tank is set to 50 • C, and the temperature of the working medium in the collector is set to 10 • C.
The model is solved using the genetic algorithm in the Matlab environment, with the time step set to one hour and the whole heating season (1 November to 31 March) set as the calculation cycle.The optimization variables include the total area of solar collectors (A co ), volume of water tank (V tan k ), and rated power of gas-fired boiler (P gb ).The related calculation parameter settings are shown in Table 2.
The population initialization number of genetic-algorithm-related studies is generally set within 50 to 200 in the relevant literature [56,57].Each individual in the initialized population corresponds to the capacity of a device in an optimized configuration scheme.Within the reasonable range, the population initialization number is set to 150 in this study, and the number of iterations is set to 20.

Calculation Parameters Value
System service life y/year 15 F R (τα) e [50]  0.7843 Total heat loss coefficient [50] 5.5024 Unit price of collector area [53] C CO /(CNY/m 2 ) 800 Unit price of water tank volume [53] C tan k /(CNY/m 3 ) 500 Unit power price of gas-fired boiler [54] C gb /(CNY/kW) 200 Heat loss coefficient of water tank [50] U tan k /(W/(m 3 After multiple clustering schemes are obtained through density-based cluster analysis, we can optimize the design of solar heating system for each building group in each scheme and calculate the LCC of the solar heating system of each building group.Thus, the total LCC of the solar heating systems in each building clustering scheme can be obtained by adding up the LCCs of the solar heating systems of all building groups in that building clustering scheme.The scheme with the lowest total LCC is the optimal building clustering scheme, and the corresponding system design is the optimal design of the centralized-decentralized hybrid solar heating system [58].The principle is shown in the following equation.

Case Analysis
Taking a virtual village in Tibet as an example, this paper selects a typical building to simulate different heating load on a typical day (17 January) for analysis.The typical building has two floors, with a total building area of 131.76 m 2 .In rural areas, there are various type of buildings with different functions, including office buildings such as village committees and some scattered offices.As some rural residents work at office buildings in the daytime and rest in residential buildings at nighttime, the heating demands of office buildings and residential buildings are totally different.Thus, the office building, together with other two types of residential buildings, are assumed to be the three typical buildings in this study.Three major building heating load types are generated via TRNSYS simulation: residential building heating load (type 1) with people staying in the rooms all day (stay time: 00:00-24:00), residential building heating load (type 2) with people out during the day (stay time: 18:00 current day-08:00 next day), and office building heating load (type 3) with people working in the rooms during work hours (stay time: 08:00-18:00).Tables 3-5 show the specific differences of the three types.
The envelope parameters for a typical building are set [59] as shown in Table 6.The ventilation rate for heating is set to 0.5 times/h [59], the cold air permeability coefficient is set to 0.2 times/h [59], and only the bedrooms and living rooms are heated (the staircase is not heated).The target indoor temperature is set to 15 • C [60], which can basically meet the needs of people's daily work and living.The lighting power density is set to 6 W/m 2 , the equipment power density is set to 3.8 W/m 2 , and it is assumed that there are two persons in one bedroom and three persons in a living room.The windows are double-layer insulating glass, and the heat transfer coefficient is 2.88 W/(m 2 •K).The three types of heating loads on the typical day are shown in Figure 4.The envelope parameters for a typical building are set [59] as shown in Table 6.The ventilation rate for heating is set to 0.5 times/h [59], the cold air permeability coefficient is set to 0.2 times/h [59], and only the bedrooms and living rooms are heated (the staircase is not heated).The target indoor temperature is set to 15 °C [60], which can basically meet the needs of people's daily work and living.The lighting power density is set to 6 W/m 2 , the equipment power density is set to 3.8 W/m 2 , and it is assumed that there are two persons in one bedroom and three persons in a living room.The windows are double-layer insulating glass, and the heat transfer coefficient is 2.88 W/(m 2 •K).The three types of heating loads on the typical day are shown in Figure 4.  Taking the building spatial layout of a virtual village in Tibet as an example, we assigned the above three types of heating loads randomly to the 18 buildings (assumed to be identical) in the village (Figure 5).The district heating radius for this virtual village is 86.24 m.Each point in Figure 5 represents a building, and different shapes represent different load types.The buildings were then clustered using the DBSCAN density-based clustering method, during which equal-distance adjustments were made within the neighborhood radius range (22-34 m) and the minimum sample number range (1-7).Totally six different building clustering schemes were obtained and are shown in Figure 6.Different clustering schemes were named A, B,…, F in the ascending order of the number Taking the building spatial layout of a virtual village in Tibet as an example, we assigned the above three types of heating loads randomly to the 18 buildings (assumed to be identical) in the village (Figure 5).The district heating radius for this virtual village is 86.24 m.Each point in Figure 5 represents a building, and different shapes represent different load types.The buildings were then clustered using the DBSCAN density-based clustering method, during which equal-distance adjustments were made within the neighborhood radius range (22-34 m) and the minimum sample number range (1-7).Totally six different building clustering schemes were obtained and are shown in Figure 6.Different clustering schemes were named A, B, . . ., F in the ascending order of the number of building groups.Different clusters are distinguished by different colors.For example, there are in total three clusters in scheme B, so the three clusters are marked with three different colors.The hollow dots indicate that the single building constitutes a building group, and its heating demand is satisfied by the single-household solar heating system.

Optimization Results
The design optimization of the centralized-decentralized hybrid solar heating system was carried out under 6 building clustering schemes, and the results are shown in Figure 7.As can be seen from Table 7 and Figure 7, with the increase of the number of building groups (i.e., clustering scheme changes from A to F), the total collector area, total tank volume, and gas-fired boiler capacity of the centralized-decentralized hybrid solar heating system show a gradual increasing trend, while the length of the heating pipes show a continuous decreasing trend.When the clustering scheme changes from A to F, more and more buildings start to be heated by single-household solar heating systems, resulting in an increase in the capacity of heat-generating equipment, but the surplus ca-

Optimization Results
The design optimization of the centralized-decentralized hybrid solar heating system was carried out under 6 building clustering schemes, and the results are shown in Figure 7.As can be seen from Table 7 and Figure 7, with the increase of the number of building groups (i.e., clustering scheme changes from A to F), the total collector area, total tank volume, and gas-fired boiler capacity of the centralized-decentralized hybrid solar heating system show a gradual increasing trend, while the length of the heating pipes show a continuous decreasing trend.When the clustering scheme changes from A to F, more and more buildings start to be heated by single-household solar heating systems, resulting in an increase in the capacity of heat-generating equipment, but the surplus capacity takes a large proportion because the complementing effect between the heating loads of different buildings is not fully utilized.When the number of building groups increases, the building spacing in each building group decreases, so the length of heating pipeline decreases correspondingly.Figure 8 shows the system LCC and its breakdown under different building clustering schemes.It can be seen from Figure 8 that the system LCC decreases first, increases suddenly, and then decreases with the increase in the number of building groups.Under scheme B (the number of building groups is 3), the LCC of the centralized-decentralized hybrid solar heating system is the lowest (171,200 CNY).The design of a district solar heating system based on building clustering is carried out after taking full advantage of the complementary characteristics of heating load between adjacent buildings.Compared with the fully centralized system and fully decentralized system, the centralized-decentralized hybrid solar heating system in the studied case could achieve a life cycle cost (LCC) saving of 4.8% and 2.3%, respectively.

Optimization Results
The design optimization of the centralized-decentralized hybrid solar heating system was carried out under 6 building clustering schemes, and the results are shown in Figure 7.As can be seen from Table 7 and Figure 7, with the increase of the number of building groups (i.e., clustering scheme changes from A to F), the total collector area, total tank volume, and gas-fired boiler capacity of the centralized-decentralized hybrid solar heating system show a gradual increasing trend, while the length of the heating pipes show a continuous decreasing trend.When the clustering scheme changes from A to F, more and more buildings start to be heated by single-household solar heating systems, resulting in an increase in the capacity of heat-generating equipment, but the surplus capacity takes a large proportion because the complementing effect between the heating loads of different buildings is not fully utilized.When the number of building groups increases, the building spacing in each building group decreases, so the length of heating pipeline decreases correspondingly.Figure 8 shows the system LCC and its breakdown under different building clustering schemes.It can be seen from Figure 8 that the system LCC decreases first, increases suddenly, and then decreases with the increase in the number of building groups.Under scheme B (the number of building groups is 3), the LCC of the centralized-decentralized hybrid solar heating system is the lowest (171,200CNY).The design of a district solar heating system based on building clustering is carried out after taking full advantage of the complementary characteristics of heating load between adjacent buildings.Compared with the fully centralized system and fully decentralized system, the centralized-decentralized hybrid solar heating system in the studied case could achieve a life cycle cost (LCC) saving of 4.8% and 2.3%, respectively.
The above variation patterns can be explained as follows: (1) When the clustering The above variation patterns can be explained as follows: (1) When the clustering scheme changes from A to B, the number of building groups increases from 1 to 3, the scale of building groups and the total length of the heating pipelines decrease, so the pipeline cost and heat transmission loss decrease.(2) When the clustering scheme changes from B to C, the number of building groups increases from 3 to 6 and single-household heating systems begin to appear.As each system is only used to meet the heating demand of a single household, the single-household heating systems will increase the surplus capacity of the system, resulting in a greater increase in the cost of heat-generating equipment and operating costs than the reduction in pipework costs.(3) When the clustering scheme changes from C to F, more and more buildings are heated by single-household heating systems, resulting in an increase in the surplus capacity of heat-generating equipment.However, the pipeline cost decreases more.Therefore, with the increase in the number of building groups, the total system LCC has been basically reduced in sync with the pipeline cost.Compared with single-household solar heating, centralized-decentralized hybrid solar heating based on building clustering can effectively reduce the capacity of other equipment in the system except the heating pipeline, but this will also increase the length of the heating pipeline.Therefore, whether building clustering can reduce the LCC of the heating system in the whole region highly depends on the heating network, which is characterized by the pipeline price and building spacing.Thus, it is necessary to conduct sensitivity analysis from the perspectives of both pipeline price and building spacing.
Energies 2021, 14, x FOR PEER REVIEW 15 of 2 length of the heating pipeline.Therefore, whether building clustering can reduce the LCC of the heating system in the whole region highly depends on the heating network, whic is characterized by the pipeline price and building spacing.Thus, it is necessary to conduc sensitivity analysis from the perspectives of both pipeline price and building spacing.

Discussion
In order to gain insights into how the clustering schemes can be appropriately made sensitivity analysis was carried out as a theoretical analysis of several virtual cases to iden tify potential patterns in the clustering results related to pipeline price and building spac ing.According to the above analysis, the price of heating pipeline will significantly affec the selection of the building clustering scheme, which in turn will affect the design of th solar heating system.In order to investigate the influence of the pipeline price on the de sign of solar heating system, we compared the system LCC of a typical solar heating sys tem under different pipeline prices (100CNY/m, 150CNY/m, 200CNY/m, 250CNY/m, and 300CNY/m) with different building clustering schemes.The results are shown in Figur 9.
In Figure 9, the vertical axis represents the total LCC of the solar heating systems i the cluster, and the horizontal axis represents different clustering schemes from A to F Different colors represent the LCC under different pipeline prices.The price of the heatin pipeline has a significant impact on the selection of optimal building clustering scheme Under the clustering scheme F, each building represents a building cluster that has it

Discussion
In order to gain insights into how the clustering schemes can be appropriately made, sensitivity analysis was carried out as a theoretical analysis of several virtual cases to identify potential patterns in the clustering results related to pipeline price and building spacing.According to the above analysis, the price of heating pipeline will significantly affect the selection of the building clustering scheme, which in turn will affect the design of the solar heating system.In order to investigate the influence of the pipeline price on the design of solar heating system, we compared the system LCC of a typical solar heating system under different pipeline prices (100 CNY/m, 150 CNY/m, 200 CNY/m, 250 CNY/m, and 300 CNY/m) with different building clustering schemes.The results are shown in Figure 9.
building clustering scheme is A. When the pipeline price is close to 200CNY/m, the optimal system design becomes hard to predict.Because all factors, including climate, building layout, and building load in a region may all impact the design results, the determination of price threshold is highly related to the specific case.Thus, it is necessary to conduct research based on the local conditions in order to determine the optimal building clustering scheme and heating system design.In order to appropriately represent the impact of building spacing on the design result, we assumed that heating radius of the village expands from 21.56 m to 344.96 m, and the building spacing increases proportionally [61].In order to quantitatively assess the aggregation level of each cluster, a density index [44] is introduced in this study.The density index is calculated by the following equation: = MST L N DENSITY (24) where N is the number of buildings in one cluster and MST L is the total length of heating pipeline used for transmitting heating to these buildings in the same cluster, m.The building density of the target area is 22.30.
The system LCCs under different building spacings with different building density schemes are shown in Figure 10.In Figure 9, the vertical axis represents the total LCC of the solar heating systems in the cluster, and the horizontal axis represents different clustering schemes from A to F. Different colors represent the LCC under different pipeline prices.The price of the heating pipeline has a significant impact on the selection of optimal building clustering scheme.Under the clustering scheme F, each building represents a building cluster that has its own solar heating system.As there is no heat transmission between different buildings, there is no need to build heating pipelines.Thus, the system LCC remains unchanged, which is zero, when the heating pipeline price changes.When the clustering scheme changes from A to F under the pipeline price of 200 CNY/m, the total cost of heating system decreases first, increases afterwards, and decreases again.However, the range of variation is not significant, so this price can be used as the price threshold to judge whether the local area is suitable for deploying a centralized-decentralized hybrid solar heating system or not.When the pipeline price is much higher than 200 CNY/m, the optimal building clustering scheme is F. When the pipeline price is much lower than 200 CNY/m, the optimal building clustering scheme is A. When the pipeline price is close to 200 CNY/m, the optimal system design becomes hard to predict.Because all factors, including climate, building layout, and building load in a region may all impact the design results, the determination of price threshold is highly related to the specific case.Thus, it is necessary to conduct research based on the local conditions in order to determine the optimal building clustering scheme and heating system design.
In order to appropriately represent the impact of building spacing on the design result, we assumed that heating radius of the village expands from 21.56 m to 344.96 m, and the building spacing increases proportionally [61].In order to quantitatively assess the aggregation level of each cluster, a density index [44] is introduced in this study.The density index is calculated by the following equation: where N is the number of buildings in one cluster and L MST is the total length of heating pipeline used for transmitting heating to these buildings in the same cluster, m.The building density of the target area is 22.30.
The system LCCs under different building spacings with different building density schemes are shown in Figure 10.As can be seen from Figure 10, the building density also has a significant impact on the selection of an optimal building clustering scheme.Similar to the analysis about the impact of pipeline price on the system design, there also exists a threshold that can be used to judge whether the centralized-decentralized hybrid solar heating system is necessary.For the specific case in this study, the density of 22.30 can be regarded as the threshold, because there is no obvious fluctuation in the system LCC when building clustering scheme changes.When the building density is less than 22.30, a centralized-decentralized hybrid solar heating system is favorable.When the building density is more than 22.30, fully decentralized solar heating system is favorable.Overall, the above results indicate that centralized-decentralized hybrid solar heating system could achieve the ideal cost-saving effect only when the pipeline price and building density fall into a certain range.Otherwise, either fully centralized heating or fully decentralized heating is the optimal system design.
It is clear from the optimization results that the design of energy systems in rural areas needs to take full account of local energy conditions and tailor energy policies to local conditions.For energy companies, various service packages should be introduced to meet the needs of different rural residents.For the government, a well-directed and preferential subsidy policy [62] should be developed to encourage and stimulate rural residents to participate in renewable energy utilization projects.However, the actual conditions of the target area should be fully considered, e.g., the building layout, energy demands, and natural resources.Moreover, differences in household assets, demographic characteristics, and other livelihood capital may lead to different energy consumption behaviors [63].Therefore, there is a need to select appropriate technology pathways and support policies to accelerate the diffusion of renewable energy in rural areas.As can be seen from Figure 10, the building density also has a significant impact on the selection of an optimal building clustering scheme.Similar to the analysis about the impact of pipeline price on the system design, there also exists a threshold that can be used to judge whether the centralized-decentralized hybrid solar heating system is necessary.For the specific case in this study, the density of 22.30 can be regarded as the threshold, because there is no obvious fluctuation in the system LCC when building clustering scheme changes.When the building density is less than 22.30, a centralized-decentralized hybrid solar heating system is favorable.When the building density is more than 22.30, fully decentralized solar heating system is favorable.Overall, the above results indicate that centralized-decentralized hybrid solar heating system could achieve the ideal cost-saving effect only when the pipeline price and building density fall into a certain range.Otherwise, either fully centralized heating or fully decentralized heating is the optimal system design.
It is clear from the optimization results that the design of energy systems in rural areas needs to take full account of local energy conditions and tailor energy policies to local conditions.For energy companies, various service packages should be introduced to meet the needs of different rural residents.For the government, a well-directed and preferential subsidy policy [62] should be developed to encourage and stimulate rural residents to participate in renewable energy utilization projects.However, the actual conditions of the target area should be fully considered, e.g., the building layout, energy demands, and natural resources.Moreover, differences in household assets, demographic characteristics, and other livelihood capital may lead to different energy consumption behaviors [63].Therefore, there is a need to select appropriate technology pathways and support policies to accelerate the diffusion of renewable energy in rural areas.

Conclusions
This paper presents a building clustering method combining DBSCAN density clustering and Kruskal algorithm, taking into account the complementary characteristics of thermal loads between buildings, and proposes an optimization model of a centralizeddecentralized hybrid solar heating system that is capable of providing the optimal design of solar heating system for each cluster scheme.The following conclusions can be drawn through calculation and analysis: (1) As the number of building groups increases, the total pipe length of a centralizeddecentralized hybrid solar heating system gradually decreases, while the total collector area, total tank volume, and gas-fired boiler capacity all show a gradual increasing trend.Compared with the fully centralized design and fully decentralized design, the centralized-decentralized hybrid solar heating system in the studied case could achieve an LCC saving of 4.8% and 2.3%, respectively.In the case of relatively dispersed building layouts, a centralized-decentralized hybrid solar heating systems for rural areas is a more suitable option.(2) The economic cost of centralized-decentralized hybrid solar heating systems basically varies in sync with the cost of the heating pipeline in the system, but the emergence of single-household solar heating systems may greatly increase the operating cost.Whether building clustering can reduce the economic cost of the heating system in the whole region highly depends on the heating network, which is largely decided by the pipeline price and building spacing.(3) Finding the threshold of pipeline price and building density can simplify the procedure to determine the necessity of designing a centralized-decentralized hybrid solar heating system.However, the determination of the threshold values is highly case-specific.In this study, thresholds for pipe prices and building density were found between the upper and lower limits, and using the proposed method, it is possible to design an energy system solution that suits the local building layout.
This study develops a framework to optimally design the district centralizeddecentralized hybrid solar heating system based on building clustering, the impact of some important factors (e.g., device prices and building spacing) on the design results are analyzed by conducting sensitivity analysis, and the threshold values of these factors deciding the system configurations are given.In fact, the co-utilization of the same solar heating system will lead to the cost allocation problem in real engineering, which is not considered in this study.Moreover, the social relationship between energy users in different buildings may also significantly impact the heating system design, as some building owners may be reluctant to share the same heating system.In the following study, the social relationship between the owners of the buildings and the cost allocation issue will be fully considered, so as to expand this study.

c
represents the specific heat of thermal mass, kJ/(kg•°C), and sc m represents the circulation mass flow of collector, kg/h.co T represents the outlet temperature of collec- tor; °C.Equation (2) calculates the amount of heat collected by the solar collector, which is used as a known value in Equation (3) to calculate the outlet water temperature of the collector.

Figure 2 .
Figure 2. Schematic diagram of the centralized solar heating system in each building group.

) where wρτ
is the water density, kg/m 3 ; w C is the specific heat capacity of water at con- stant pressure, kJ/(kg•°C); tan k V represents the water tank volume, m 3 ; the water tank per unit time; ( ) gb Q τ represents the heat output from gas boiler at the time τ , kJ ; tan ( ) kloss Q τ represents the heat lost to the ambient en- vironment from the water tank at the time τ , kJ; is the amount of heat loss from the transmission of the pipe network at the time τ , kJ; ( ) h Q τ represents the heat- ing demand of the building group at the time τ , kJ.

Figure 2 .
Figure 2. Schematic diagram of the centralized solar heating system in each building group.
where gb C represents the equipment cost per input power of gas-fired boiler, C co C represents the unit price of solar collector, CNY/m 2 ; tan k C represents the eq cost of unit volume of water tank, CNY/m 3 ; pipe C represents the unit price of p work, CNY/m; pipe L represents the total length of pipe network, m; an C repre cost of accessories, including piping accessories such as water pumps, valves, etc

Figure 4 .
Figure 4. Three typical daily heating loads on 17 January.

Figure 4 .
Figure 4. Three typical daily heating loads on 17 January.

Energies 2021 , 22 Figure 5 .
Figure 5. Distribution of buildings with different heating loads in the village.

Figure 6 .
Figure 6.Building groups under different clustering schemes.

Figure 5 .
Figure 5. Distribution of buildings with different heating loads in the village.

Figure 5 .
Figure 5. Distribution of buildings with different heating loads in the village.

Figure 6 .
Figure 6.Building groups under different clustering schemes.

Figure 6 .
Figure 6.Building groups under different clustering schemes.

Figure 7 .
Figure 7.Total equipment capacities of the whole village under different clustering schemes.

Figure 7 .
Figure 7.Total equipment capacities of the whole village under different clustering schemes.

Figure 8 .
Figure 8. Variation of LCC under different clustering schemes.

Figure 8 .
Figure 8. Variation of LCC under different clustering schemes.

Figure 9 .
Figure 9. Variation of LCC with different clustering schemes when pipeline price changes.

Figure 9 .
Figure 9. Variation of LCC with different clustering schemes when pipeline price changes.

Energies 2021 , 22 Figure 10 .
Figure 10.Variation of LCC with different clustering schemes when building density changes.

Figure 10 .
Figure 10.Variation of LCC with different clustering schemes when building density changes.

Table 3 .
Setting of design parameters for residential building (type 1).

Table 4 .
Setting of design parameters for residential building (type 2).

Table 5 .
Setting of design parameters for office building (type 3).

Table 6 .
Typical building envelope parameter setting.

Table 5 .
Setting of design parameters for office building (type 3).

Table 6 .
Typical building envelope parameter setting.

Table 7 .
The number of clusters in each clustering scheme.

Table 7 .
The number of clusters in each clustering scheme.
T S water tank temperature, • C T co outlet temperature of collector, • C T ci inlet temperature of collector, • C T α ambient temperature, • C T su temperature of the water supply out of tank, • C T re final return water temperature of primary pipe network, • C Q SC heat collection capacity of collector, kJ Q gb heat output from gas boiler, kJ Q tan kloss heat lost to the ambient environment from water tank, kJ Q pipeloss amount of heat loss from the transmission of pipe network, kJ Q h heating demand of building group, kJ Q tan k heat stored by water tank, kJ A co total area of all solar collectors, m 2 V tan k volume of water tank, m 3 P gb rated power of gas-fired boiler, kW F R dimensionless heat transfer factor of collector I C solar radiation intensity, W/m 2 L total heat loss coefficient of collector, W/(m 2 • • C) U tan k heat loss coefficient of water tank, W/(m 3 • • C).L MST the distance obtained by Kruskal Minimum Spanning Tree, m Q hgb the annual heat output of gas boiler, kJ F R U L total heat loss coefficient, W/(m 2 • • C) η load the operating load rate of gas boiler, % heat transfer coefficient of pipe at pipe k, W/(m 2 • • C) c s specific heat of thermal mass, kJ/(kg• • C) m sc circulation mass flow of collector, kg/h N the number of buildings in the same cluster Cal gas calorific value of natural gas, kJ/m 3 ζ the ratio of equipment maintenance cost to equipment purchase cost, % k