From f2a636c62cbc3dca93eaf7df7ad6686012f1e8da Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Tue, 2 Jan 2024 18:12:49 +0100 Subject: [PATCH 1/2] bugfix: correct unit of capital_cost of Haber-Bosch --- scripts/prepare_sector_network.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index 2480754c..ac0b618b 100644 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -796,6 +796,8 @@ def add_ammonia(n, costs): "Bus", spatial.ammonia.nodes, location=spatial.ammonia.locations, carrier="NH3" ) + MWh_elec_per_MWh_NH3 = cf_industry["MWh_elec_per_tNH3_electrolysis"] / cf_industry["MWh_NH3_per_tNH3"] + n.madd( "Link", nodes, @@ -805,14 +807,10 @@ def add_ammonia(n, costs): bus2=nodes + " H2", p_nom_extendable=True, carrier="Haber-Bosch", - efficiency=1 - / ( - cf_industry["MWh_elec_per_tNH3_electrolysis"] - / cf_industry["MWh_NH3_per_tNH3"] - ), # output: MW_NH3 per MW_elec + efficiency=1 / MWh_elec_per_MWh_NH3, efficiency2=-cf_industry["MWh_H2_per_tNH3_electrolysis"] / cf_industry["MWh_elec_per_tNH3_electrolysis"], # input: MW_H2 per MW_elec - capital_cost=costs.at["Haber-Bosch", "fixed"], + capital_cost=costs.at["Haber-Bosch", "fixed"] / MWh_elec_per_MWh_NH3, lifetime=costs.at["Haber-Bosch", "lifetime"], ) From 2678fdef993eb2c0d1b325c4e260040ed2e19174 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 2 Jan 2024 17:13:34 +0000 Subject: [PATCH 2/2] [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 ac0b618b..1dc2b3ef 100644 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -796,7 +796,9 @@ def add_ammonia(n, costs): "Bus", spatial.ammonia.nodes, location=spatial.ammonia.locations, carrier="NH3" ) - MWh_elec_per_MWh_NH3 = cf_industry["MWh_elec_per_tNH3_electrolysis"] / cf_industry["MWh_NH3_per_tNH3"] + MWh_elec_per_MWh_NH3 = ( + cf_industry["MWh_elec_per_tNH3_electrolysis"] / cf_industry["MWh_NH3_per_tNH3"] + ) n.madd( "Link",