Decarbonising heat with optimal PV and storage investments: A detailed sector coupling modelling framework with flexible heat pump operation

This paper analyses optimal electricity investments (PV and battery storage) to decarbonise heat supply in residential buildings under different heat pump and energy retrofitting scenarios in a detailed representation of the Swiss power and heating system. The sensitivity of PV and storage deployment, including lithium-ion (LiB) and vanadium redox flow batteries (VRFB), with respect to distribution network capacity is also investigated. We propose an open-source dispatch sector coupling model (GRIMSEL-AH) to minimise energy system costs (social planner perspective) for heating and electricity supply in Switzerland with hourly and daily time resolution for electricity and heating respectively. Moreover, our representation of the Swiss energy system includes various types of consumers and urban settings which are represented with monitored electricity demand data for each sector and simulated heat demand data at the building level for the residential sector. We find that under a “business as usual” heat pump deployment and retrofitting rate, the optimal electricity investments correspond to 27.8 GWp of PV combined with [...] RINALDI, Arthur, et al. Decarbonising heat with optimal PV and storage investments: A detailed sector coupling modelling framework with flexible heat pump operation. Applied Energy, 2021, vol. 282, no. 116110 DOI : 10.1016/j.apenergy.2020.116110


Introduction
Climate change mitigation requires the reduction of greenhouse gas emission across the whole energy sector (i.e. beyond the power sector) and all economic sectors. Among them, the residential sector is of particular interest since in 2018, energy consumption in households was responsible for 20% and 17% of the CO 2 emissions in the European Union and Switzerland respectively [1,2]. Heating represented 80% of the final energy consumption in Swiss households, with space heating and hot water contributing to 65% and 15% respectively. Heat supply is dominated by fossil fuel technologies [3], in particular, fuel oil and natural gas jointly covered 66% of space heating and 54% of domestic hot water demands.
Heat pumps (HPs) are now the most promising technology to decarbonise the heat supply while promoting renewable energy integration in buildings [4], due to both high thermodynamic efficiency and the possibility of using renewable electricity as a source. The typical value of the coefficient of performance (COP) of a ground or air source HP transmission grid upgrade deferral as an alternative to distribution network reinforcement and expansion.

Literature review and research gap
Heating electrification with renewable electricity is becoming a key decarbonisation strategy. For example, PV-coupled HPs play an important role to decarbonise the built environment [19]. This strategy implies a stronger interaction between traditionally decoupled sectors, referred to as sector coupling, and energy storage can support the integration of low-carbon technologies both in the heating and power sectors [9,20,21]. For example, a recent comparison between batteries and hot water tanks shows that, for PV-coupled HPs, batteries are more effective in increasing local PV self-consumption while hot water tanks reduce the levelised cost of meeting the total electricity consumption [9]. Sector coupling has been a focal area of the recent scientific literature and Table 1 provides a non-exhaustive list of recent studies.
Sector-coupling to decarbonise heat occurs at the distributed level, e.g., in individual dwellings and/or districts. In order to best capture the mechanisms involved in sector coupling, such as flexibility enablers and distribution network constraints, energy system models should include a granular representation of the electricity and heating sectors. However, the previous literature has only addressed sector-coupling in an aggregated manner, typically at the national level, e.g., using a single node to represent a whole country [22][23][24][25][26][27][28][29]. The level of aggregation was even lower in a previous study which used the GENeSYS-MOD model to represent the whole world with 10 regions [30]. EnergyPLAN has been used for various relevant studies (e.g., [29,31,32]) with some granularity. EnergyPLAN differs from the other models listed in Table 1 by being a simulation tool [31] and a price-taker model [29,32].
To the best of our knowledge, only two optimisation models so far have proposed a more granular representation of the studied energy system: ESDP developed by Siemens (Germany) [33,34] and STEM developed by the Paul Scherrer Institute (Switzerland) [35]. ESDP has a very detailed representation of the German energy system with around 360 nodes, distinguishing among residential, service and industrial sectors. In the STEM model, the Swiss power system is represented by 15 nodes and 288 representative time slots. However, regarding demand profiles, synthetic curves (i.e. typical modelled load curves) have been used for various sectors in ESDP [34], or alternatively, profiles from other countries in STEM, e.g., heating profiles from Germany adapted to Switzerland [36]. Based on this literature review, we conclude that optimised renewable and flexibility electricity investments required to drive the decarbonisation of the heating sector have hardly been studied, mainly due to high model complexity and data granularity.
Against this background and to study the flexibility enabled by energy storage and HPs thereby realising sector coupling, we propose an open-source dispatch (both heat and electricity) optimisation model (social planner approach), referred to as ''GRIMSEL-AH'', which is an expansion of a power system dispatch model, ''GRIMSEL-A'', developed by Soini et al. [37] and extended by Rinaldi et al. [38]. The expansion consists of adding 30 sub-national nodes to the Swiss electricity system and 24 heating nodes to represent the Swiss residential heating sector. In contrast to the existing literature, we propose a modelling framework consisting of a unique combination of model and data characteristics to better capture the interactions of sector-coupling, focusing on HPs and thermal retrofitting of buildings. Also, we use monitored electricity demand profiles with 1 h resolution for each sector (residential (both single-family house (SFH) and multi-family house (MFH)), commercial (OCO) and industry (IND)). The heat demand is simulated on a daily basis at the building level (including every single residential building in Switzerland) using a bottom-up model, ''SwissRes'', developed by Streicher et al. [39]. Importanly, we investigate the impact of building retrofitting as well as distribution capacity upgrade on optimal power investments. ''GRIMSEL-AH'' is then used to answer the following policy-relevant research questions with the year 2050 as time horizon: 1. What investments in power assets such as renewable generation and energy storage are needed to drive the decarbonisation of the heating sector? 2. Who should drive those investments and where (i.e. which types of consumers and in which type of urban settings) in order to minimise total energy system cost including flexibility and sector coupling? 3. How sensitive are PV and storage deployment to HP deployment and building retrofitting scenarios along with distribution network capacity?
The remainder of this paper is organised as follows. Section 2 presents ''GRIMSEL-AH'', its characteristics and the input data for various technologies across various sub-national nodes. This section also includes a description of future HP and retrofitting scenarios up to 2050. Section 3 presents the different optimisation cases executed to answer the proposed research questions. Section 4 presents the results which are discussed in Section 5. Finally, we draw conclusions in Section 6.

Description of the model
The general characteristics of ''GRIMSEL-AH'' are described in a recent publication [38]. The so far existing version of the model (referred to as ''GRIMSEL-A'') included only the electricity sector with a detailed representation of the Swiss power system. It was characterised by 12 sub-national nodes comprising four different consumer types, namely residential (both single-family houses (SFH) and multi-family houses (MFH)), service (OCO) and industrial (IND) sectors, and three types of urban settings, namely rural, suburban and urban. In order to represent sector coupling, we extend ''GRIMSEL-A'' to the heating sector with a focus on the residential sector (SFH and MFH). For each combination of types of residential sectors (2) and urban settings (3), we add four heating nodes which leads to 24 nodes representing the residential heating sector. Each of these additional nodes is connected to its corresponding electricity node, which results in 30 sub-national electricity nodes (24 for the residential sector and 6 for IND and OCO). The nodes structure of the model is illustrated in Fig. 1. We use 2015 as base year and 2050 as time horizon with 5-year steps in between. The optimisation period is 1 year (yr) with two different temporal resolutions, namely 1 h (hr) for electricity and 1 day (d) for heating. Another important characteristic of GRIMSEL-AH is its opensource nature, in contrast to most of previous models. Open-source energy system models and associated data have been receiving a lot of attention [42] and they are important to improve quality of science, on the basis of more transparency, reproducibility and traceability [43]. GRIMSEL-AH is a quadratic dispatch sector-coupling model with perfect foresight covering the electricity system of Switzerland and its four neighbouring countries (Austria, France, Germany and Italy) and the Swiss residential heating sector. The objective function is the total A. Rinaldi et al. system cost which is minimised following a social planner approach. Linear cost curves are used for fossil fuel power technologies which makes the objective function quadratic. It is implemented in Python using the commercial optimisation solver CPLEX. The power generation technologies and different input parameters considered in the five country nodes as well as future capacities (up to 2050) are described in a previous study [38]. The optimiser does not retire or add capacities, except for the selected variables (e.g., renewable and storage in this study), for which it determines the optimal capacity and schedule of various power assets such as generation and storage technologies. In this study, PV and electricity storage technologies are the variables to be optimised across the 30 electricity nodes of Switzerland. Electricity storage can be operated to reduce the total system cost via different mechanisms. It can prevent the use of expensive natural gas or electricity imports by using low cost PV generation. Moreover, it can prevent PV curtailment and avoids pumped-hydro storage operation when expensive [44]. GRIMSEL-AH and the proposed methodology are flexible and can be extended and applied to other geographies.

Electricity and heat demand at the archetype level
First, we combine consumer types (related to various building types) and urban settings to define archetypes 1 The three urban settings, namely rural (RUR), suburban (SUB) and urban (URB) areas, are based on the categories of the Swiss Federal Office of Statistics (FSO) and the Federal Office of Spatial Development (ARE) [45,46]. Then, we divide each of these typologies into four types of consumers, namely SFH, MFH, OCO, 2 and IND. We then use the Swiss national building register (GWR), which contains data on around 2 M buildings [47], to assign each building to one of these 12 categories using the geographical coordinates and the building type.
We construct the Swiss electricity demand using a bottom-up approach based on hourly demand profiles monitored with smart metres for each consumer type (a detailed explanation can be found in a previous publication [38]). Furthermore, the specific energy demand by archetype is weighted with the floor area of each building. The total electricity consumption across all sectors in Switzerland in 2015 was 58.3 TWh [48] and we assume a linear increase until 2050, reaching the expected total value of 67.5 TWh/year by then [49].
Regarding the heating sector, we focus on the residential sector because it represents more than two thirds of the heating final energy consumption in Switzerland [3]. The heat demand is simulated at the building level (for every single residential building in Switzerland) on a daily basis using the bottom-up model SwissRes [39] with the assumption that the thermal inertia of buildings allows 24h flexibility. With a daily resolution for the heat demand, we can capture the flexibility that HPs could provide to the power system. This results in a total heat demand of 40 TWh th for the residential sector in 2015 which is 6.3% lower than reported by official statistics [3]. In accordance with the structure of electricity archetypes, we divide buildings into six groups, namely SFH and MFH in each urban setting. In order to reduce the computational time, we cluster similar buildings based on the annual useful energy demand per square metre and their respective daily normalised profiles. We use the k-means clustering method and define the number of clusters for each group to be four [50]. This number of clusters was selected after comparing the variance explained by the cluster centroids with the total variance (the threshold was set at 80% of the total variance explained). This results in 24 heating archetypes which are connected to their corresponding electricity demand archetypes (e.g., SFH-RUR) divided in four clusters, which are proportional to the total energy reference area (ERA). Finally, we apply a climate correction to the future heat demand in order to take into account climate change, based on the Representative Concentration Pathways (RCP) 4. 5 [51]. This allows us to simulate the future useful heat demand, which results in a 11.8% lower annual heat demand by 2050 compared to the values in 2015 (35.3 TWh th /year). The overall model structure is illustrated in Fig. 1.

Retrofitting
In addition to the climate correction for future years, we also consider different retrofitting scenarios which affect the annual heat demand. The base case scenario only takes into account non-energy related refurbishment and the effect of a warmer future climate on the A. Rinaldi et al.

Electricity technologies
Electricity generation and storage technologies considered in this study, at the archetype level, are PV, Li-ion Battery (LiB) and Vanadium Redox Flow Battery (VRFB). In Switzerland, PV installations are almost exclusively mounted on rooftops due to space limitations. The available rooftop area is therefore a constraint to the future PV deployment. To set an upper bound limit to the (optimised) PV capacity, we use a study from the Federal Office of Topography (swisstopo) in collaboration with the Swiss Federal Office of Energy (SFOE) which mapped every roof in Switzerland in a database (Sonnendach) [56]. On the basis of this database and additional assumptions, we conclude that the maximum PV potential for the whole of Switzerland is 42 GW p which we allocate by archetype. The methodology with its assumptions described in a previous publication [38]. Wind power capacity is given as scenario and not optimised due to the lack of public acceptance in Switzerland which makes its future deployment uncertain.
Regarding electricity storage technologies, LiB (NMC-type) and VRFB are modelled with an energy to power (E/P) ratio of 2 [53] and 4 [57] respectively, as opposed to pumped-hydro storage, with an E/P ratio ranging between 5-20 based on country-specific empirical data [37]. The choice of these two battery technologies is to compare a battery where energy and power are coupled (LiB) with a more flexible battery (VRFB), which allows for longer discharge. The relevant PV and battery techno-economic data are presented in Table 2. All power generation technologies other than PV and batteries (i.e. nuclear, hydro, coal etc.) are set at the national level, i.e. at the power transmission level. As shown in Table 2, technology costs depend on the scale of installation and hence costs data are different for the residential (RES), commercial and industrial sector sectors, based on their representative sizes. Our scale-dependent cost values provide granularity to our model and are representative for 2015, 2035 and 2050. We set cost values for intermediate years using linear interpolation.

Heat pumps
We consider two HP technologies in this study: Air/Water HP (A/W) and Brine/Water HP (B/W). It is important to differentiate between these technologies for two main reasons. First, the power input el t needed to provide the heat output th t is a function of the as shown in Eq. (1) at each time step t and for each archetype (various archetypes are linked with the geographical position and the associated outdoor temperature). Furthermore, the theoretical COP (i.e. Carnot-COP) depends on the temperature of the heat source source i,t which differs depending on the technology (i), i.e. outdoor air temperature for A/W and ground temperature for B/W, and also can change over time (cf. Eq. (2)). For B/W, we assume a constant ground temperature of 5 • C throughout the year and for A/W, we consider the outdoor air temperature with a daily and a 1-km 2 temporal and spatial resolution respectively. Eq. (2) shows that the Carnot-based COP is also a function of the required level (l) of the HP's outlet temperature sink l . Two temperature outlets, namely high (H/T) and low (L/T), are assumed in order to differentiate between ''old'' buildings with a radiator-based heating system and ''new'' or retrofitted buildings with underfloor heating. We consider for H/T a sink H/T = 60 • C and for L/T, a sink L/T = 35 • C. Furthermore, a HP is not a perfect reverse Carnot engine and therefore we apply an exergy efficiency l to the Carnot-based COP in order to model the irreversibility of the real processes, resulting in a final COP given by Eq. (3). Based on empirical data, 3 the values of exergy efficiency selected are L/T = 49% and H/T = 44% for H/T and L/T outlet temperature levels respectively. The use of B/W HP is restricted to a certain amount of buildings since B/W require to drill boreholes. For example, B/W are not suitable for MFH buildings located in dense urban areas (due to gradual cooling down of the ground) and they are prohibited in water protection areas. The values of COP for A/W and B/W HP as a function of the outlet temperature are summarised in Table 3.
A. Rinaldi et al.

Table 3
Summary of the COP input data in the different combination of technologies and temperature levels.
Heat pump types Temperature levels COP

Distribution capacity expansion and grid losses
The connection of large capacities of PV and HP to the distribution grid can cause challenges, mainly due to voltage issues and overloading [11]. A key benefit of a more granular energy system model is the possibility to include constraints on distribution capacity ( ) and to test the sensitivity of the model to them. In GRIMSEL-AH, the capacity of cross-border interconnections among neighbouring countries are set for each month based on the 2015 average net transmission capacities. We consider the same values across for every model run, therefore it is not a focus in this study. The detailed description of the cross-border interconnections along with the main model characteristics can be found in the Appendix of a previous study [37]. To represent the Swiss national distribution grid, each electricity archetype is connected to the national node (CH0), as represented in Fig. 1. For these intra-national interconnections, we set capacity constraints based on the maximum power demand in 2015 (i.e. without the additional demand induce by HP developments) of the corresponding nodes and as a function of urban setting type. According to the data provided by two distribution system operators in Switzerland, transformers tend to be more oversized in urban than rural settings. We therefore set the distribution capacity to 105%, 110% and 115% of the peak power demand for rural, suburban and urban nodes respectively. Distribution networks are not modelled in detail since each one is different based on local characteristics such as demand loads, topology, etc. For example, in Switzerland, there are nearly 700 distribution system operators/utilities (DSOs), each one managing a different distribution network, which also makes the input data collection effort not manageable, due to both computational requirements and confidentially issues. Finally, electricity losses of 4.1% are applied to electricity transfers between the archetype nodes and the national node CH0 [48] as well as between neighbour countries.

Optimisation setups and scenarios
In order to answer the research questions identified above and facilitate the understanding of the modelling results, we optimise the capacity of PV and battery storage technologies (both LiB and VRFB) under the following scenarios with GRIMSEL-AH: 1. First, we investigate the optimal electricity technology capacities (for PV and storage) under different HP deployment scenarios 2. Second, we modify the energy retrofitting rate of the building stock to evaluate its impact on the cost as well as various technology capacities 3. A sensitivity analysis of PV and storage capacities with regard to distribution capacity is performed.
For the sake of consistency and to compare different results, all input data and parameters remain the same across the HP and retrofitting scenario combinations. For the baseline year, the input data represent the PV capacity and battery storage in 2015. This corresponds to an installed capacity of 1.66 GW p for PV and 0 GWh for distributed storage (both LiB and VRFB), since hardly any distributed storage was deployed by then [58]. Regarding PV, the installed capacity is distributed across the 30 archetypes in proportion to their respective PV generation potential (see Section 2.4) since data on real distribution of PV with geographical resolution are not available.

HP scenarios
We define three different HP scenarios based on their deployment up to 2050, namely (i) Market sales and forecast (Market), (ii) replacement of all fossil-based heating systems (Fossil) and (iii) implementation in the whole residential building stock (Full). The HP thermal capacity is defined on the basis of the maximum daily heat demand ℎ of each archetype (coldest day of the year) that should be delivered within 16 h (cf. Eq. (4)). This more conservative approach (16 h instead of 24 h) is based on a methodology used by HP installer in Switzerland. 4 The Full scenario assumes that the whole residential building stock in Switzerland will be exclusively heated using HP by 2050. The Market scenario is defined based on the existing HP sales statistics and their market forecast for future years. Since 2010, 20'000 HP p.a. have been sold in Switzerland [59] and this number should double by 2030 [13]. Based on these numbers, 1.1 M HP will be sold from 2015 to 2050, of which 70% correspond to existing buildings (the remaining 30% are installed in new buildings) [11]. Therefore, HP will replace 56.8% of the existing heating systems by 2050 (0.77 M out of 1.36 M) and this ratio is applied to each archetype. Thirdly, the intermediate HP deployment scenario (Fossil) assumes the replacement of all fossilbased heating systems (83% in today's building stock), namely oil and gas, with HP by 2050 across all the archetypes. Finally, we use the existing share of HP types sold from 2000 to 2018, equivalent to 61.5% for A/W and 38.5% for B/W respectively [59], to break down the HP capacity additions into A/W and B/W. For each scenario, we also use linear interpolation for HP deployment in 5-yr steps between 2015 (baseline year) and 2050.

Retrofitting scenarios
Regarding the future heat demand, we consider three scenarios, namely Base, 1% p.a. and 2% p.a.. The baseline scenario (Base) is defined by taking into account only non-energy related refurbishment and the effect of a warmer future climate, which results in respect to a heat demand of 30.3 TWh th /year by 2050. The other two scenarios include energy retrofitting, considering a yearly rate of 1% and 2% of the building stock. Energy savings driven by retrofitting depend on the building type (SFH or MFH), the urban setting (RUR, SUB, or URB) and the construction period (separate into decades) based on empirical evidence, ranging from 42%-73% of the useful energy demand in 2015 [55]. Buildings which are retrofitted within the modelled time period are randomly selected. The resulting annual heat demand is 23.5 TWh th /year and 16.6 TWh th /year by 2050 for the 1% p.a. and 2% p.a. scenarios respectively. Finally, we adapt HP capacities based on the new demand resulting from the different retrofitting scenarios.

Distribution grid capacity sensitivity
A sensitivity analysis of PV and battery capacities as a function of the distribution grid capacity is performed. We vary the base distribution grid capacities from 95% to 115% of its initial value (cf. Section 2.6) with a 5% step. For each step, the analysis is performed nine times to cover the various combinations of HP and retrofitting scenarios.
The variations of model parameters for the different cases are summarised in Table 4 and illustrated in Fig. 2

Table 4
Model parameters for HP (Air/Water (A/W) and Brine/Water (B/W)), retrofitting and variations as assumed in the different cases for the whole of Switzerland.

Main results
Optimised technology capacities are presented, first, for the four consumer types and, secondly, for the three urban settings. First, we consider the base distribution capacity per archetype while the sensitivity analysis on the distribution capacity is presented in Section 4.5.
Under the HP Market scenario and the 1% p.a. retrofitting scenario, the optimal capacities are found to be 27.8 GW p for PV, 16.9 GW (33.8 GWh) for LiB and 1.9 GW (7.6 GWh) for VRFB by 2050 in Switzerland, which are distributed among the archetypes as shown in Figs. 3 and 4. Under the HP market scenario, various optimal capacities are not affected by the different retrofitting pathways whereas with a larger HP deployment (Fossil and Full), the retrofitting rate matters. The capacities vary from 27.7 GW p to 33.0 GW p for PV, 16.9 GW (33.8 GWh) to 30.0 GW (60.0 GWh) for LiB and 1.8 GW (7.2 GWh) to 20.0 GW (79.9 GWh) for VRFB depending on the nine scenario combinations. In the residential sector, the more heat demand is covered by HP the more PV and storage are installed as shown in Fig. 3. For example, under the Fossil replacement scenario, the heat demand is twice as high in the Base retrofitting scenario than in the 2% p.a. scenario (25.2 TW th /year and 13.7 TW th /year respectively). This leads to an increase of 1.3 GW p of PV (+16%) and more the three times the total storage capacity (+16.7 GW). By examining the differences among the urban settings, we note that for URB, the PV, LiB and VRFB capacities remain stable regardless the different scenario combinations. PV capacity reaches 85% of its potential (9.0 GW p ) while a very limited storage capacity is installed, limited to LiB (1.5 . This low storage capacity results from the characteristics of the urban setting, namely, the highest conventional electricity demand (33 TWh/year) and the highest distribution grid capacity ( ), combined with a limited roof area available for PV. They lead to a higher direct self-consumption (SC) (48.6%-55.3% for RES and up to 91.2% for IND and 94.5% for OCO) and a larger possibility of import/export. Fig. 5 illustrates the influence of the different retrofitting and HP scenario combinations on the optimal capacity of various technologies by 2050, as a function of the urban setting (i.e. the various consumer types are aggregated). Scenarios are ranked, in ascending order, by the heat demand covered by HP. Both the minimum and maximum PV and storage capacities coincide with the scenarios with lowest and highest HP diffusion, respectively. We observe a marked shift for the scenarios with the highest heat demand, resulting from reduced retrofitting and important HP deployment, corresponding to 23.5 TWh th /year (Full + 1%), 25.2 TWh th /year (Fossil + Base) and 30.3 TWh th /year (Full + Base). PV and storage optimal capacities increase mainly in MFH and SFH located in Suburb. The main reason is that suburban areas account half of the total heat demand (1.5 higher than in RUR and 2.3 times URB heat demand). PV increases primarily SFH (in SUB and in RUR) whereas storage (both LiB and VRFB) increases in both SFH and MFH. Overall, storage capacity is relatively high in OCO and IND because of lower investment costs than in RES. Importantly, VRFB are found to be cost-competitive in IND or OCO (and only in RUR and SUB), while for RES, a certain heat demand threshold (above 5 TWh th /year in SFH and MFH) is needed for VRFB to become economically viable. For LiB, we observe the same trends with the exception that they also help to reduce the system cost in RES-URB, with a capacity of 1.1 GW (2.2 GWh) for MFH and 0.4 GW (0.8 GWh) for SFH.   to the Fossil fuel replacement scenario in each energy retrofitting scenario. Moreover, Fig. 7 shows the variations of PV and storage optimal capacities induce by a higher (2% p.a.) or lower (Base) retrofitting rate relative to the 1% p.a. retrofitting scenario in each HP scenario. Only archetypes in SUB and RUR are shown in both figures because there is no variation in the URB archetypes (heat demand is the lowest in URB and therefore, the variations across the scenarios are small in absolute terms). Overall, we observe that the more heat demand is covered by HP, the higher the value of the optimal PV and storage capacities. According to the results displayed for RUR in Figs. 6 and 7, variations in technology capacity take place in SFH for the Full HP + Base scenario combination because 72.2% of the rural heat demand is due to SFH (7.0 TWh th ). Regarding SUB, the main variations in MFH concern storage (both LiB, −6.2 GW to +3.8 GW, and VRFB, −8.2 GW to +11.6 GW) and only a small effect on PV (−0.3 GW to +0.2 GW). For SFH, variations in storage capacity is also very significant (LiB, −1.7 GW to +3.5 GW, and VRFB, −1.2 GW to +4.2 GW) but PV capacity is more sensitive than for MFH (−1.3 GW to +1.7 GW). We can also see, in Fig. 6, that PV and storage capacity variations induced by HP deployment (Market and Full HP relative to Fossil fuel replacement ) are within the same order of magnitude across the various scenarios and without energy retrofitting (Base), the increasing HP penetration requires significant storage investments (both Lib and VRFB). Differently, Fig. 7 shows that capacity variations without energy retrofitting (Base, up to + 15 GW for VRFB) are greater than with the 2% p.a. retrofitting rate p.a. (less than -4 GW for LiB), relative to the 1% p.a. retrofitting scenario. It can be concluded that a retrofitting rate of only 1% p.a. can already significantly avoid storage investments.

PV capacity
In this section, we discuss in more detail the results for optimised PV capacity. In the urban setting, 9.0 GW p of PV are installed in URB in any case (across all sectors), which corresponds to 85% of the potential. In RUR, only 56% of the potential is met except for a scenario where HP reach their maximum deployment (Full HP) while only non-energy related retrofitting is implemented (Base retrofitting), reaching 68% (12.1 GW p ). The archetype SFH-RUR (+1.9 GW p ) is responsible for this increase since it accounts for more than 2/3 of the total heat demand. Fig. 8 shows the detailed PV optimal capacity in the residential sector with the corresponding share of the potential for each HP and retrofitting scenario. Overall, we notice that the PV capacity in SUB is more sensitive to the deployment of HP and energy retrofitting, with its total share of the PV potential ranging from 65% to 89%. Finally, PV reaches 100% (9.4 GW p ) of its potential in IND and 91% (7.4 GW p ) in OCO (100% in URB and SUB and 74% in RUR) regardless the HP and retrofitting scenarios.

Flexibility enabled by the operation of heat pumps
Based on the results discussed so far, we can conclude that the electrification of the residential heating sector leads to an increase of PV deployment. The thermal inertia of buildings, assumed to last for 1 day in our study, allows HP to operate in a flexible manner as long as the daily heat demand is satisfied and the maximum HP electrical power is not exceeded. GRIMSEL-AH makes use of this additional flexibility to increase PV self-consumption locally, which increase the overall A. Rinaldi et al. Fig. 7. Impact of retrofitting rates (relative to 1% p.a.) on PV, LiB and VRFB capacity by 2050 for each consumer types in Rural and Suburb area and in each HP scenarios. Fig. 8. PV optimal capacity installed by 2050 in the residential sector (SFH and MFH) the percentage of the maximum potential (top of the bars). The optimal capacities are shown for the three retrofitting scenarios (y-coordinate) and the three HP deployment scenarios (x-coordinate).
optimal PV capacity to minimise the total system cost. This sectorcoupling flexibility addition is shown in Fig. 9, where the operation of HP shifts from night-time in 2020 (22 h-4 h) to a day-time operation in 2050, with 53% of the heat production occurring between 10-16 h, i.e. driven by PV generation. Therefore, HP operation more and more occurs during time PV generation as the PV capacity gradually ramps up over the decades.

Sensitivity to distribution capacity
Previous results are based on the distribution grid capacities defined in Section 2.6 for each urban setting. To assess the sensitivity of PV and storage deployment with respect to the distribution grid capacity ( ), we vary these values from (−5)−(+15)%, in 5% steps for each archetype and across all HP and retrofitting combinations. Fig. 10 shows the impact of variations on the optimal PV capacity. A higher value of should increase PV capacity since it enables PV export among various archetypes and, overall our results are in line with this effect. However for SFH and MFH, under the three scenarios with the highest heat demand (i.e. >23.5 TWh th p.a.) the trend reverses (i.e. the PV capacity decreases with increased . This can be explained as follows: With a value of −5%), electricity imports from the main grid are constrained and local PV should be installed in order to power heat supply (mainly in SFH). On the other hand, a higher value of means that low cost electricity can be imported from the other archetypes, with the PV capacity decreasing as a result. It is due to the combination of the decreasing levelised cost of PV (see Appendix, Table C.2) and the increasing CO 2 and fuel prices (see Appendix, D.3 over the decades, making PV electricity cheaper than the wholesale market. Regarding non-residential consumer types, we observe that for IND, PV capacity is not sensitive to , which is explained by the fact that PV already reaches its maximum potential with value of −5%. In OCO, PV reaches its full potential only with a +5% . Regarding storage, optimal capacities decrease with an increasing , i.e. distribution capacity and storage becomes substitutes. This is the case for VRFB, as shown in Fig. 11, in particular for scenarios with large heat demand in SFH and MFH (i.e. low deployment of energy retrofitting and HP). Likewise, LiB exhibit a similar sensitivity as shown in Fig. 12. Only in OCO, LiB capacity increases slightly with , following the small changes in PV capacity. For the other consumer types, a value of −5% is compensated by a higher LiB capacity (up to almost +3 GW for Fossil + 1%) while a value of +5% reduces the LiB capacity, mainly for MFH and regardless of the deployment of energy retrofitting and HP.

Discussion
Our results can be used to identify the optimal energy system investments (PV, energy storage) to decarbonise the heat demand of the residential sector. We find that the higher the HP deployment is, the more electricity storage is needed to provide flexibility and to minimise the total energy system cost. Based on our HP and retrofitting scenarios, we see that storage technologies (LiB and VRFB) play an important role to support the deployment of HPs when these cover more than 75% of the residential heat demand (equivalent to 23.5 TWh th ). Importanly, HPs add flexibility to the power sector by increasing local PV selfconsumption [9], which results in lower energy costs and therefore a larger PV deployment. If sales of HPs follow a business-as-usual growth until 2050, the rate of energy retrofitting of buildings would have a limited impact on PV and energy storage investments. On the other hand, with a more accelerated HP deployment, our results pinpoint the importance of energy retrofitting of buildings to avoid costly storage investments. Furthermore, we show that a residential sector which is fully heated by HPs is feasible, and interestingly, energy retrofitting has the largest impact on storage deployment with more than twice the storage needed without energy retrofitting compared to 1%-2% retrofitting rate p.a..   Based on our results, we recommend that a combination of storage technologies with both short-term (Li-ion batteries, 2 h) and mid-term (Vanadium Redox flow batteries, 4 h) discharge duration are needed to minimise the energy system costs. Interestingly, we can draw a comparison between the sensitivity analysis on distribution grid capacity and the future diffusion of PV. A larger distribution grid capacity can be interpreted as an upgrade whereas a lower value corresponds to a relative increase of the peak electricity demand (e.g., due to the further deployment of electric vehicles, which are not analysed in our study). Our sensitivity analysis demonstrates that storage and distribution grid capacity upgrades are substituting flexibility options. A combination of distribution grid capacity expansion and storage results in more cost-effective PV deployment. This conclusion may hold for other renewable and low carbon technologies, beyond PV. We also compare our results with a previous study using the same modelling framework and methodology but without including the electrification of the heating sector [38]. With a 1% p.a. energy retrofitting rate for buildings, HPs induce a 13%-19% increase of the optimal PV capacity for Switzerland by 2050 depending on the HP scenario. The same scenarios (1% retrofitting p.a. with different HP deployment) require 29%-63% additional storage capacity in power terms (42%-83% in energy terms). Table 5 shows a detailed comparison between this study and the previous study without heat pumps. For example,PV self-consumption rates remain similar in both studies but HPs add flexibilty which results in a higher PV capacity. Moreover, the local use of PV for electric heating reduces the peak demand induced by HPs to the level of the conventional electricity peak demand. Based on our results, we recommend avenues of action to decarbonise the residential heat demand, which are therefore important for policy makers and utility companies. Our results indicate that decarbonisation plans for A. Rinaldi et al.  buildings should focus first on suburban areas (where the heat demand is the largest) and consider that energy retrofitting helps to avoid large investments in electricity storage. Regarding PV, future policies should first focus on single-family houses (especially in rural areas), since they represent the highest unexploited PV capacity potential under a cost-optimal solution. GRIMSEL-AH is a social planner model which couples residential heat demand to the power system in the context of the energy transition. It thereby allows to identify the technology mix which minimises the total system's cost. However, in a real current policy context, the combined effect of the decisions of the various stakeholders does not coincide with the social optimum unless targeted policies are implemented, and all actors fully comply with them. Nevertheless, our modelling framework provides a basis for better understanding the challenges and opportunities related to optimal planning considering various consumer characteristics with some assumptions and its limitations, which in turn call for future research on the following topics: • Domestic hot water (DHW) along with heat storage technologies can also be considered to offer additional flexibility to the system. • Average COP values were assumed between low (L/T) and high (H/T) temperature-based HPs. Distinguishing between these two temperature levels for HP performing among the various archetypes would impact the results. • Among all power generation technologies, only PV capacity is optimised, while others supply options are exogenously set. Additional power technologies could be further optimised, e.g., wind power. Furthermore, curtailment of renewable generation could be considered as an alternative flexibility option. • The profile of the future electricity demand is modelled assuming a proportional increase over the current profile (excluding HP operation). However, energy efficiency measures and low carbon technologies such as electric vehicles will modify the demand profiles [60,61], resulting in different PV self-consumption rates and thus optimal PV and storage capacities. • GRIMSEL-AH includes distribution capacity constraints but the transmission capacity could also be modelled. Furthermore, investments costs for distribution capacity upgrade can be internalised (i.e. become a variable), as a flexibility alternative to energy storage. • Due to the lack of detailed projections, new buildings constructed after 2015 are not considered in our study. This assumption should lead to an underestimation of the future heat demand, PV deployment and related storage capacity. New buildings will, however, cause a relatively limited increase in heat demand due to high efficiency standards. • Li-ion battery is a more mature technology than Vanadium Redox Flow battery which makes techno-economic input data more reliable for Li-ion. • More storage technologies such as compressed-air energy storage and seasonal heat storage could also be incorporated in future studies.
As next step, GRIMSEL-AH will be expanded to include demandside management [62,63], which is an important competitor for energy storage. Finally, extending GRIMSEL-AH to the hydrogen sector would allow to better represent the energy system as a whole.

Conclusions
We present an open-source sector coupling model, GRIMSEL-AH, which distinguishes among various types of consumers and urban settings to capture the increasing complexity of the power sector and integration of heat demand. GRIMSEL-AH uses daily heat demand simulated for every residential building and monitored electricity demand profiles from all types of consumers in Switzerland. GRIMSEL-AH and the methodology presented in this study for Switzerland can be applied to any country/region. We find that under a ''business as usual'' deployment of heat pumps and energy retrofitting, optimal electricity investments for Switzerland by 2050 correspond to 27.8 GW p of PV, combined with 16.9 GW (33.8 GWh) for lithium-ion batteries and 1.9 GW (7.6 GWh) for vanadium redox flow batteries. For this case, 57% (13.3 TW th /year) of the residential heat demand is provided by heat pumps with a total install capacity of 19.7 GW th . Furthermore, we find that the replacement of current residential heating systems by heat pumps is feasible with additional energy system investments as follows: up to more than three times the storage capacity (depending on the retrofitting rate) along with 19.1% increase in PV deployment compare to the ''business as usual'' deployment of heat pumps. We also find that the larger share of heat pumps is, the more marked the impact of retrofitting rates on storage investment becomes, ranging from 41. 3-139.9 GWh (equivalent to the total Li-ion and Vanadium Redox Flow battery energy capacities). Importantly, our results point to the additional flexibility provided by heat pumps to the power system. We find a shift of heat pump operation from night to midday which increases local PV self-consumption, resulting in larger PV deployment.
In order to better understand the substitution mechanisms between storage and distribution capacity, we investigate the sensitivity of storage deployment to distribution grid capacity. With a 5% distribution capacity reduction (regarding peak electricity demand), energy storage capacity increases by 2-31% by 2050 depending on the heat pump and retrofitting rates. On the other hand, a 5% increase in distribution grid capacities leads to a 2%-24% reduction of optimal storage capacity by 2050 depending on the type of urban setting, and up to more than half of the total storage capacity is required for a 15% increase. Therefore, we conclude that, for energy systems with large PV deployment connected to heat electrification, storage plays a role in minimising the total cost but also in satisfying the distribution capacity constraints by increasing the overall flexibility of the system.
Our results suggest that policy makers and utility companies should target first envelope retrofitting to avoid large investment in electricity storage technologies. Also, they should focus on suburban areas to decarbonise the residential heating sector where the largest share of heat demand is located. Finally, policy incentives for PV and storage should first target single-family houses, especially in rural settings. This results from a combination of large PV potential with a poor match between the PV generation and electricity demand.