Make transformation of Steel and Aluminum production depends on year

Previously, the transformation of the Steel and Aluminum production was assumed to occur overnight.
This commit enables the definition of a transformation path via the config.yaml file.
This requires adding the {planning_horizon} to the input and output file name of the following rules:
build_industrial_production_per_country_tomorrow
build_industrial_production_per_node
build_industry_energy_demand_per_node
prepare_sector_network
This commit is contained in:
martavp 2021-06-17 16:13:05 +02:00
parent a57135b086
commit 0a92d23698
4 changed files with 52 additions and 18 deletions

View File

@ -189,7 +189,7 @@ rule build_industrial_production_per_country_tomorrow:
input: input:
industrial_production_per_country="resources/industrial_production_per_country.csv" industrial_production_per_country="resources/industrial_production_per_country.csv"
output: output:
industrial_production_per_country_tomorrow="resources/industrial_production_per_country_tomorrow.csv" industrial_production_per_country_tomorrow="resources/industrial_production_per_country_tomorrow_{planning_horizons}.csv"
threads: 1 threads: 1
resources: mem_mb=1000 resources: mem_mb=1000
script: 'scripts/build_industrial_production_per_country_tomorrow.py' script: 'scripts/build_industrial_production_per_country_tomorrow.py'
@ -214,9 +214,9 @@ rule build_industrial_distribution_key:
rule build_industrial_production_per_node: rule build_industrial_production_per_node:
input: input:
industrial_distribution_key="resources/industrial_distribution_key_elec_s{simpl}_{clusters}.csv", industrial_distribution_key="resources/industrial_distribution_key_elec_s{simpl}_{clusters}.csv",
industrial_production_per_country_tomorrow="resources/industrial_production_per_country_tomorrow.csv" industrial_production_per_country_tomorrow="resources/industrial_production_per_country_tomorrow_{planning_horizons}.csv"
output: output:
industrial_production_per_node="resources/industrial_production_elec_s{simpl}_{clusters}.csv" industrial_production_per_node="resources/industrial_production_elec_s{simpl}_{clusters}_{planning_horizons}.csv"
threads: 1 threads: 1
resources: mem_mb=1000 resources: mem_mb=1000
script: 'scripts/build_industrial_production_per_node.py' script: 'scripts/build_industrial_production_per_node.py'
@ -225,10 +225,10 @@ rule build_industrial_production_per_node:
rule build_industrial_energy_demand_per_node: rule build_industrial_energy_demand_per_node:
input: input:
industry_sector_ratios="resources/industry_sector_ratios.csv", industry_sector_ratios="resources/industry_sector_ratios.csv",
industrial_production_per_node="resources/industrial_production_elec_s{simpl}_{clusters}.csv", industrial_production_per_node="resources/industrial_production_elec_s{simpl}_{clusters}_{planning_horizons}.csv",
industrial_energy_demand_per_node_today="resources/industrial_energy_demand_today_elec_s{simpl}_{clusters}.csv" industrial_energy_demand_per_node_today="resources/industrial_energy_demand_today_elec_s{simpl}_{clusters}.csv"
output: output:
industrial_energy_demand_per_node="resources/industrial_energy_demand_elec_s{simpl}_{clusters}.csv" industrial_energy_demand_per_node="resources/industrial_energy_demand_elec_s{simpl}_{clusters}_{planning_horizons}.csv"
threads: 1 threads: 1
resources: mem_mb=1000 resources: mem_mb=1000
script: 'scripts/build_industrial_energy_demand_per_node.py' script: 'scripts/build_industrial_energy_demand_per_node.py'
@ -260,9 +260,9 @@ rule build_industrial_energy_demand_per_node_today:
rule build_industrial_energy_demand_per_country: rule build_industrial_energy_demand_per_country:
input: input:
industry_sector_ratios="resources/industry_sector_ratios.csv", industry_sector_ratios="resources/industry_sector_ratios.csv",
industrial_production_per_country="resources/industrial_production_per_country_tomorrow.csv" industrial_production_per_country="resources/industrial_production_per_country_tomorrow_{planning_horizons}.csv"
output: output:
industrial_energy_demand_per_country="resources/industrial_energy_demand_per_country.csv" industrial_energy_demand_per_country="resources/industrial_energy_demand_per_country_{planning_horizons}.csv"
threads: 1 threads: 1
resources: mem_mb=1000 resources: mem_mb=1000
script: 'scripts/build_industrial_energy_demand_per_country.py' script: 'scripts/build_industrial_energy_demand_per_country.py'
@ -271,9 +271,9 @@ rule build_industrial_energy_demand_per_country:
rule build_industrial_demand: rule build_industrial_demand:
input: input:
clustered_pop_layout="resources/pop_layout_elec_s{simpl}_{clusters}.csv", clustered_pop_layout="resources/pop_layout_elec_s{simpl}_{clusters}.csv",
industrial_demand_per_country="resources/industrial_energy_demand_per_country.csv" industrial_demand_per_country="resources/industrial_energy_demand_per_country_{planning_horizons}.csv"
output: output:
industrial_demand="resources/industrial_demand_elec_s{simpl}_{clusters}.csv" industrial_demand="resources/industrial_demand_elec_s{simpl}_{clusters}_{planning_horizons}.csv"
threads: 1 threads: 1
resources: mem_mb=1000 resources: mem_mb=1000
script: 'scripts/build_industrial_demand.py' script: 'scripts/build_industrial_demand.py'
@ -315,7 +315,7 @@ rule prepare_sector_network:
busmap=pypsaeur("resources/busmap_elec_s{simpl}_{clusters}.csv"), busmap=pypsaeur("resources/busmap_elec_s{simpl}_{clusters}.csv"),
clustered_pop_layout="resources/pop_layout_elec_s{simpl}_{clusters}.csv", clustered_pop_layout="resources/pop_layout_elec_s{simpl}_{clusters}.csv",
simplified_pop_layout="resources/pop_layout_elec_s{simpl}.csv", simplified_pop_layout="resources/pop_layout_elec_s{simpl}.csv",
industrial_demand="resources/industrial_energy_demand_elec_s{simpl}_{clusters}.csv", industrial_demand="resources/industrial_energy_demand_elec_s{simpl}_{clusters}_{planning_horizons}.csv",
heat_demand_urban="resources/heat_demand_urban_elec_s{simpl}_{clusters}.nc", heat_demand_urban="resources/heat_demand_urban_elec_s{simpl}_{clusters}.nc",
heat_demand_rural="resources/heat_demand_rural_elec_s{simpl}_{clusters}.nc", heat_demand_rural="resources/heat_demand_rural_elec_s{simpl}_{clusters}.nc",
heat_demand_total="resources/heat_demand_total_elec_s{simpl}_{clusters}.nc", heat_demand_total="resources/heat_demand_total_elec_s{simpl}_{clusters}.nc",

View File

@ -230,10 +230,32 @@ solving:
mem: 30000 #memory in MB; 20 GB enough for 50+B+I+H2; 100 GB for 181+B+I+H2 mem: 30000 #memory in MB; 20 GB enough for 50+B+I+H2; 100 GB for 181+B+I+H2
industry: industry:
'St_primary_fraction' : 0.3 # fraction of steel produced via primary route (DRI + EAF) versus secondary route (EAF); today fraction is 0.6 'St_primary_fraction' : # fraction of steel produced via primary route versus secondary route (scrap+EAF); today fraction is 0.6
2020: 0.6
2025: 0.55
2030: 0.5
2035: 0.45
2040: 0.4
2045: 0.35
2050: 0.3
'DRI_fraction' : # fraction of the primary route converted to DRI + EAF
2020: 0
2025: 0
2030: 0.05
2035: 0.2
2040: 0.4
2045: 0.7
2050: 1
'H2_DRI' : 1.7 #H2 consumption in Direct Reduced Iron (DRI), MWh_H2,LHV/ton_Steel from 51kgH2/tSt in Vogl et al (2018) doi:10.1016/j.jclepro.2018.08.279 'H2_DRI' : 1.7 #H2 consumption in Direct Reduced Iron (DRI), MWh_H2,LHV/ton_Steel from 51kgH2/tSt in Vogl et al (2018) doi:10.1016/j.jclepro.2018.08.279
'elec_DRI' : 0.322 #electricity consumption in Direct Reduced Iron (DRI) shaft, MWh/tSt HYBRIT brochure https://ssabwebsitecdn.azureedge.net/-/media/hybrit/files/hybrit_brochure.pdf 'elec_DRI' : 0.322 #electricity consumption in Direct Reduced Iron (DRI) shaft, MWh/tSt HYBRIT brochure https://ssabwebsitecdn.azureedge.net/-/media/hybrit/files/hybrit_brochure.pdf
'Al_primary_fraction' : 0.2 # fraction of aluminium produced via the primary route versus scrap; today fraction is 0.4 'Al_primary_fraction' : # fraction of aluminium produced via the primary route versus scrap; today fraction is 0.4
2020: 0.4
2025: 0.375
2030: 0.35
2035: 0.325
2040: 0.3
2045: 0.25
2050: 0.2
'MWh_CH4_per_tNH3_SMR' : 10.8 # 2012's demand from https://ec.europa.eu/docsroom/documents/4165/attachments/1/translations/en/renditions/pdf 'MWh_CH4_per_tNH3_SMR' : 10.8 # 2012's demand from https://ec.europa.eu/docsroom/documents/4165/attachments/1/translations/en/renditions/pdf
'MWh_elec_per_tNH3_SMR' : 0.7 # same source, assuming 94-6% split methane-elec of total energy demand 11.5 MWh/tNH3 'MWh_elec_per_tNH3_SMR' : 0.7 # same source, assuming 94-6% split methane-elec of total energy demand 11.5 MWh/tNH3
'MWh_H2_per_tNH3_electrolysis' : 6.5 # from https://doi.org/10.1016/j.joule.2018.04.017, around 0.197 tH2/tHN3 (>3/17 since some H2 lost and used for energy) 'MWh_H2_per_tNH3_electrolysis' : 6.5 # from https://doi.org/10.1016/j.joule.2018.04.017, around 0.197 tH2/tHN3 (>3/17 since some H2 lost and used for energy)

View File

@ -6,7 +6,8 @@ Future release
============== ==============
* Include new features here. * Include new features here.
The share of shipping transformed into hydrogen fuel cell can be now defined for different years in the ``config.yaml`` file. The carbon emission from the remaining share is treated as a negative load on the atmospheric carbon dioxide bus, just like aviation and land transport emissions. * The share of shipping transformed into hydrogen fuel cell can be now defined for different years in the ``config.yaml`` file. The carbon emission from the remaining share is treated as a negative load on the atmospheric carbon dioxide bus, just like aviation and land transport emissions.
* The transformation of the Steel and Aluminium production can be now defined for different years in the ``config.yaml`` file.
PyPSA-Eur-Sec 0.5.0 (21st May 2021) PyPSA-Eur-Sec 0.5.0 (21st May 2021)
=================================== ===================================

View File

@ -1,23 +1,34 @@
import pandas as pd import pandas as pd
def get_parameter(item):
"""Check whether it depends on investment year"""
if type(item) is dict:
return item[investment_year]
else:
return item
investment_year=int(snakemake.wildcards.planning_horizons[-4:])
industrial_production = pd.read_csv(snakemake.input.industrial_production_per_country, industrial_production = pd.read_csv(snakemake.input.industrial_production_per_country,
index_col=0) index_col=0)
total_steel = industrial_production[["Integrated steelworks","Electric arc"]].sum(axis=1) total_steel = industrial_production[["Integrated steelworks","Electric arc"]].sum(axis=1)
fraction_primary_stays_primary = snakemake.config["industry"]["St_primary_fraction"]*total_steel.sum()/industrial_production["Integrated steelworks"].sum() St_primary_fraction=get_parameter(snakemake.config["industry"]["St_primary_fraction"])
DRI_fraction=get_parameter(snakemake.config["industry"]["DRI_fraction"])
fraction_primary_stays_primary = St_primary_fraction*total_steel.sum()/industrial_production["Integrated steelworks"].sum()
industrial_production.insert(2, "DRI + Electric arc", industrial_production.insert(2, "DRI + Electric arc",
fraction_primary_stays_primary*industrial_production["Integrated steelworks"]) DRI_fraction*fraction_primary_stays_primary*industrial_production["Integrated steelworks"])
industrial_production["Electric arc"] = total_steel - industrial_production["DRI + Electric arc"] industrial_production["Integrated steelworks"] = (1-DRI_fraction)*fraction_primary_stays_primary*industrial_production["Integrated steelworks"]
industrial_production["Integrated steelworks"] = 0. industrial_production["Electric arc"] = total_steel - industrial_production["DRI + Electric arc"] - industrial_production["Integrated steelworks"]
Al_primary_fraction=get_parameter(snakemake.config["industry"]["Al_primary_fraction"])
total_aluminium = industrial_production[["Aluminium - primary production","Aluminium - secondary production"]].sum(axis=1) total_aluminium = industrial_production[["Aluminium - primary production","Aluminium - secondary production"]].sum(axis=1)
fraction_primary_stays_primary = snakemake.config["industry"]["Al_primary_fraction"]*total_aluminium.sum()/industrial_production["Aluminium - primary production"].sum() fraction_primary_stays_primary = Al_primary_fraction*total_aluminium.sum()/industrial_production["Aluminium - primary production"].sum()
industrial_production["Aluminium - primary production"] = fraction_primary_stays_primary*industrial_production["Aluminium - primary production"] industrial_production["Aluminium - primary production"] = fraction_primary_stays_primary*industrial_production["Aluminium - primary production"]
industrial_production["Aluminium - secondary production"] = total_aluminium - industrial_production["Aluminium - primary production"] industrial_production["Aluminium - secondary production"] = total_aluminium - industrial_production["Aluminium - primary production"]