From ade8a003c68447403e2ac1149073adbdf9cf2fe7 Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Wed, 9 Aug 2023 10:11:28 +0200 Subject: [PATCH 1/5] add coal and coke demand for integrated steelworks (closes #717) --- scripts/prepare_sector_network.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index 0c1faacc4..8d087b3b8 100644 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -2883,6 +2883,25 @@ def add_industry(n, costs): p_set=p_set, ) + primary_steel = snakemake.config["industry"]["St_primary_fraction"] + dri_steel = snakemake.config["industry"]["DRI_fraction"] + bof_steel = primary_steel - dri_steel + + if bof_steel > 0: + + add_carrier_buses(n, "coal") + + mwh_coal_per_mwh_coke = 1.366 # from eurostat energy balance + p_set = (industrial_demand["coal"].sum() + mwh_coal_per_mwh_coke * industrial_demand["coke"].sum()) / nhours + + n.madd( + "Load", + "coal for industry", + bus=spatial.coal.nodes, + carrier="coal for industry", + p_set=p_set, + ) + def add_waste_heat(n): # TODO options? From c32d5249e1152f620c60f1d158bb3b2f065abf55 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 08:12:49 +0000 Subject: [PATCH 2/5] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- scripts/prepare_sector_network.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index 8d087b3b8..d680da24a 100644 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -2888,11 +2888,13 @@ def add_industry(n, costs): bof_steel = primary_steel - dri_steel if bof_steel > 0: - add_carrier_buses(n, "coal") - mwh_coal_per_mwh_coke = 1.366 # from eurostat energy balance - p_set = (industrial_demand["coal"].sum() + mwh_coal_per_mwh_coke * industrial_demand["coke"].sum()) / nhours + mwh_coal_per_mwh_coke = 1.366 # from eurostat energy balance + p_set = ( + industrial_demand["coal"].sum() + + mwh_coal_per_mwh_coke * industrial_demand["coke"].sum() + ) / nhours n.madd( "Load", From 9a68730745a92252337337f3e0c9bc89d8a01436 Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Wed, 9 Aug 2023 11:01:58 +0200 Subject: [PATCH 3/5] fix: read investment year of time-dependent config --- 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 d680da24a..528eb32c5 100644 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -2883,8 +2883,8 @@ def add_industry(n, costs): p_set=p_set, ) - primary_steel = snakemake.config["industry"]["St_primary_fraction"] - dri_steel = snakemake.config["industry"]["DRI_fraction"] + 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 if bof_steel > 0: From ac04abb98c1e021a0ce8aa74ed331f4156a7a8e3 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:20 +0000 Subject: [PATCH 4/5] [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 528eb32c5..92d004f16 100644 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -2883,7 +2883,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 41a35ad1290a78b458ed670f33f33ad2a29910a5 Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Tue, 22 Aug 2023 11:53:02 +0200 Subject: [PATCH 5/5] bugfix: use of n.madd with singular value prevented --- scripts/prepare_sector_network.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index 92d004f16..0e2009259 100644 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -2900,7 +2900,8 @@ def add_industry(n, costs): n.madd( "Load", - "coal for industry", + spatial.coal.nodes, + suffix=" for industry", bus=spatial.coal.nodes, carrier="coal for industry", p_set=p_set,