From 00efffcc13f85ab61e64abdaf596f1f7e74cbbfc Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Mon, 20 May 2024 22:06:31 +0200 Subject: [PATCH] move up methanol for industry, to before shipping --- scripts/prepare_sector_network.py | 136 +++++++++++++++--------------- 1 file changed, 69 insertions(+), 67 deletions(-) diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index ecb1f2a2..0e4367d1 100755 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -2679,73 +2679,7 @@ def add_industry(n, costs): p_set=industrial_demand.loc[nodes, "hydrogen"] / nhours, ) - shipping_hydrogen_share = get(options["shipping_hydrogen_share"], investment_year) - shipping_methanol_share = get(options["shipping_methanol_share"], investment_year) - shipping_oil_share = get(options["shipping_oil_share"], investment_year) - - total_share = shipping_hydrogen_share + shipping_methanol_share + shipping_oil_share - if total_share != 1: - logger.warning( - f"Total shipping shares sum up to {total_share:.2%}, corresponding to increased or decreased demand assumptions." - ) - - domestic_navigation = pop_weighted_energy_totals.loc[ - nodes, "total domestic navigation" - ].squeeze() - international_navigation = ( - pd.read_csv(snakemake.input.shipping_demand, index_col=0).squeeze() * nyears - ) - all_navigation = domestic_navigation + international_navigation - p_set = all_navigation * 1e6 / nhours - - if shipping_hydrogen_share: - oil_efficiency = options.get( - "shipping_oil_efficiency", options.get("shipping_average_efficiency", 0.4) - ) - efficiency = oil_efficiency / costs.at["fuel cell", "efficiency"] - shipping_hydrogen_share = get( - options["shipping_hydrogen_share"], investment_year - ) - - if options["shipping_hydrogen_liquefaction"]: - n.madd( - "Bus", - nodes, - suffix=" H2 liquid", - carrier="H2 liquid", - location=nodes, - unit="MWh_LHV", - ) - - n.madd( - "Link", - nodes + " H2 liquefaction", - bus0=nodes + " H2", - bus1=nodes + " H2 liquid", - carrier="H2 liquefaction", - efficiency=costs.at["H2 liquefaction", "efficiency"], - capital_cost=costs.at["H2 liquefaction", "fixed"], - p_nom_extendable=True, - lifetime=costs.at["H2 liquefaction", "lifetime"], - ) - - shipping_bus = nodes + " H2 liquid" - else: - shipping_bus = nodes + " H2" - - efficiency = ( - options["shipping_oil_efficiency"] / costs.at["fuel cell", "efficiency"] - ) - p_set_hydrogen = shipping_hydrogen_share * p_set * efficiency - - n.madd( - "Load", - nodes, - suffix=" H2 for shipping", - bus=shipping_bus, - carrier="H2 for shipping", - p_set=p_set_hydrogen, - ) + # methanol for industry n.madd( "Bus", @@ -2825,6 +2759,74 @@ def add_industry(n, costs): efficiency3=-options["MWh_MeOH_per_MWh_H2"] / options["MWh_MeOH_per_tCO2"], ) + shipping_hydrogen_share = get(options["shipping_hydrogen_share"], investment_year) + shipping_methanol_share = get(options["shipping_methanol_share"], investment_year) + shipping_oil_share = get(options["shipping_oil_share"], investment_year) + + total_share = shipping_hydrogen_share + shipping_methanol_share + shipping_oil_share + if total_share != 1: + logger.warning( + f"Total shipping shares sum up to {total_share:.2%}, corresponding to increased or decreased demand assumptions." + ) + + domestic_navigation = pop_weighted_energy_totals.loc[ + nodes, "total domestic navigation" + ].squeeze() + international_navigation = ( + pd.read_csv(snakemake.input.shipping_demand, index_col=0).squeeze() * nyears + ) + all_navigation = domestic_navigation + international_navigation + p_set = all_navigation * 1e6 / nhours + + if shipping_hydrogen_share: + oil_efficiency = options.get( + "shipping_oil_efficiency", options.get("shipping_average_efficiency", 0.4) + ) + efficiency = oil_efficiency / costs.at["fuel cell", "efficiency"] + shipping_hydrogen_share = get( + options["shipping_hydrogen_share"], investment_year + ) + + if options["shipping_hydrogen_liquefaction"]: + n.madd( + "Bus", + nodes, + suffix=" H2 liquid", + carrier="H2 liquid", + location=nodes, + unit="MWh_LHV", + ) + + n.madd( + "Link", + nodes + " H2 liquefaction", + bus0=nodes + " H2", + bus1=nodes + " H2 liquid", + carrier="H2 liquefaction", + efficiency=costs.at["H2 liquefaction", "efficiency"], + capital_cost=costs.at["H2 liquefaction", "fixed"], + p_nom_extendable=True, + lifetime=costs.at["H2 liquefaction", "lifetime"], + ) + + shipping_bus = nodes + " H2 liquid" + else: + shipping_bus = nodes + " H2" + + efficiency = ( + options["shipping_oil_efficiency"] / costs.at["fuel cell", "efficiency"] + ) + p_set_hydrogen = shipping_hydrogen_share * p_set * efficiency + + n.madd( + "Load", + nodes, + suffix=" H2 for shipping", + bus=shipping_bus, + carrier="H2 for shipping", + p_set=p_set_hydrogen, + ) + if shipping_methanol_share: efficiency = ( options["shipping_oil_efficiency"] / options["shipping_methanol_efficiency"]