Redo investment-year-dependent exogenous retrofitting parameter

Specify as dictionary, use get_parameter to get correct value.

Also remove old parameter "space_heating_fraction" since this is
superceded by the new exogenous retro code.
This commit is contained in:
Tom Brown 2020-12-01 14:41:11 +01:00
parent 2b72aeb43c
commit 1ea31f0e57
3 changed files with 33 additions and 48 deletions

View File

@ -278,22 +278,21 @@ rule build_industrial_demand:
resources: mem_mb=1000 resources: mem_mb=1000
script: 'scripts/build_industrial_demand.py' script: 'scripts/build_industrial_demand.py'
if config['sector']['retrofitting'].get('retro_endogen', True): rule build_retro_cost:
rule build_retro_cost: input:
input: building_stock="data/retro/data_building_stock.csv",
building_stock="data/retro/data_building_stock.csv", u_values_PL="data/retro/u_values_poland.csv",
u_values_PL="data/retro/u_values_poland.csv", tax_w="data/retro/electricity_taxes_eu.csv",
tax_w="data/retro/electricity_taxes_eu.csv", construction_index="data/retro/comparative_level_investment.csv",
construction_index="data/retro/comparative_level_investment.csv", average_surface="data/retro/average_surface_components.csv",
average_surface="data/retro/average_surface_components.csv", floor_area_missing="data/retro/floor_area_missing.csv",
floor_area_missing="data/retro/floor_area_missing.csv", clustered_pop_layout="resources/pop_layout_{network}_s{simpl}_{clusters}.csv",
clustered_pop_layout="resources/pop_layout_{network}_s{simpl}_{clusters}.csv", cost_germany="data/retro/retro_cost_germany.csv",
cost_germany="data/retro/retro_cost_germany.csv", window_assumptions="data/retro/window_assumptions.csv"
window_assumptions="data/retro/window_assumptions.csv" output:
output: retro_cost="resources/retro_cost_{network}_s{simpl}_{clusters}.csv",
retro_cost="resources/retro_cost_{network}_s{simpl}_{clusters}.csv", floor_area="resources/floor_area_{network}_s{simpl}_{clusters}.csv"
floor_area="resources/floor_area_{network}_s{simpl}_{clusters}.csv" script: "scripts/build_retro_cost.py"
script: "scripts/build_retro_cost.py"
rule prepare_sector_network: rule prepare_sector_network:

View File

@ -100,17 +100,20 @@ sector:
'transport_internal_combustion_efficiency': 0.3 'transport_internal_combustion_efficiency': 0.3
'shipping_average_efficiency' : 0.4 #For conversion of fuel oil to propulsion in 2011 'shipping_average_efficiency' : 0.4 #For conversion of fuel oil to propulsion in 2011
'time_dep_hp_cop' : True 'time_dep_hp_cop' : True
'space_heating_fraction' : 1.0 #fraction of space heating active
'retrofitting' : 'retrofitting' :
'retro_exogen': False # space heat demand savings exogenously 'retro_exogen': True # space heat demand savings exogenously
'dE': 0.4 # reduction of space heat demand (applied before losses in DH) 'dE': # reduction of space heat demand (applied before losses in DH)
'retro_endogen': True # co-optimise space heat savings 2020 : 0.
'cost_factor' : 1.0 2030 : 0.15
'interest_rate': 0.04 # for investment in building components 2040 : 0.3
'annualise_cost': True # annualise the investment costs 2050 : 0.4
'tax_weighting': False # weight costs depending on taxes in countries 'retro_endogen': False # co-optimise space heat savings
'construction_index': True # weight costs depending on labour/material costs per ct 'cost_factor' : 1.0
'l_strength': ["0.076", "0.197"] # additional insulation thickness[m], determines number of retro steps(=generators per bus) and maximum possible savings 'interest_rate': 0.04 # for investment in building components
'annualise_cost': True # annualise the investment costs
'tax_weighting': False # weight costs depending on taxes in countries
'construction_index': True # weight costs depending on labour/material costs per ct
'l_strength': ["0.076", "0.197"] # additional insulation thickness[m], determines number of retro steps(=generators per bus) and maximum possible savings
'tes' : True 'tes' : True
'tes_tau' : 3. 'tes_tau' : 3.
'boilers' : True 'boilers' : True

View File

@ -114,13 +114,6 @@ def update_wind_solar_costs(n,costs):
n.generators.loc[n.generators.carrier==tech,'capital_cost'] = capital_cost.rename(index=lambda node: node + ' ' + tech) n.generators.loc[n.generators.carrier==tech,'capital_cost'] = capital_cost.rename(index=lambda node: node + ' ' + tech)
def retro_exogen(demand, dE):
"""
reduces space heat demand exogenously
demand: current space heat demand
dE: energy savings
"""
return demand * (1-dE)
def add_carrier_buses(n, carriers): def add_carrier_buses(n, carriers):
""" """
Add buses to connect e.g. coal, nuclear and oil plants Add buses to connect e.g. coal, nuclear and oil plants
@ -436,12 +429,10 @@ def prepare_data(network):
if use == "space": if use == "space":
heat_demand_shape = daily_space_heat_demand*intraday_year_profile heat_demand_shape = daily_space_heat_demand*intraday_year_profile
factor = options['space_heating_fraction']
else: else:
heat_demand_shape = intraday_year_profile heat_demand_shape = intraday_year_profile
factor = 1.
heat_demand["{} {}".format(sector,use)] = factor*(heat_demand_shape/heat_demand_shape.sum()).multiply(nodal_energy_totals["total {} {}".format(sector,use)])*1e6 heat_demand["{} {}".format(sector,use)] = (heat_demand_shape/heat_demand_shape.sum()).multiply(nodal_energy_totals["total {} {}".format(sector,use)])*1e6
electric_heat_supply["{} {}".format(sector,use)] = (heat_demand_shape/heat_demand_shape.sum()).multiply(nodal_energy_totals["electricity {} {}".format(sector,use)])*1e6 electric_heat_supply["{} {}".format(sector,use)] = (heat_demand_shape/heat_demand_shape.sum()).multiply(nodal_energy_totals["electricity {} {}".format(sector,use)])*1e6
heat_demand = pd.concat(heat_demand,axis=1) heat_demand = pd.concat(heat_demand,axis=1)
@ -458,7 +449,7 @@ def prepare_data(network):
## Get overall demand curve for all vehicles ## Get overall demand curve for all vehicles
traffic = pd.read_csv(snakemake.input.traffic_data + "KFZ__count", traffic = pd.read_csv(os.path.join(snakemake.input.traffic_data,"KFZ__count"),
skiprows=2)["count"] skiprows=2)["count"]
#Generate profiles #Generate profiles
@ -513,7 +504,7 @@ def prepare_data(network):
## derive plugged-in availability for PKW's (cars) ## derive plugged-in availability for PKW's (cars)
traffic = pd.read_csv(snakemake.input.traffic_data + "Pkw__count", traffic = pd.read_csv(os.path.join(snakemake.input.traffic_data,"Pkw__count"),
skiprows=2)["count"] skiprows=2)["count"]
avail_max = 0.95 avail_max = 0.95
@ -1087,14 +1078,11 @@ def add_heat(network):
# building retrofitting, exogenously reduce space heat demand # building retrofitting, exogenously reduce space heat demand
if options["retrofitting"]["retro_exogen"]: if options["retrofitting"]["retro_exogen"]:
dE = options["retrofitting"]["dE"] dE = get_parameter(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 ", print("retrofitting exogenously, assumed space heat reduction of ",
dE) dE)
for sector in sectors: for sector in sectors:
heat_demand[sector + " space"] = heat_demand[sector + " space"].apply(lambda x: retro_exogen(x, dE)) heat_demand[sector + " space"] = (1-dE)*heat_demand[sector + " space"]
heat_systems = ["residential rural", "services rural", heat_systems = ["residential rural", "services rural",
"residential urban decentral","services urban decentral", "residential urban decentral","services urban decentral",
@ -1934,11 +1922,6 @@ if __name__ == "__main__":
add_storage(n) add_storage(n)
for o in opts: for o in opts:
if "space" in o:
limit = o[o.find("space")+5:]
limit = float(limit.replace("p",".").replace("m","-"))
print(o,limit)
options['space_heating_fraction'] = limit
if o[:4] == "wave": if o[:4] == "wave":
wave_cost_factor = float(o[4:].replace("p",".").replace("m","-")) wave_cost_factor = float(o[4:].replace("p",".").replace("m","-"))
print("Including wave generators with cost factor of", wave_cost_factor) print("Including wave generators with cost factor of", wave_cost_factor)