From e5e75b9bbd9883f7d264212928aa238368b65daf Mon Sep 17 00:00:00 2001 From: yerbol-akhmetov Date: Fri, 6 Dec 2024 14:27:38 +0500 Subject: [PATCH 1/5] re-organize H2 production technologies --- config.default.yaml | 7 +- scripts/prepare_sector_network.py | 305 +++++++++++++++--------------- 2 files changed, 159 insertions(+), 153 deletions(-) diff --git a/config.default.yaml b/config.default.yaml index 156454543..c1ff39b73 100644 --- a/config.default.yaml +++ b/config.default.yaml @@ -519,6 +519,11 @@ sector: set_color_shares: false blue_share: 0.40 pink_share: 0.05 + production: + h2_electrolyzer: true # regular H2 electrolyzer + SMR: true # regular steam methane reforming + SMR_CC: true # regular steam methane reforming with carbon capture + coal: spatial_coal: true shift_to_elec: true # If true, residential and services demand of coal is shifted to electricity. If false, the final energy demand of coal is disregarded @@ -669,8 +674,6 @@ sector: methanation: true helmeth: true dac: true - SMR: true - SMR CC: true cc_fraction: 0.9 cc: true space_heat_share: 0.6 # the share of space heating from all heating. Remainder goes to water heating. diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index 01ab70a7b..4aa9add77 100644 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -199,51 +199,164 @@ def add_hydrogen(n, costs): y=n.buses.loc[list(spatial.nodes)].y.values, ) - if snakemake.config["sector"]["hydrogen"]["hydrogen_colors"]: - n.madd( - "Bus", - nodes + " grid H2", - location=nodes, - carrier="grid H2", - x=n.buses.loc[list(nodes)].x.values, - y=n.buses.loc[list(nodes)].y.values, - ) + # Add hydrogen production technologies + h2_options = options.get("hydrogen", {}) - n.madd( - "Link", - nodes + " H2 Electrolysis", - bus0=nodes, - bus1=nodes + " grid H2", - p_nom_extendable=True, - carrier="H2 Electrolysis", - efficiency=costs.at["electrolysis", "efficiency"], - capital_cost=costs.at["electrolysis", "fixed"], - lifetime=costs.at["electrolysis", "lifetime"], - ) + if h2_options.get("hydrogen_colors", False): + if h2_options.get("production", {}).get("h2_electrolyzer", False): + n.madd( + "Bus", + nodes + " grid H2", + location=nodes, + carrier="grid H2", + x=n.buses.loc[list(nodes)].x.values, + y=n.buses.loc[list(nodes)].y.values, + ) - n.madd( - "Link", - nodes + " grid H2", - bus0=nodes + " grid H2", - bus1=nodes + " H2", - p_nom_extendable=True, - carrier="grid H2", - efficiency=1, - capital_cost=0, - ) + n.madd( + "Link", + nodes + " H2 Electrolysis", + bus0=nodes, + bus1=nodes + " grid H2", + p_nom_extendable=True, + carrier="H2 Electrolysis", + efficiency=costs.at["electrolysis", "efficiency"], + capital_cost=costs.at["electrolysis", "fixed"], + lifetime=costs.at["electrolysis", "lifetime"], + ) + + n.madd( + "Link", + nodes + " grid H2", + bus0=nodes + " grid H2", + bus1=nodes + " H2", + p_nom_extendable=True, + carrier="grid H2", + efficiency=1, + capital_cost=0, + ) + + if h2_options.get("production", {}).get("SMR", False): + n.madd( + "Bus", + spatial.nodes + " grey H2", + location=spatial.nodes, + carrier="grey H2", + x=n.buses.loc[list(spatial.nodes)].x.values, + y=n.buses.loc[list(spatial.nodes)].y.values, + ) + + n.madd( + "Link", + spatial.nodes + " SMR", + bus0=spatial.gas.nodes, + bus1=spatial.nodes + " grey H2", + bus2="co2 atmosphere", + p_nom_extendable=True, + carrier="SMR", + efficiency=costs.at["SMR", "efficiency"], + efficiency2=costs.at["gas", "CO2 intensity"], + capital_cost=costs.at["SMR", "fixed"], + lifetime=costs.at["SMR", "lifetime"], + ) + + n.madd( + "Link", + spatial.nodes + " grey H2", + bus0=spatial.nodes + " grey H2", + bus1=spatial.nodes + " H2", + carrier="grey H2", + capital_cost=0, + p_nom_extendable=True, + # lifetime=costs.at["battery inverter", "lifetime"], + ) + + if h2_options.get("production", {}).get("SMR_CC", False): + n.madd( + "Bus", + spatial.nodes + " blue H2", + location=spatial.nodes, + carrier="blue H2", + x=n.buses.loc[list(spatial.nodes)].x.values, + y=n.buses.loc[list(spatial.nodes)].y.values, + ) + + n.madd( + "Link", + spatial.nodes, + suffix=" SMR CC", + bus0=spatial.gas.nodes, + bus1=spatial.nodes + " blue H2", + bus2="co2 atmosphere", + bus3=spatial.co2.nodes, + p_nom_extendable=True, + carrier="SMR CC", + efficiency=costs.at["SMR CC", "efficiency"], + efficiency2=costs.at["gas", "CO2 intensity"] + * (1 - options["cc_fraction"]), + efficiency3=costs.at["gas", "CO2 intensity"] * options["cc_fraction"], + capital_cost=costs.at["SMR CC", "fixed"], + lifetime=costs.at["SMR CC", "lifetime"], + ) + + n.madd( + "Link", + spatial.nodes + " blue H2", + bus0=spatial.nodes + " blue H2", + bus1=spatial.nodes + " H2", + carrier="blue H2", + capital_cost=0, + p_nom_extendable=True, + # lifetime=costs.at["battery inverter", "lifetime"], + ) else: - n.madd( - "Link", - nodes + " H2 Electrolysis", - bus1=nodes + " H2", - bus0=nodes, - p_nom_extendable=True, - carrier="H2 Electrolysis", - efficiency=costs.at["electrolysis", "efficiency"], - capital_cost=costs.at["electrolysis", "fixed"], - lifetime=costs.at["electrolysis", "lifetime"], - ) + if h2_options.get("production", {}).get("h2_electrolyzer", False): + n.madd( + "Link", + nodes + " H2 Electrolysis", + bus1=nodes + " H2", + bus0=nodes, + p_nom_extendable=True, + carrier="H2 Electrolysis", + efficiency=costs.at["electrolysis", "efficiency"], + capital_cost=costs.at["electrolysis", "fixed"], + lifetime=costs.at["electrolysis", "lifetime"], + ) + + if h2_options.get("production", {}).get("SMR", False): + n.madd( + "Link", + spatial.nodes + " SMR", + bus0=spatial.gas.nodes, + bus1=spatial.nodes + " H2", + bus2="co2 atmosphere", + p_nom_extendable=True, + carrier="SMR", + efficiency=costs.at["SMR", "efficiency"], + efficiency2=costs.at["gas", "CO2 intensity"], + capital_cost=costs.at["SMR", "fixed"], + lifetime=costs.at["SMR", "lifetime"], + ) + + if h2_options.get("production", {}).get("SMR_CC", False): + n.madd( + "Link", + spatial.nodes, + suffix=" SMR CC", + bus0=spatial.gas.nodes, + bus1=spatial.nodes + " H2", + bus2="co2 atmosphere", + bus3=spatial.co2.nodes, + p_nom_extendable=True, + carrier="SMR CC", + efficiency=costs.at["SMR CC", "efficiency"], + efficiency2=costs.at["gas", "CO2 intensity"] + * (1 - options["cc_fraction"]), + efficiency3=costs.at["gas", "CO2 intensity"] * options["cc_fraction"], + capital_cost=costs.at["SMR CC", "fixed"], + lifetime=costs.at["SMR CC", "lifetime"], + ) n.madd( "Link", @@ -1170,116 +1283,6 @@ def h2_hc_conversions(n, costs): lifetime=costs.at["helmeth", "lifetime"], ) - if options["SMR CC"]: - if snakemake.config["sector"]["hydrogen"]["hydrogen_colors"]: - n.madd( - "Bus", - spatial.nodes + " blue H2", - location=spatial.nodes, - carrier="blue H2", - x=n.buses.loc[list(spatial.nodes)].x.values, - y=n.buses.loc[list(spatial.nodes)].y.values, - ) - - n.madd( - "Link", - spatial.nodes, - suffix=" SMR CC", - bus0=spatial.gas.nodes, - bus1=spatial.nodes + " blue H2", - bus2="co2 atmosphere", - bus3=spatial.co2.nodes, - p_nom_extendable=True, - carrier="SMR CC", - efficiency=costs.at["SMR CC", "efficiency"], - efficiency2=costs.at["gas", "CO2 intensity"] - * (1 - options["cc_fraction"]), - efficiency3=costs.at["gas", "CO2 intensity"] * options["cc_fraction"], - capital_cost=costs.at["SMR CC", "fixed"], - lifetime=costs.at["SMR CC", "lifetime"], - ) - - n.madd( - "Link", - spatial.nodes + " blue H2", - bus0=spatial.nodes + " blue H2", - bus1=spatial.nodes + " H2", - carrier="blue H2", - capital_cost=0, - p_nom_extendable=True, - # lifetime=costs.at["battery inverter", "lifetime"], - ) - - else: - n.madd( - "Link", - spatial.nodes, - suffix=" SMR CC", - bus0=spatial.gas.nodes, - bus1=spatial.nodes + " H2", - bus2="co2 atmosphere", - bus3=spatial.co2.nodes, - p_nom_extendable=True, - carrier="SMR CC", - efficiency=costs.at["SMR CC", "efficiency"], - efficiency2=costs.at["gas", "CO2 intensity"] - * (1 - options["cc_fraction"]), - efficiency3=costs.at["gas", "CO2 intensity"] * options["cc_fraction"], - capital_cost=costs.at["SMR CC", "fixed"], - lifetime=costs.at["SMR CC", "lifetime"], - ) - - if options["SMR"]: - if snakemake.config["sector"]["hydrogen"]["hydrogen_colors"]: - n.madd( - "Bus", - spatial.nodes + " grey H2", - location=spatial.nodes, - carrier="grey H2", - x=n.buses.loc[list(spatial.nodes)].x.values, - y=n.buses.loc[list(spatial.nodes)].y.values, - ) - - n.madd( - "Link", - spatial.nodes + " SMR", - bus0=spatial.gas.nodes, - bus1=spatial.nodes + " grey H2", - bus2="co2 atmosphere", - p_nom_extendable=True, - carrier="SMR", - efficiency=costs.at["SMR", "efficiency"], - efficiency2=costs.at["gas", "CO2 intensity"], - capital_cost=costs.at["SMR", "fixed"], - lifetime=costs.at["SMR", "lifetime"], - ) - - n.madd( - "Link", - spatial.nodes + " grey H2", - bus0=spatial.nodes + " grey H2", - bus1=spatial.nodes + " H2", - carrier="grey H2", - capital_cost=0, - p_nom_extendable=True, - # lifetime=costs.at["battery inverter", "lifetime"], - ) - - else: - n.madd( - "Link", - spatial.nodes + " SMR", - bus0=spatial.gas.nodes, - bus1=spatial.nodes + " H2", - bus2="co2 atmosphere", - p_nom_extendable=True, - carrier="SMR", - efficiency=costs.at["SMR", "efficiency"], - efficiency2=costs.at["gas", "CO2 intensity"], - capital_cost=costs.at["SMR", "fixed"], - lifetime=costs.at["SMR", "lifetime"], - ) - def add_shipping(n, costs): ports = pd.read_csv( From 659fb53b76eb6f80d86a7cca8102f83e837f6437 Mon Sep 17 00:00:00 2001 From: yerbol-akhmetov Date: Sat, 7 Dec 2024 18:45:43 +0500 Subject: [PATCH 2/5] add h2 production technologies --- config.default.yaml | 5 +- scripts/prepare_sector_network.py | 229 +++++++++++++++++++----------- 2 files changed, 150 insertions(+), 84 deletions(-) diff --git a/config.default.yaml b/config.default.yaml index c1ff39b73..963a98b9f 100644 --- a/config.default.yaml +++ b/config.default.yaml @@ -519,10 +519,7 @@ sector: set_color_shares: false blue_share: 0.40 pink_share: 0.05 - production: - h2_electrolyzer: true # regular H2 electrolyzer - SMR: true # regular steam methane reforming - SMR_CC: true # regular steam methane reforming with carbon capture + production: ["Electrolysis", "SMR", "SMR CC"] # ["Alkaline electrolyzer"] coal: spatial_coal: true diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index 4aa9add77..6c7f979a5 100644 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -199,11 +199,95 @@ def add_hydrogen(n, costs): y=n.buses.loc[list(spatial.nodes)].y.values, ) - # Add hydrogen production technologies + # Read hydrogen production options h2_options = options.get("hydrogen", {}) + h2_techs = h2_options.get("production", []) + # H2 production technologies by color + green_h2_techs = [ + "H2 Electrolysis", + "Alkaline electrolyzer", + "PEM electrolyzer", + "SOEC electrolyzer", + "Solid biomass steam reforming", + "Biomass gasification", + "Biomass gasification CC", + ] + grey_h2_techs = [ + "SMR", + "Natural gas steam reforming", + "Coal gasification", + "Heavy oil partial oxidation", + ] + blue_h2_techs = ["SMR CC", "Natural gas steam reforming CC", "Coal gasification CC"] + + # Dictionary containing distinct parameters of H2 production technologies + tech_params = { + "Solid biomass steam reforming": { + "bus0": spatial.biomass.nodes, + "bus1": spatial.nodes + " grid H2", + "efficiency2": costs.at["solid biomass", "CO2 intensity"], + }, + "Biomass gasification": { + "bus0": spatial.biomass.nodes, + "bus1": spatial.nodes + " grid H2", + "efficiency2": costs.at["solid biomass", "CO2 intensity"], + }, + "Biomass gasification CC": { + "bus0": spatial.biomass.nodes, + "bus1": spatial.nodes + " grid H2", + "bus3": spatial.co2.nodes, + "efficiency2": costs.at["solid biomass", "CO2 intensity"] + * (1 - options["cc_fraction"]), + "efficiency3": costs.at["solid biomass", "CO2 intensity"] + * options["cc_fraction"], + }, + "SMR": { + "bus0": spatial.gas.nodes, + "bus1": spatial.nodes + " grey H2", + "efficiency2": costs.at["gas", "CO2 intensity"], + }, + "SMR CC": { + "bus0": spatial.gas.nodes, + "bus1": spatial.nodes + " blue H2", + "efficiency2": costs.at["gas", "CO2 intensity"] + * (1 - options["cc_fraction"]), + "efficiency3": costs.at["gas", "CO2 intensity"] * options["cc_fraction"], + }, + "Natural gas steam reforming": { + "bus0": spatial.gas.nodes, + "bus1": spatial.nodes + " grey H2", + "efficiency2": costs.at["gas", "CO2 intensity"], + }, + "Natural gas steam reforming CC": { + "bus0": spatial.gas.nodes, + "bus1": spatial.nodes + " blue H2", + "efficiency2": costs.at["gas", "CO2 intensity"] + * (1 - options["cc_fraction"]), + "efficiency3": costs.at["gas", "CO2 intensity"] * options["cc_fraction"], + }, + "Coal gasification": { + "bus0": spatial.coal.nodes, + "bus1": spatial.nodes + " grey H2", + "efficiency2": costs.at["coal", "CO2 intensity"], + }, + "Coal gasification CC": { + "bus0": spatial.coal.nodes, + "bus1": spatial.nodes + " blue H2", + "bus3": spatial.co2.nodes, + "efficiency2": costs.at["coal", "CO2 intensity"] + * (1 - options["cc_fraction"]), + "efficiency3": costs.at["coal", "CO2 intensity"] * options["cc_fraction"], + }, + "Heavy oil partial oxidation": { + "bus0": spatial.oil.nodes, + "bus1": spatial.nodes + " grey H2", + "efficiency2": costs.at["oil", "CO2 intensity"], + }, + } if h2_options.get("hydrogen_colors", False): - if h2_options.get("production", {}).get("h2_electrolyzer", False): + # Add infrastructure for green hydrogen + if set(h2_techs) & set(green_h2_techs): n.madd( "Bus", nodes + " grid H2", @@ -213,18 +297,6 @@ def add_hydrogen(n, costs): y=n.buses.loc[list(nodes)].y.values, ) - n.madd( - "Link", - nodes + " H2 Electrolysis", - bus0=nodes, - bus1=nodes + " grid H2", - p_nom_extendable=True, - carrier="H2 Electrolysis", - efficiency=costs.at["electrolysis", "efficiency"], - capital_cost=costs.at["electrolysis", "fixed"], - lifetime=costs.at["electrolysis", "lifetime"], - ) - n.madd( "Link", nodes + " grid H2", @@ -236,7 +308,8 @@ def add_hydrogen(n, costs): capital_cost=0, ) - if h2_options.get("production", {}).get("SMR", False): + # Add infrastructure for grey hydrogen + if set(h2_techs) & set(grey_h2_techs): n.madd( "Bus", spatial.nodes + " grey H2", @@ -246,20 +319,6 @@ def add_hydrogen(n, costs): y=n.buses.loc[list(spatial.nodes)].y.values, ) - n.madd( - "Link", - spatial.nodes + " SMR", - bus0=spatial.gas.nodes, - bus1=spatial.nodes + " grey H2", - bus2="co2 atmosphere", - p_nom_extendable=True, - carrier="SMR", - efficiency=costs.at["SMR", "efficiency"], - efficiency2=costs.at["gas", "CO2 intensity"], - capital_cost=costs.at["SMR", "fixed"], - lifetime=costs.at["SMR", "lifetime"], - ) - n.madd( "Link", spatial.nodes + " grey H2", @@ -271,7 +330,8 @@ def add_hydrogen(n, costs): # lifetime=costs.at["battery inverter", "lifetime"], ) - if h2_options.get("production", {}).get("SMR_CC", False): + # Add infrastructure for blue hydrogen + if set(h2_techs) & set(blue_h2_techs): n.madd( "Bus", spatial.nodes + " blue H2", @@ -281,24 +341,6 @@ def add_hydrogen(n, costs): y=n.buses.loc[list(spatial.nodes)].y.values, ) - n.madd( - "Link", - spatial.nodes, - suffix=" SMR CC", - bus0=spatial.gas.nodes, - bus1=spatial.nodes + " blue H2", - bus2="co2 atmosphere", - bus3=spatial.co2.nodes, - p_nom_extendable=True, - carrier="SMR CC", - efficiency=costs.at["SMR CC", "efficiency"], - efficiency2=costs.at["gas", "CO2 intensity"] - * (1 - options["cc_fraction"]), - efficiency3=costs.at["gas", "CO2 intensity"] * options["cc_fraction"], - capital_cost=costs.at["SMR CC", "fixed"], - lifetime=costs.at["SMR CC", "lifetime"], - ) - n.madd( "Link", spatial.nodes + " blue H2", @@ -310,52 +352,79 @@ def add_hydrogen(n, costs): # lifetime=costs.at["battery inverter", "lifetime"], ) - else: - if h2_options.get("production", {}).get("h2_electrolyzer", False): + # Add hydrogen production technologies + for h2_tech in h2_techs: + # Set H2 buses as production output if colors are not used + if not h2_options.get("hydrogen_colors", False): + tech_params[h2_tech]["bus1"] = spatial.nodes + " H2" + + # Add electrolysis based green H2 production technologies (links with 2 buses) + if h2_tech in [ + "H2 Electrolysis", + "Alkaline electrolyzer", + "PEM electrolyzer", + "SOEC electrolyzer", + ]: + # H2 production technology name in costs file + costs_name = "electrolysis" if h2_tech == "H2 Electrolysis" else h2_tech + n.madd( "Link", - nodes + " H2 Electrolysis", - bus1=nodes + " H2", - bus0=nodes, + nodes + " " + h2_tech, + bus0=spatial.nodes, + bus1=( + spatial.nodes + " grid H2" + if h2_options.get("hydrogen_colors", False) + else spatial.nodes + " H2" + ), p_nom_extendable=True, - carrier="H2 Electrolysis", - efficiency=costs.at["electrolysis", "efficiency"], - capital_cost=costs.at["electrolysis", "fixed"], - lifetime=costs.at["electrolysis", "lifetime"], + carrier=h2_tech, + efficiency=costs.at[costs_name, "efficiency"], + capital_cost=costs.at[costs_name, "fixed"], + lifetime=costs.at[costs_name, "lifetime"], ) - - if h2_options.get("production", {}).get("SMR", False): + # Add H2 production technologies without carbon capture technologies (links with 3 buses) + if h2_tech in [ + "Solid biomass steam reforming", + "Biomass gasification", + "SMR", + "Natural gas steam reforming", + "Coal gasification", + "Heavy oil partial oxidation", + ]: n.madd( "Link", - spatial.nodes + " SMR", - bus0=spatial.gas.nodes, - bus1=spatial.nodes + " H2", + spatial.nodes + " " + h2_tech, + bus0=tech_params[h2_tech]["bus0"], + bus1=tech_params[h2_tech]["bus1"], bus2="co2 atmosphere", p_nom_extendable=True, - carrier="SMR", - efficiency=costs.at["SMR", "efficiency"], - efficiency2=costs.at["gas", "CO2 intensity"], - capital_cost=costs.at["SMR", "fixed"], - lifetime=costs.at["SMR", "lifetime"], + carrier=h2_tech, + efficiency=costs.at[h2_tech, "efficiency"], + efficiency2=tech_params[h2_tech]["efficiency2"], + capital_cost=costs.at[h2_tech, "fixed"], + lifetime=costs.at[h2_tech, "lifetime"], ) - - if h2_options.get("production", {}).get("SMR_CC", False): + # Add H2 production technologies with carbon capture technologies (links with 4 buses) + if h2_tech in [ + "Biomass gasification CC", + "Natural gas steam reforming CC", + "Coal gasification CC", + ]: n.madd( "Link", - spatial.nodes, - suffix=" SMR CC", - bus0=spatial.gas.nodes, - bus1=spatial.nodes + " H2", + spatial.nodes + " " + h2_tech, + bus0=tech_params[h2_tech]["bus0"], + bus1=tech_params[h2_tech]["bus1"], bus2="co2 atmosphere", bus3=spatial.co2.nodes, p_nom_extendable=True, - carrier="SMR CC", - efficiency=costs.at["SMR CC", "efficiency"], - efficiency2=costs.at["gas", "CO2 intensity"] - * (1 - options["cc_fraction"]), - efficiency3=costs.at["gas", "CO2 intensity"] * options["cc_fraction"], - capital_cost=costs.at["SMR CC", "fixed"], - lifetime=costs.at["SMR CC", "lifetime"], + carrier=h2_tech, + efficiency=costs.at[h2_tech, "efficiency"], + efficiency2=tech_params[h2_tech]["efficiency2"], + efficiency3=tech_params[h2_tech]["efficiency3"], + capital_cost=costs.at[h2_tech, "fixed"], + lifetime=costs.at[h2_tech, "lifetime"], ) n.madd( From fb79ed30cf9c489156a020bbf47a11a2b28eb843 Mon Sep 17 00:00:00 2001 From: yerbol-akhmetov Date: Sat, 7 Dec 2024 20:29:45 +0500 Subject: [PATCH 3/5] add comment and fix minor bugs --- config.default.yaml | 2 +- scripts/prepare_sector_network.py | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/config.default.yaml b/config.default.yaml index 963a98b9f..cfe3be7cf 100644 --- a/config.default.yaml +++ b/config.default.yaml @@ -519,7 +519,7 @@ sector: set_color_shares: false blue_share: 0.40 pink_share: 0.05 - production: ["Electrolysis", "SMR", "SMR CC"] # ["Alkaline electrolyzer"] + production: ["H2 Electrolysis", "SMR", "SMR CC"] # ["Alkaline electrolyzer", "PEM electrolyzer", "SOEC electrolyzer", "Solid biomass steam reforming", "Biomass gasification", "Biomass gasification CC", "Natural gas steam reforming", "Natural gas steam reforming CC", "Coal gasification", "Coal gasification CC", "Heavy oil partial oxidation"] coal: spatial_coal: true diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index 6c7f979a5..4fd305b05 100644 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -222,6 +222,10 @@ def add_hydrogen(n, costs): # Dictionary containing distinct parameters of H2 production technologies tech_params = { + "H2 Electrolysis": {"bus1": spatial.nodes + " grid H2"}, + "Alkaline electrolyzer": {"bus1": spatial.nodes + " grid H2"}, + "PEM electrolyzer": {"bus1": spatial.nodes + " grid H2"}, + "SOEC electrolyzer": {"bus1": spatial.nodes + " grid H2"}, "Solid biomass steam reforming": { "bus0": spatial.biomass.nodes, "bus1": spatial.nodes + " grid H2", @@ -372,11 +376,7 @@ def add_hydrogen(n, costs): "Link", nodes + " " + h2_tech, bus0=spatial.nodes, - bus1=( - spatial.nodes + " grid H2" - if h2_options.get("hydrogen_colors", False) - else spatial.nodes + " H2" - ), + bus1=tech_params[h2_tech]["bus1"], p_nom_extendable=True, carrier=h2_tech, efficiency=costs.at[costs_name, "efficiency"], @@ -407,6 +407,7 @@ def add_hydrogen(n, costs): ) # Add H2 production technologies with carbon capture technologies (links with 4 buses) if h2_tech in [ + "SMR CC", "Biomass gasification CC", "Natural gas steam reforming CC", "Coal gasification CC", @@ -2852,12 +2853,13 @@ def remove_carrier_related_components(n, carriers_to_drop): # from helper import mock_snakemake #TODO remove func from here to helper script snakemake = mock_snakemake( "prepare_sector_network", + configfile="../../configs/calibration/config.NG_AC.yaml", simpl="", - clusters="19", - ll="c1.0", - opts="Co2L", + clusters="10", + ll="copt", + opts="Co2L-24H", planning_horizons="2030", - sopts="72H", + sopts="144H", discountrate="0.071", demand="AB", ) From f71bb7935373e33e81d839b222b6062ae3e83113 Mon Sep 17 00:00:00 2001 From: yerbol-akhmetov Date: Sat, 7 Dec 2024 20:39:48 +0500 Subject: [PATCH 4/5] revert mocksnakemake --- scripts/prepare_sector_network.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index 4fd305b05..f80764f73 100644 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -2853,13 +2853,12 @@ def remove_carrier_related_components(n, carriers_to_drop): # from helper import mock_snakemake #TODO remove func from here to helper script snakemake = mock_snakemake( "prepare_sector_network", - configfile="../../configs/calibration/config.NG_AC.yaml", simpl="", - clusters="10", - ll="copt", - opts="Co2L-24H", + clusters="19", + ll="c1.0", + opts="Co2L", planning_horizons="2030", - sopts="144H", + sopts="72H", discountrate="0.071", demand="AB", ) From 3bdf5ffab44ede5d6a1a9c944707b436a6682071 Mon Sep 17 00:00:00 2001 From: yerbol-akhmetov Date: Sat, 7 Dec 2024 23:44:53 +0500 Subject: [PATCH 5/5] rename to SOEC --- config.default.yaml | 2 +- scripts/prepare_sector_network.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config.default.yaml b/config.default.yaml index cfe3be7cf..aa8add2e7 100644 --- a/config.default.yaml +++ b/config.default.yaml @@ -519,7 +519,7 @@ sector: set_color_shares: false blue_share: 0.40 pink_share: 0.05 - production: ["H2 Electrolysis", "SMR", "SMR CC"] # ["Alkaline electrolyzer", "PEM electrolyzer", "SOEC electrolyzer", "Solid biomass steam reforming", "Biomass gasification", "Biomass gasification CC", "Natural gas steam reforming", "Natural gas steam reforming CC", "Coal gasification", "Coal gasification CC", "Heavy oil partial oxidation"] + production: ["H2 Electrolysis", "SMR", "SMR CC"] # ["Alkaline electrolyzer", "PEM electrolyzer", "SOEC", "Solid biomass steam reforming", "Biomass gasification", "Biomass gasification CC", "Natural gas steam reforming", "Natural gas steam reforming CC", "Coal gasification", "Coal gasification CC", "Heavy oil partial oxidation"] coal: spatial_coal: true diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index f80764f73..a5ae576de 100644 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -207,7 +207,7 @@ def add_hydrogen(n, costs): "H2 Electrolysis", "Alkaline electrolyzer", "PEM electrolyzer", - "SOEC electrolyzer", + "SOEC", "Solid biomass steam reforming", "Biomass gasification", "Biomass gasification CC", @@ -225,7 +225,7 @@ def add_hydrogen(n, costs): "H2 Electrolysis": {"bus1": spatial.nodes + " grid H2"}, "Alkaline electrolyzer": {"bus1": spatial.nodes + " grid H2"}, "PEM electrolyzer": {"bus1": spatial.nodes + " grid H2"}, - "SOEC electrolyzer": {"bus1": spatial.nodes + " grid H2"}, + "SOEC": {"bus1": spatial.nodes + " grid H2"}, "Solid biomass steam reforming": { "bus0": spatial.biomass.nodes, "bus1": spatial.nodes + " grid H2", @@ -367,7 +367,7 @@ def add_hydrogen(n, costs): "H2 Electrolysis", "Alkaline electrolyzer", "PEM electrolyzer", - "SOEC electrolyzer", + "SOEC", ]: # H2 production technology name in costs file costs_name = "electrolysis" if h2_tech == "H2 Electrolysis" else h2_tech