Optimal sizing of a distributed energy system with thermal load electrification

Renewable energy systems (RES) are currently being deployed on a large scale to meet the ambitious sustainable development goals for the next decades. A higher penetration of sustainable means of power production passes through the diffusion of RES-based distributed energy systems. The hybridization of such systems and their integration with Energy Storage Systems (ESS) can help improve reliability and level the mismatch between power production and consumption. In this paper, a novel modular tool for the simulation of distributed energy systems is presented by means of its application to a case study. The considered system is composed by PV modules, ESS and heat pumps. The optimal sizing of the components for self-consumption has been obtained through an electricity production cost minimization. A comparison between two different configurations has been conducted: in the first case, the thermal load is completely satisfied by a natural gas-fired boiler, while in the latter case, part of the thermal load is satisfied by a heat pump. The results have highlighted the impact of ESS on the economics of distributed energy systems and how the investment in such systems, in conditions similar to the case study, can be more easily sustained if a share of the total energy consumption of the unit is shifted from the thermal to the electrical part.


Introduction
In the wake of the Paris Agreement ratified in 2015 [1] and of the UN 2030 Agenda for Sustainable Development [2] a common effort has been done in order to explore possible directions in the evolution of global energy systems towards a sustainable and decarbonized future.
Numerous studies have been published in the last years on pathways to slash carbon emissions, both on a global and national scale [3][4][5]. The Italian TSOs, Terna and Snam, in their ten years network development plant [6], have identified three possible scenarios, based on the actions that will be taken in the next years. Among these scenarios, two would allow to meet the CO2 emission reduction envisioned in the 2050 Long-term Strategy of the European Commission [7], and can be distinguished by a more centralized (CEN) or decentralized (DEC) approach in the development of the energy system. The DEC scenarios shows, in the long run, lower energy consumption, thanks to a reduction in dispatchment losses, and a higher diffusion of Intermittent Renewable Energy Sources (IRES). This scenario relies heavily on small-scale PV + electrochemical storage systems and the electrification of thermal demand, thanks to Heat Pumps (HP), and transports.
Several contributions can be found in literature on the benefits of combining PV panels with electrical Energy Storage Systems (ESS), such as increments in self-consumption, time-shifting imports and exports from the grid and peak hour demand reduction. Battery sizing is a key aspect of such systems and has a greater influence on the system's profitability [8][9][10].
The impact of HPs on the residential sector has been studied from two different perspectives: on the one hand, from a system-wide viewpoint while on the other hand from a consumer one.
The evolution of demand curves shapes in Germany and Britain in 2050 has been studied in [11] and a good emphasis has been placed on the role of HPs. The same topic has been looked at, in more detail, in [12] and [13], with a specific focus on electrified transportation and heating respectively in the UK and Italy. The impact of electric vehicles and HPs on the market potential of PV + ESS has been evaluated in [14], stating that the diffusion of HPs might reduce the market for stationary batteries, since electric heating systems increase the direct consumption of PV power production. A review on the role of HPs in the European district heating context has been given by [15], while the electricity load implications of a diffused decarbonization of space heating in the USA is the focus of [16] where it is suggested that relying on legacy infrastructures could facilitate the transition to a low-carbon heating system. A contribution to the economics of HPs has been given by [17], where, starting from an UK policies scenario analysis more general conclusions are obtained on the necessity of reducing upfront costs and improving heat pumps performances.
From the consumer perspective, the impact of HPs on PV + energy storage systems has been considered by an increasing number of works. Among the first contributions, [18] has investigated the optimal capacity and expansion planning of such a system that already included HPs. While investigating the potential for peak shaving of electricity storage on low voltage distribution networks Pimm et al. [19] have considered the effect of heat pumps, such considerations have been resumed and expanded by Liu et al. in [20]. In evaluating the optimum energy storage system for demand load shifting for small communities, Parra et al. [21] have found that HPs reduced the levelized cost of batteries and increased their profitability, although without considering PV-battery coupling. Beck et al. [22] have investigated the optimal operation, configuration and sizing of a heat pump system in order to increase self-consumption in a PV + energy storage system, while Yang et al. [23] have introduced an air source heat pump in a microgrid energy management strategy for energy dispatching and fluctuation stabilization. Litjens et al. [24] have specifically focused on the integration of ground source heat pumps.
Since the impact of HPs on residential energy systems is highly dependent on climatic conditions and energy demands, the aim of this work is to further investigate, through the analysis of an Italian case study, the role of HPs on the optimal configuration of energy systems with rooftop solar and ESS and to assess their impact on the system's economics.

Case study
In order to estimate the impact of the adoption of heat pumps on residential energy systems composed by PV panels and ESS, a specific configuration has been taken as a case study and is shown in Figure 1. The building is located in Milan, Italy (Lat: 45.47, Lon: 9.19) and hourly ambient data (ref. 2019) have been obtained from [25] through [26]. Solar irradiance has been obtained as well from [26], where raw data have been elaborated as described in [27]: total solar irradiance is given by the sum of direct and diffused solar irradiance, considering southwards facing panels at a site-dependent optimal tilt angle of 35°.
Electrical and thermal hourly demands have been obtained via the open source software LoadProfileGenerator (LPG) [28] and can be seen in Figure 1. The family unit is composed by a working couple and a retired senior, living in a house with an ambient heating load of 9237 kWh/year and a cooling load of roughly 4700 kWh/year. The electrical load is constituted by the summation of the consumption of the appliances. The thermal load is composed by ambient heating, hot water heating and cooling loads: the first one can be covered both by a traditional natural gas-fired boiler, a heat pump (HP) or a combination of both (depending on the size of the HP); the second one is always covered by the traditional boiler and the last one is always covered by the air conditioning system (AC). LPG estimates a daily ambient heat demand, which is evenly distributed throughout the day: a more realistic distribution has been obtained from [29].

Mathematical model
The case studied has been modelled through a newly developed modular tool. The tool is capable of simulating, on an hourly basis, user defined energy systems, composed by up to 100 elements. Each element is described by a set of equations and interacts with the others as described in the following paragraph. A reference year on an hourly basis is simulated and is used to estimate system performances, CAPEX and daily energy expenditures. The obtained results are then employed to conduct an economic optimization of the system.

Energy system solver
At each timestep Δt the following energy balance has to be satisfied:

AMBIENT HEATING DEMAND
The energy produced by the PV panels is obtained by multiplying the estimated average power output for the timestep. The average power output is obtained as follows [30]: where A is the panels area, GTOT the solar irradiance obtained as described in Section 2, factive the fraction of active solar cells and ηPV the module efficiency. The total electrical energy consumption is given by the summation of three terms. Eel,dem is the appliances electrical demand, obtained as described in the previous Section. Eel,AC is obtained by solving the AC component. First, the thermal balance has to be considered: depending on the user-defined size of the AC system, the cooling load might not be completely satisfied: ΔEcool = 0 if the AC system has sufficient power for covering every demand peak, otherwise ΔEcool = Eth,AC,max -Eth,dem,cool. The maximum cooling effect is obtained from the AC rated power: where fmax = 1.5 is the ratio between maximum and rated power of the AC. From the thermal balance is then possible to obtain the electrical energy consumption: where EER is the Energy Efficiency Ratio of the air conditioner. Eel,HP is obtained by solving the ambient heating thermal balance and then considering HP performance. The thermal balance has two forms depending on whether Eth,HP,max ≥ Eth,dem,amb or not. The general equation is: Eth,HP + Eth,boil,amb -Eth,dem,amb = 0 In the first case, the thermal load is always satisfied by the HP, Eth,boil,amb = 0 and Eth,HP = Eth,dem,amb, while in the second case Eth,HP = Eth,HP,max and Eth,boil,amb is obtained. The HP maximum energy produced depends again on the user-defined HP rated power: Eth,HP,max = PHP,rated · fmax · Δt where fmax = 1.5 is, again, the ratio between maximum and rated power of the HP. Electrical consumption results hence in: where COP is the Coefficient of Performance of the heat pump.
Once that the PV panels electric energy output and the electric demand have been computed for the timestep, Equation 1 can be solved. If EPV · ηinv ≥ Edem (where Edem = Eel,dem + Eel,AC + Eel,HP) then the energy storage system is considered and the excess energy produced is stored in the battery. When the battery reaches its maximum state of charge, the remaining energy is sold to the grid (Egrid < 0). On the other hand, if EPV < Edem, the necessary energy is taken from the battery, again considering for the inverter losses. When the battery reaches its minimum state of charge, the remaining energy is bought from the grid (Egrid > 0). The ESS is considered to be working between a minimum (SoCmin = 0.2) and a maximum (SoCmax = 0.95) state of charge and to have a charging and discharging efficiency of 0.95. The inverter efficiency is computed according to [31]: PDC-AC (t) = PDC-AC · ηinv (9) ηinv = A + B · P/Ppeak + C / (P/Ppeak) (10) Where, considering an inverter size between 3 kW and 11 kW, A = 97.004, B = -1.58 and C = -0.362. The last thermal balance to be considered is the hot water one: Eth,boil,wat -Eth,dem,wat = 0 The overall thermal demand to be satisfied by the traditional boiler is given by the sum of two different terms: Eth,boil = Eth,boil,amb + Eth,boil,wat. By solving the component's equations, it is possible to obtain the gas consumption V in the timestep considered: where ρ is the NG density and Ns/h = 3600 s/h is the number of seconds in one hours.

Economic analysis
The economic analysis has been conducted through the NPV method, in order to evaluate the cost and benefits of a system such as the one previously described (case 1) with respect to a reference case, where the electricity is bought from National Grid and thermal demand is satisfied via a traditional NG boiler (case 0). The NPV is a cumulative indicator and is updated on a daily basis, considering investment costs, energy expenditure and energy revenue: NPV(n) = ∑j=0,n (CFj,1 -CFj,0)/(1+i) j (14) where n is the time instant at which the investment is evaluated and is to be considered between 0 (when the initial investment is made) and N = 30 y · 365 d/y, which is the time horizon considered in the analysis; CFj,1 and CFj,0 are the cash flows at the j-th timestep for case 1 and case 0 and i is the daily discount rate, obtained from the annual rate iy = 5%. Cash flows are computed as follows: CFj = -Cinv,j -Cen,bought,j + Cen,sold ,j Cinv,j is the investment cost for equipment at j-th timestep: investments are considered to be instantaneous and are introduced at j = 0 and every time an element has to be replaced at the end of its lifetime. Specific investment cost and lifetime of each component have been estimated according to [32,33]. Cen,bought,j is the daily energy expenditure, both for electrical energy and NG, while Cen,sold,j is the daily energy revenue for selling excess electrical energy to the grid. Electricity prices have been varied according to Italian medium-sized household prices between 2008 and 2019 [34] plus a 20% range extension on the lower and higher end of the scale, resulting in an interval between 0.15 €/kWh and 0.30 €/kWh. The selling electricity price is fixed and considered equal to 0.04 €/kWh. NG price is fixed as well and equal to 0.88 €/Nm 3 [35].

System optimization
The variable to be optimized is the NPV at the end of the considered time horizon, NPV (30), while the variables to be varied are the PV panels area and ESS capacity: The algorithm employed is the coordinate descent one, to be used for continuous functions of which is not possible to compute the derivative. More complex algorithms are not necessary since the objective function is reasonably convex and has a low computational cost, making it unnecessary to map the research space.

Results
Results are divided in two subsections. In the first subsection some considerations are made on heat pump sizing and on its impact on the system optimal dimensioning and economics, while int the latter subsection the impact of battery prices on the system has been evaluated both in the absence and in the presence of heat pumps.  33]. Both figures are composed of three different graphs: the first one shows the NPV(30) as a function of HP rated power, while the other two show optimal PV panels area and battery capacity, again as a function of the HP rated power. A vertical line will hence identify which is the optimal configuration of the PV+ESS system and the corresponding NPV(30) for a certain HP size. Looking at Figure 2, for an electricity price of 0.15 €/kWh the optimal battery capacity is 0 kWh, regardless of the size of the HP, the optimal PV area is lower than 15 m 2 and shows little variation with the HP size, while the NPV, on the contrary, shows a greater variation with HP rated power and reaches a constant value only for high power values. Fig. 2. NPV, optimal PV panels area and battery capacity for a battery specific cost of 200 €/kWh. Fig. 3. NPV, optimal PV panels area and battery capacity for a battery specific cost of 393 €/kWh.

Heat pump sizing
For higher electrical energy prices, ESS optimal capacity increases, showing a dependency on HP size as well. The optimal capacity tends to reach a plateau, corresponding to the maximum capacity, for higher power values. This trend can be seen for the PV panels area as well. Conversely, the dependency on HP rated power tends to decrease with higher electricity prices for the NPV and the plateauing-maximum value tends to be reached for lower power values with increasing electrical energy prices. Similar considerations can be made for Figure 3. However, in this case, only for higher electricity prices an investment in an ESS is justified and, as long as the optimal battery capacity is lower than 3 kWh, the optimal PV area tends to show a diminished dependence on HP rated power, while the NPV an increased one. Higher battery specific costs hence imply lower NPVs, optimal PV panels area and battery capacities.
The graphs of Figure 4 give an insight on the sizing of the HP. The highest value for the HP rated power has been taken 3.1 kW, since it corresponds to a peak power of 4.65 kW, Fig. 4. Share of ambient heating thermal demand covered by HP for different HP sizes and ambient heating thermal demand cumulative curve.  high enough to cover peak thermal demand for ambient heating. The graph on the left-hand side shows the percentage of thermal demand covered by HP for increasing rated powers, the last bars show how the load is already almost entirely covered by HP. This can be explained looking at the shape of the cumulative curve on the right-hand side, where two HP sizes are shown as an example, indeed the orange area corresponds to the additional thermal demand covered by the more powerful HP and it is evident how this area tends to become smaller with equivalent increases in HP size.

Battery prices impact on system optimal sizing and economics
Since battery prices are one of the major obstacles to a wider penetration of PV+ESS systems and are expected to decrease significantly in the following years, Figures 5 and 6 have been obtained in order to assess the impact of adding HPs to such systems. Here the electrical energy price has been taken constant and equal to 0.225 €/kWh. Figure 5a shows the optimal battery capacity as a function of PV panels area and battery price for a residential system without HPs, while Figure 5b shows the correspondent NPV (30). The former graph shows a relevant portion of combinations where the optimal battery capacity is found to be 0 kWh, in accordance to what was found in Figure 3. The highest values for the capacity of the ESS are found for low battery prices and PV panels area, although this second parameter, from values between 20 m 2 and 30 m 2 on, is found to no longer influence the optimal capacity. Indeed, the NPV(30) is found to be at its maximum exactly in that portion of the graph.   show similar trends to the ones just described. Some differences are worth noting. The maximum optimal capacity for the batteries is found to be significantly higher than before (growing from 12 kWh to 24 kWh) and the same goes for the NPV(30) (growing from ca. 8 k€ to more than 13 k€). At the same time, the portion of the graph where the optimal battery capacity is found to be greater than 0 kWh is reduced, suggesting that the HP tends to consume directly part of the electrical energy produced by the PV panels. This can be clearly seen from the graph in Figure 7, where the electrical energy demand curve, obtained on the left, is compared to the energy fluxes in the system in the graph on the right. The thermal demand is distributed throughout the whole day and is hence partially overlapping with the bars displaying the energy produced by the PV panels, this reduces the exceeding electrical power produced during the day and, as a consequence, the optimal size of the ESS. For the sake of completeness, a typical summer day is shown in Figure 8. Here the curve of the electrical consumption is shaped by the AC system and PV panels are producing a higher amount of energy for a longer period of time during the day, hence almost reducing to zero the amount of energy imported from the grid.

Conclusions
The impact of heat pumps on household energy systems composed of PV panels and ESS has been investigated through the application of a newly developed modular tool to a case study. The system economics has been evaluated through the NPV method and the optimal sizing of the PV area and battery capacity has been individuated in all the conditions considered thanks to a coordinate descent optimization algorithm.
Results have highlighted the influence of HP sizing on the optimal area of the PV panels and capacity of the storage system and, at the same time, on the NPV(30), suggesting a positive impact for the employment of HPs on energy systems in conditions similar to the ones considered in the case study. Projected costs of energy storage systems have been considered as well, since they are expected to diminish drastically in the years to come. In this case, on the one hand HPs have proven to increase the break-even specific price for batteries in such systems, while, on the other hand, have clearly shown an increase in the optimal size of batteries and in the revenues of PV+ESS systems.