From 91be48e36f42cc876e3ab999370f93b33988f212 Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Wed, 9 Aug 2023 10:58:14 +0200 Subject: [PATCH 1/6] Add option for carbon capture in integrated steelworks. --- doc/release_notes.rst | 2 ++ scripts/prepare_sector_network.py | 47 +++++++++++++++++++++++++++++-- 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/doc/release_notes.rst b/doc/release_notes.rst index 70a73e2f..aab8f422 100644 --- a/doc/release_notes.rst +++ b/doc/release_notes.rst @@ -12,6 +12,8 @@ Upcoming Release * Updated Global Energy Monitor LNG terminal data to March 2023 version. +* Add option for carbon capture in integrated steelworks. + PyPSA-Eur 0.8.1 (27th July 2023) ================================ diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index d680da24..ff450c0a 100644 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -145,6 +145,8 @@ def define_spatial(nodes, options): spatial.coal = SimpleNamespace() spatial.coal.nodes = ["EU coal"] spatial.coal.locations = ["EU"] + spatial.gas.industry = ["coal for industry"] + spatial.gas.industry_cc = ["coal for industry CC"] # lignite spatial.lignite = SimpleNamespace() @@ -2896,14 +2898,55 @@ def add_industry(n, costs): + mwh_coal_per_mwh_coke * industrial_demand["coke"].sum() ) / nhours + n.madd( + "Bus", + spatial.coal.industry, + location=spatial.coal.locations, + carrier="coal for industry", + unit="MWh_LHV", + ) + n.madd( "Load", - "coal for industry", - bus=spatial.coal.nodes, + spatial.coal.industry, + bus=spatial.coal.industry, carrier="coal for industry", p_set=p_set, ) + n.madd( + "Link", + spatial.coal.industry, + bus0=spatial.coal.nodes, + bus1=spatial.coal.industry, + bus2="co2 atmosphere", + carrier="coal for industry", + p_nom_extendable=True, + p_min_pu=1.0, + efficiency=1.0, + efficiency2=costs.at["coal", "CO2 intensity"], + ) + + n.madd( + "Link", + spatial.coal.industry_cc, + bus0=spatial.coal.nodes, + bus1=spatial.coal.industry, + bus2="co2 atmosphere", + bus3=spatial.co2.nodes, + carrier="coal for industry CC", + p_min_pu=1.0, + p_nom_extendable=True, + capital_cost=costs.at["cement capture", "fixed"] + * costs.at["coal", "CO2 intensity"], + efficiency=0.9, + efficiency2=costs.at["coal", "CO2 intensity"] + * (1 - costs.at["cement capture", "capture_rate"]), + efficiency3=costs.at["coal", "CO2 intensity"] + * costs.at["cement capture", "capture_rate"], + lifetime=costs.at["cement capture", "lifetime"], + ) + def add_waste_heat(n): # TODO options? From 04202690936201d18ff0e4f58f9d06da9c345589 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 9 Aug 2023 09:02:38 +0000 Subject: [PATCH 2/6] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- scripts/prepare_sector_network.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index bcd82335..d968bf7e 100644 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -2885,7 +2885,9 @@ def add_industry(n, costs): p_set=p_set, ) - primary_steel = get(snakemake.config["industry"]["St_primary_fraction"], investment_year) + primary_steel = get( + snakemake.config["industry"]["St_primary_fraction"], investment_year + ) dri_steel = get(snakemake.config["industry"]["DRI_fraction"], investment_year) bof_steel = primary_steel - dri_steel From 830d9762efdc763111c22d3f3041f60a3a4766b2 Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Wed, 9 Aug 2023 11:03:42 +0200 Subject: [PATCH 3/6] fix typo in definition of coal in spatial namespace --- scripts/prepare_sector_network.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index bcd82335..bf564ee0 100644 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -145,8 +145,8 @@ def define_spatial(nodes, options): spatial.coal = SimpleNamespace() spatial.coal.nodes = ["EU coal"] spatial.coal.locations = ["EU"] - spatial.gas.industry = ["coal for industry"] - spatial.gas.industry_cc = ["coal for industry CC"] + spatial.coal.industry = ["coal for industry"] + spatial.coal.industry_cc = ["coal for industry CC"] # lignite spatial.lignite = SimpleNamespace() From afda8ee1f65d29e523872bbf9974011254b14289 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 23 Aug 2023 07:37:26 +0000 Subject: [PATCH 4/6] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- scripts/add_existing_baseyear.py | 7 +++++-- scripts/build_industrial_distribution_key.py | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/add_existing_baseyear.py b/scripts/add_existing_baseyear.py index 269705a7..08810470 100644 --- a/scripts/add_existing_baseyear.py +++ b/scripts/add_existing_baseyear.py @@ -447,8 +447,11 @@ def add_heating_capacities_installed_before_baseyear( ) # if rural heating demand for one of the nodes doesn't exist, # then columns were dropped before and heating demand share should be 0.0 - if all(f"{node} {service} rural heat" in p_set_sum.index for service in ["residential", "services"]) - else 0. + if all( + f"{node} {service} rural heat" in p_set_sum.index + for service in ["residential", "services"] + ) + else 0.0 for node in nodal_df.index ], index=nodal_df.index, diff --git a/scripts/build_industrial_distribution_key.py b/scripts/build_industrial_distribution_key.py index 63299570..bc4a26bc 100644 --- a/scripts/build_industrial_distribution_key.py +++ b/scripts/build_industrial_distribution_key.py @@ -13,13 +13,14 @@ logger = logging.getLogger(__name__) import uuid from itertools import product +import country_converter as coco import geopandas as gpd import pandas as pd from packaging.version import Version, parse -import country_converter as coco cc = coco.CountryConverter() + def locate_missing_industrial_sites(df): """ Locate industrial sites without valid locations based on city and From 5d6d01f8c02f3f49e98ad47b279ce8b33e037c47 Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Thu, 23 Nov 2023 12:11:12 +0100 Subject: [PATCH 5/6] make CC in blast furnaces optional --- config/config.default.yaml | 1 + doc/configtables/sector.csv | 1 + scripts/prepare_sector_network.py | 40 ++++++++++++++++--------------- 3 files changed, 23 insertions(+), 19 deletions(-) diff --git a/config/config.default.yaml b/config/config.default.yaml index 7bae66d1..e0eb4c4c 100644 --- a/config/config.default.yaml +++ b/config/config.default.yaml @@ -446,6 +446,7 @@ sector: methanation: true helmeth: false coal_cc: false + coal_for_industry_cc: false dac: true co2_vent: false allam_cycle: false diff --git a/doc/configtables/sector.csv b/doc/configtables/sector.csv index d610c862..2ddf8584 100644 --- a/doc/configtables/sector.csv +++ b/doc/configtables/sector.csv @@ -73,6 +73,7 @@ marginal_cost_storage,currency/MWh ,float,The marginal cost of discharging batte methanation,--,"{true, false}",Add option for transforming hydrogen and CO2 into methane using methanation. helmeth,--,"{true, false}",Add option for transforming power into gas using HELMETH (Integrated High-Temperature ELectrolysis and METHanation for Effective Power to Gas Conversion) coal_cc,--,"{true, false}",Add option for coal CHPs with carbon capture +coal_for_industry_cc,--,"{true, false}",Add option for carbon capture in integrated steel making (blast furnaces) dac,--,"{true, false}",Add option for Direct Air Capture (DAC) co2_vent,--,"{true, false}",Add option for vent out CO2 from storages to the atmosphere. allam_cycle,--,"{true, false}",Add option to include `Allam cycle gas power plants `_ diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index eb6fb221..99daba83 100644 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -2940,25 +2940,27 @@ def add_industry(n, costs): efficiency2=costs.at["coal", "CO2 intensity"], ) - n.madd( - "Link", - spatial.coal.industry_cc, - bus0=spatial.coal.nodes, - bus1=spatial.coal.industry, - bus2="co2 atmosphere", - bus3=spatial.co2.nodes, - carrier="coal for industry CC", - p_min_pu=1.0, - p_nom_extendable=True, - capital_cost=costs.at["cement capture", "fixed"] - * costs.at["coal", "CO2 intensity"], - efficiency=0.9, - efficiency2=costs.at["coal", "CO2 intensity"] - * (1 - costs.at["cement capture", "capture_rate"]), - efficiency3=costs.at["coal", "CO2 intensity"] - * costs.at["cement capture", "capture_rate"], - lifetime=costs.at["cement capture", "lifetime"], - ) + if options.get("coal_for_industry_cc", False): + + n.madd( + "Link", + spatial.coal.industry_cc, + bus0=spatial.coal.nodes, + bus1=spatial.coal.industry, + bus2="co2 atmosphere", + bus3=spatial.co2.nodes, + carrier="coal for industry CC", + p_min_pu=1.0, + p_nom_extendable=True, + capital_cost=costs.at["cement capture", "fixed"] + * costs.at["coal", "CO2 intensity"], + efficiency=0.9, + efficiency2=costs.at["coal", "CO2 intensity"] + * (1 - costs.at["cement capture", "capture_rate"]), + efficiency3=costs.at["coal", "CO2 intensity"] + * costs.at["cement capture", "capture_rate"], + lifetime=costs.at["cement capture", "lifetime"], + ) def add_waste_heat(n): From 4c66908b74b5c3d2799673de759070968b56929d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 23 Nov 2023 11:11:46 +0000 Subject: [PATCH 6/6] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- scripts/prepare_sector_network.py | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index 99daba83..44b022c9 100644 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -2941,7 +2941,6 @@ def add_industry(n, costs): ) if options.get("coal_for_industry_cc", False): - n.madd( "Link", spatial.coal.industry_cc,