From 301d74f059ef72304ab75d5af3dfbdca54a6181f Mon Sep 17 00:00:00 2001 From: lisazeyen Date: Wed, 21 Oct 2020 14:30:26 +0200 Subject: [PATCH] add option for exogenously retrofitting, space heat demand is reduced before adding losses in DH --- config.default.yaml | 9 ++-- config.myopic.yaml | 9 ++-- scripts/prepare_sector_network.py | 77 +++++++------------------------ 3 files changed, 26 insertions(+), 69 deletions(-) diff --git a/config.default.yaml b/config.default.yaml index 3498a33b..a19516d1 100644 --- a/config.default.yaml +++ b/config.default.yaml @@ -78,10 +78,11 @@ sector: 'shipping_average_efficiency' : 0.4 #For conversion of fuel oil to propulsion in 2011 'time_dep_hp_cop' : True 'space_heating_fraction' : 1.0 #fraction of space heating active - 'retrofitting' : False - 'retroI-fraction' : 0.25 - 'retroII-fraction' : 0.55 - 'retrofitting-cost_factor' : 1.0 + 'retrofitting' : + 'retro_exogen': True # space heat demand savings exogenously + 'dE': 0.4 # reduction of space heat demand (applied before losses in DH) + 'retro_endogen': False # co-optimise space heat savings + 'retrofitting-cost_factor' : 1.0 'tes' : True 'tes_tau' : 3. 'boilers' : True diff --git a/config.myopic.yaml b/config.myopic.yaml index 454a8525..a0692ff5 100644 --- a/config.myopic.yaml +++ b/config.myopic.yaml @@ -78,10 +78,11 @@ sector: 'shipping_average_efficiency' : 0.4 #For conversion of fuel oil to propulsion in 2011 'time_dep_hp_cop' : True 'space_heating_fraction' : 1.0 #fraction of space heating active - 'retrofitting' : False - 'retroI-fraction' : 0.25 - 'retroII-fraction' : 0.55 - 'retrofitting-cost_factor' : 1.0 + 'retrofitting' : + 'retro_exogen': True # space heat demand savings exogenously + 'dE': [0.0, 0.1, 0.2, 0.5] # reduction of space heat demand per year (applied before losses in DH) + 'retro_endogen': False # co-optimise space heat savings + 'retrofitting-cost_factor' : 1.0 'tes' : True 'tes_tau' : 3. 'boilers' : True diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index f88d75ed..4f8a5e56 100644 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -1056,7 +1056,21 @@ def add_heat(network): urban_fraction = options['central_fraction']*pop_layout["urban"]/(pop_layout[["urban","rural"]].sum(axis=1)) - for name in ["residential rural","services rural","residential urban decentral","services urban decentral","urban central"]: + # building retrofitting, exogenously reduce space heat demand + if options["retrofitting"]["retro_exogen"]: + dE = options["retrofitting"]["dE"] + if snakemake.config["foresight"]=='myopic': + year = int(snakemake.wildcards.planning_horizons[-4:]) + dE = dE[snakemake.config["scenario"]["planning_horizons"].index(year)] + print("retrofitting exogenously, assumed space heat reduction of ", + dE) + for sector in sectors: + heat_demand[sector + " space"] = heat_demand[sector + " space"].apply(lambda x: retro_exogen(x, dE)) + + heat_systems = ["residential rural", "services rural", + "residential urban decentral","services urban decentral", + "urban central"] + for name in heat_systems: name_type = "central" if name == "urban central" else "decentral" @@ -1079,6 +1093,7 @@ def add_heat(network): if sector in name: heat_load = heat_demand[[sector + " water",sector + " space"]].groupby(level=1,axis=1).sum()[nodes[name]].multiply(factor) + if name == "urban central": heat_load = heat_demand.groupby(level=1,axis=1).sum()[nodes[name]].multiply(urban_fraction[nodes[name]]*(1+options['district_heating_loss'])) @@ -1269,66 +1284,6 @@ def add_heat(network): lifetime=costs.at['micro CHP','lifetime']) - #NB: this currently doesn't work for pypsa-eur model - if options['retrofitting']: - - retro_nodes = pd.Index(["DE"]) - - space_heat_demand = space_heat_demand[retro_nodes] - - square_metres = population[retro_nodes]/population['DE']*5.7e9 #HPI 3.4e9m^2 for DE res, 2.3e9m^2 for tert https://doi.org/10.1016/j.rser.2013.09.012 - - space_peak = space_heat_demand.max() - - space_pu = space_heat_demand.divide(space_peak) - - network.add("Carrier", "retrofitting") - - network.madd('Generator', - retro_nodes, - suffix=' retrofitting I', - bus=retro_nodes+' heat', - carrier="retrofitting", - p_nom_extendable=True, - p_nom_max=options['retroI-fraction']*space_peak*(1-urban_fraction), - p_max_pu=space_pu, - p_min_pu=space_pu, - capital_cost=options['retrofitting-cost_factor']*costs.at['retrofitting I','fixed']*square_metres/(options['retroI-fraction']*space_peak)) - - network.madd('Generator', - retro_nodes, - suffix=' retrofitting II', - bus=retro_nodes+' heat', - carrier="retrofitting", - p_nom_extendable=True, - p_nom_max=options['retroII-fraction']*space_peak*(1-urban_fraction), - p_max_pu=space_pu, - p_min_pu=space_pu, - capital_cost=options['retrofitting-cost_factor']*costs.at['retrofitting II','fixed']*square_metres/(options['retroII-fraction']*space_peak)) - - network.madd('Generator', - retro_nodes, - suffix=' urban retrofitting I', - bus=retro_nodes+' urban heat', - carrier="retrofitting", - p_nom_extendable=True, - p_nom_max=options['retroI-fraction']*space_peak*urban_fraction, - p_max_pu=space_pu, - p_min_pu=space_pu, - capital_cost=options['retrofitting-cost_factor']*costs.at['retrofitting I','fixed']*square_metres/(options['retroI-fraction']*space_peak)) - - network.madd('Generator', - retro_nodes, - suffix=' urban retrofitting II', - bus=retro_nodes+' urban heat', - carrier="retrofitting", - p_nom_extendable=True, - p_nom_max=options['retroII-fraction']*space_peak*urban_fraction, - p_max_pu=space_pu, - p_min_pu=space_pu, - capital_cost=options['retrofitting-cost_factor']*costs.at['retrofitting II','fixed']*square_metres/(options['retroII-fraction']*space_peak)) - - def create_nodes_for_heat_sector(): sectors = ["residential", "services"] # stores the different groups of nodes