From a90c2a2f4c773f3e7618b55caa723576b570137f Mon Sep 17 00:00:00 2001 From: BertoGBG Date: Mon, 28 Sep 2026 17:20:26 +0200 Subject: [PATCH 1/6] Add optional endogenous shipping fuel choice with LNG and methane slip - shipping_endogenous: optional endogenous shipping fuel choice (oil, methanol, LNG, hydrogen) against a single shipping demand; off by default - LNG as shipping fuel (exogenous shipping_lng_share or endogenous), with a shared CH4 liquefaction step - LNG engine methane slip (default 3.1%, FuelEU) counted as CO2-equivalent (GWP100 = 25) and deducted from the useful engine efficiency - config schema, defaults, tech colours and documentation Co-Authored-By: Claude Opus 5.5 --- config/config.default.yaml | 16 ++ config/plotting.default.yaml | 3 + config/schema.default.json | 186 ++++++++++++++- doc/configuration.md | 15 +- doc/release_notes.md | 1 + scripts/lib/validation/config/sector.py | 57 ++++- scripts/prepare_sector_network.py | 303 +++++++++++++++++++++++- 7 files changed, 568 insertions(+), 13 deletions(-) diff --git a/config/config.default.yaml b/config/config.default.yaml index 7941db2757..008a9429bb 100644 --- a/config/config.default.yaml +++ b/config/config.default.yaml @@ -820,6 +820,11 @@ sector: agriculture_machinery_fuel_efficiency: 0.7 agriculture_machinery_electric_efficiency: 0.3 shipping_hydrogen_liquefaction: false + shipping_endogenous: false + shipping_oil: true + shipping_methanol: true + shipping_lng: true + shipping_hydrogen: false shipping_hydrogen_share: 2020: 0 2025: 0 @@ -844,8 +849,19 @@ sector: 2040: 0.45 2045: 0.2 2050: 0 + shipping_lng_share: + 2020: 0 + 2025: 0 + 2030: 0 + 2035: 0 + 2040: 0 + 2045: 0 + 2050: 0 shipping_methanol_efficiency: 0.46 shipping_oil_efficiency: 0.4 + shipping_lng_efficiency: 0.45 + shipping_lng_methane_slip: 0.031 + shipping_methane_gwp100: 25.0 aviation_demand_factor: 1.0 HVC_demand_factor: 1.0 time_dep_hp_cop: true diff --git a/config/plotting.default.yaml b/config/plotting.default.yaml index 59be72c59a..b9ffabfcfd 100644 --- a/config/plotting.default.yaml +++ b/config/plotting.default.yaml @@ -450,6 +450,9 @@ plotting: gas for industry: '#853403' gas for industry CC: '#692e0a' gas pipeline: '#ebbca0' + LNG: '#f08a4b' + CH4 liquefaction: '#c7521a' + shipping LNG: '#a3471c' gas pipeline new: '#a87c62' # oil oil: '#c9c9c9' diff --git a/config/schema.default.json b/config/schema.default.json index 51dc76a446..307cb0db23 100644 --- a/config/schema.default.json +++ b/config/schema.default.json @@ -4553,25 +4553,97 @@ "description": "Whether to include liquefaction costs for hydrogen demand in shipping.", "type": "boolean" }, + "shipping_endogenous": { + "default": false, + "description": "If true, shipping fuel choice is endogenous: enabled fuels (shipping_oil/methanol/lng/hydrogen) compete on a shared per-node demand bus and the optimiser picks the cost-minimal mix. If false (default), the fixed year-indexed shipping_*_share values are used.", + "type": "boolean" + }, + "shipping_oil": { + "anyOf": [ + { + "type": "boolean" + }, + { + "additionalProperties": { + "type": "boolean" + }, + "type": "object" + } + ], + "default": true, + "description": "Whether oil is an available fuel for shipping." + }, + "shipping_methanol": { + "anyOf": [ + { + "type": "boolean" + }, + { + "additionalProperties": { + "type": "boolean" + }, + "type": "object" + } + ], + "default": true, + "description": "Whether methanol is an available fuel for shipping." + }, + "shipping_lng": { + "anyOf": [ + { + "type": "boolean" + }, + { + "additionalProperties": { + "type": "boolean" + }, + "type": "object" + } + ], + "default": true, + "description": "Whether LNG (drawn from the existing gas bus/network and liquefied) is an available fuel for shipping." + }, + "shipping_hydrogen": { + "anyOf": [ + { + "type": "boolean" + }, + { + "additionalProperties": { + "type": "boolean" + }, + "type": "object" + } + ], + "default": false, + "description": "Whether hydrogen is an available fuel for shipping." + }, "shipping_hydrogen_share": { "additionalProperties": { "type": "number" }, - "description": "The share of ships powered by hydrogen in a given year.", + "description": "The share of ships powered by hydrogen in a given year (exogenous mode only).", "type": "object" }, "shipping_methanol_share": { "additionalProperties": { "type": "number" }, - "description": "The share of ships powered by methanol in a given year.", + "description": "The share of ships powered by methanol in a given year (exogenous mode only).", "type": "object" }, "shipping_oil_share": { "additionalProperties": { "type": "number" }, - "description": "The share of ships powered by oil in a given year.", + "description": "The share of ships powered by oil in a given year (exogenous mode only).", + "type": "object" + }, + "shipping_lng_share": { + "additionalProperties": { + "type": "number" + }, + "description": "The share of ships powered by LNG in a given year (exogenous mode only). Gas is drawn from the gas bus and liquefied via CH4 liquefaction, as in endogenous mode.", "type": "object" }, "shipping_methanol_efficiency": { @@ -4585,6 +4657,21 @@ "description": "The efficiency of oil-powered ships in the conversion of oil to meet shipping needs (propulsion). Base value derived from 2011.", "type": "number" }, + "shipping_lng_efficiency": { + "default": 0.45, + "description": "Placeholder efficiency of LNG (dual-fuel) ship engines per unit of fuel actually burnt; the methane-slip share (shipping_lng_methane_slip) is deducted on top, so the useful efficiency is shipping_lng_efficiency * (1 - shipping_lng_methane_slip). Adjust once a technology-data-sourced figure is available.", + "type": "number" + }, + "shipping_lng_methane_slip": { + "default": 0.031, + "description": "Share of LNG fuel mass that leaves the ship engine unburnt as methane (methane slip). Default 3.1% is the FuelEU Maritime (Regulation (EU) 2023/1805, Annex II) default for LNG Otto dual-fuel medium-speed engines. Slipped methane delivers no propulsion work, is converted to CO2-equivalent with shipping_methane_gwp100 and counted against the CO2 limit.", + "type": "number" + }, + "shipping_methane_gwp100": { + "default": 25.0, + "description": "100-year global warming potential of methane used to convert LNG methane slip to CO2-equivalent. Default 25 (IPCC AR4), as used by FuelEU Maritime.", + "type": "number" + }, "aviation_demand_factor": { "default": 1.0, "description": "The proportion of demand for aviation compared to today's consumption.", @@ -11224,25 +11311,97 @@ "description": "Whether to include liquefaction costs for hydrogen demand in shipping.", "type": "boolean" }, + "shipping_endogenous": { + "default": false, + "description": "If true, shipping fuel choice is endogenous: enabled fuels (shipping_oil/methanol/lng/hydrogen) compete on a shared per-node demand bus and the optimiser picks the cost-minimal mix. If false (default), the fixed year-indexed shipping_*_share values are used.", + "type": "boolean" + }, + "shipping_oil": { + "anyOf": [ + { + "type": "boolean" + }, + { + "additionalProperties": { + "type": "boolean" + }, + "type": "object" + } + ], + "default": true, + "description": "Whether oil is an available fuel for shipping." + }, + "shipping_methanol": { + "anyOf": [ + { + "type": "boolean" + }, + { + "additionalProperties": { + "type": "boolean" + }, + "type": "object" + } + ], + "default": true, + "description": "Whether methanol is an available fuel for shipping." + }, + "shipping_lng": { + "anyOf": [ + { + "type": "boolean" + }, + { + "additionalProperties": { + "type": "boolean" + }, + "type": "object" + } + ], + "default": true, + "description": "Whether LNG (drawn from the existing gas bus/network and liquefied) is an available fuel for shipping." + }, + "shipping_hydrogen": { + "anyOf": [ + { + "type": "boolean" + }, + { + "additionalProperties": { + "type": "boolean" + }, + "type": "object" + } + ], + "default": false, + "description": "Whether hydrogen is an available fuel for shipping." + }, "shipping_hydrogen_share": { "additionalProperties": { "type": "number" }, - "description": "The share of ships powered by hydrogen in a given year.", + "description": "The share of ships powered by hydrogen in a given year (exogenous mode only).", "type": "object" }, "shipping_methanol_share": { "additionalProperties": { "type": "number" }, - "description": "The share of ships powered by methanol in a given year.", + "description": "The share of ships powered by methanol in a given year (exogenous mode only).", "type": "object" }, "shipping_oil_share": { "additionalProperties": { "type": "number" }, - "description": "The share of ships powered by oil in a given year.", + "description": "The share of ships powered by oil in a given year (exogenous mode only).", + "type": "object" + }, + "shipping_lng_share": { + "additionalProperties": { + "type": "number" + }, + "description": "The share of ships powered by LNG in a given year (exogenous mode only). Gas is drawn from the gas bus and liquefied via CH4 liquefaction, as in endogenous mode.", "type": "object" }, "shipping_methanol_efficiency": { @@ -11256,6 +11415,21 @@ "description": "The efficiency of oil-powered ships in the conversion of oil to meet shipping needs (propulsion). Base value derived from 2011.", "type": "number" }, + "shipping_lng_efficiency": { + "default": 0.45, + "description": "Placeholder efficiency of LNG (dual-fuel) ship engines per unit of fuel actually burnt; the methane-slip share (shipping_lng_methane_slip) is deducted on top, so the useful efficiency is shipping_lng_efficiency * (1 - shipping_lng_methane_slip). Adjust once a technology-data-sourced figure is available.", + "type": "number" + }, + "shipping_lng_methane_slip": { + "default": 0.031, + "description": "Share of LNG fuel mass that leaves the ship engine unburnt as methane (methane slip). Default 3.1% is the FuelEU Maritime (Regulation (EU) 2023/1805, Annex II) default for LNG Otto dual-fuel medium-speed engines. Slipped methane delivers no propulsion work, is converted to CO2-equivalent with shipping_methane_gwp100 and counted against the CO2 limit.", + "type": "number" + }, + "shipping_methane_gwp100": { + "default": 25.0, + "description": "100-year global warming potential of methane used to convert LNG methane slip to CO2-equivalent. Default 25 (IPCC AR4), as used by FuelEU Maritime.", + "type": "number" + }, "aviation_demand_factor": { "default": 1.0, "description": "The proportion of demand for aviation compared to today's consumption.", diff --git a/doc/configuration.md b/doc/configuration.md index cebd3bbf68..8ce104c76e 100644 --- a/doc/configuration.md +++ b/doc/configuration.md @@ -622,11 +622,20 @@ Only used for sector-coupling studies. | `agriculture_machinery_fuel_efficiency` | number | `0.7` | The efficiency of electric-powered machinery in the conversion of electricity to meet agricultural needs. | | `agriculture_machinery_electric_efficiency` | number | `0.3` | The efficiency of oil-powered machinery in the conversion of oil to meet agricultural needs. | | `shipping_hydrogen_liquefaction` | boolean | `false` | Whether to include liquefaction costs for hydrogen demand in shipping. | - | `shipping_hydrogen_share` | dict (str -> number) | | The share of ships powered by hydrogen in a given year. | - | `shipping_methanol_share` | dict (str -> number) | | The share of ships powered by methanol in a given year. | - | `shipping_oil_share` | dict (str -> number) | | The share of ships powered by oil in a given year. | + | `shipping_endogenous` | boolean | `false` | If true, shipping fuel choice is endogenous: enabled fuels (`shipping_oil`/`_methanol`/`_lng`/`_hydrogen`) compete on a shared per-node shipping demand bus and the optimiser picks the cost-minimal mix. If false (default), the fixed year-indexed `shipping_*_share` values are used. | + | `shipping_oil` | boolean \| dict (str -> boolean) | `true` | Whether oil is an available shipping fuel in endogenous mode (flat or year-indexed). | + | `shipping_methanol` | boolean \| dict (str -> boolean) | `true` | Whether methanol is an available shipping fuel in endogenous mode (flat or year-indexed). | + | `shipping_lng` | boolean \| dict (str -> boolean) | `true` | Whether LNG (gas from the gas bus, liquefied via `CH4 liquefaction`) is an available shipping fuel in endogenous mode (flat or year-indexed). | + | `shipping_hydrogen` | boolean \| dict (str -> boolean) | `false` | Whether hydrogen is an available shipping fuel in endogenous mode (flat or year-indexed). | + | `shipping_hydrogen_share` | dict (str -> number) | | The share of ships powered by hydrogen in a given year (exogenous mode only). | + | `shipping_methanol_share` | dict (str -> number) | | The share of ships powered by methanol in a given year (exogenous mode only). | + | `shipping_oil_share` | dict (str -> number) | | The share of ships powered by oil in a given year (exogenous mode only). | + | `shipping_lng_share` | dict (str -> number) | | The share of ships powered by LNG in a given year (exogenous mode only). Gas is drawn from the gas bus and liquefied via `CH4 liquefaction`, as in endogenous mode. | | `shipping_methanol_efficiency` | number | `0.46` | The efficiency of methanol-powered ships in the conversion of methanol to meet shipping needs (propulsion). The efficiency increase from oil can be 10-15% higher according to the [IEA ](https://www.iea-amf.org/app/webroot/files/file/Annex%20Reports/AMF_Annex_56.pdf). | | `shipping_oil_efficiency` | number | `0.4` | The efficiency of oil-powered ships in the conversion of oil to meet shipping needs (propulsion). Base value derived from 2011. | + | `shipping_lng_efficiency` | number | `0.45` | Placeholder efficiency of LNG (dual-fuel) ship engines per unit of fuel actually burnt; the useful efficiency is this value times (1 - `shipping_lng_methane_slip`). To be replaced by a technology-data value. | + | `shipping_lng_methane_slip` | number | `0.031` | Share of LNG fuel mass leaving ship engines unburnt as methane (methane slip). Default is the FuelEU Maritime (Regulation (EU) 2023/1805, Annex II) value for LNG Otto dual-fuel medium-speed engines. The slipped share delivers no propulsion work and is counted as CO2-equivalent against the CO2 limit. | + | `shipping_methane_gwp100` | number | `25.0` | 100-year global warming potential of methane used to convert LNG methane slip to CO2-equivalent (IPCC AR4, as in FuelEU Maritime). | | `aviation_demand_factor` | number | `1.0` | The proportion of demand for aviation compared to today's consumption. | | `HVC_demand_factor` | number | `1.0` | The proportion of demand for high-value chemicals compared to today's consumption. | | `time_dep_hp_cop` | boolean | `true` | Consider the time dependent coefficient of performance (COP) of the heat pump. | diff --git a/doc/release_notes.md b/doc/release_notes.md index 8431eed1d7..1fc87d4c40 100644 --- a/doc/release_notes.md +++ b/doc/release_notes.md @@ -5,6 +5,7 @@ +* feat: Add optional endogenous shipping fuel choice (`sector: shipping_endogenous`, default `false`). When enabled, oil, methanol, LNG and hydrogen compete on a shared per-node shipping demand bus and the optimiser picks the cost-minimal mix instead of following the fixed year-indexed shares. LNG is also available in the default fixed-share mode via the new year-indexed `sector: shipping_lng_share` (default 0); in both modes gas is liquefied through a per-node `CH4 liquefaction` step before bunkering. LNG engine methane slip (`sector: shipping_lng_methane_slip`, default 3.1% as in FuelEU Maritime) is counted as CO2-equivalent using `sector: shipping_methane_gwp100` (default 25) and deducted from the useful engine efficiency. ## PyPSA-Eur v2026.09.0 (25th September 2026) diff --git a/scripts/lib/validation/config/sector.py b/scripts/lib/validation/config/sector.py index 706e80dff3..d3817af27e 100644 --- a/scripts/lib/validation/config/sector.py +++ b/scripts/lib/validation/config/sector.py @@ -558,6 +558,33 @@ class SectorConfig(BaseModel): False, description="Whether to include liquefaction costs for hydrogen demand in shipping.", ) + shipping_endogenous: bool = Field( + False, + description="If true, shipping fuel choice is endogenous: enabled fuels (shipping_oil/methanol/lng/hydrogen) compete on a shared per-node demand bus and the optimiser picks the cost-minimal mix. If false (default), the fixed year-indexed shipping_*_share values are used.", + ) + # Endogenous shipping: each enabled fuel below competes on a shared + # per-node demand bus (add_shipping in prepare_sector_network.py); the + # optimiser picks the cost-minimal mix rather than following a fixed + # exogenous share. At least one of the four must be true (resolved per + # investment_year when given as a year-indexed dict). Each can be a + # flat bool, or a year-indexed dict (e.g. {2030: false, 2035: true}) to + # unlock/retire a fuel at a given planning horizon under myopic + # foresight. + shipping_oil: bool | dict[int, bool] = Field( + True, description="Whether oil is an available fuel for shipping." + ) + shipping_methanol: bool | dict[int, bool] = Field( + True, description="Whether methanol is an available fuel for shipping." + ) + shipping_lng: bool | dict[int, bool] = Field( + True, + description="Whether LNG (drawn from the existing gas bus/network and liquefied) is an available fuel for shipping.", + ) + shipping_hydrogen: bool | dict[int, bool] = Field( + False, description="Whether hydrogen is an available fuel for shipping." + ) + # Exogenous shipping (shipping_endogenous: false): fixed shares per year, + # should sum to 1. shipping_hydrogen_share: dict[int, float] = Field( default_factory=lambda: { 2020: 0, @@ -568,7 +595,7 @@ class SectorConfig(BaseModel): 2045: 0, 2050: 0, }, - description="The share of ships powered by hydrogen in a given year.", + description="The share of ships powered by hydrogen in a given year (exogenous mode only).", ) shipping_methanol_share: dict[int, float] = Field( default_factory=lambda: { @@ -580,7 +607,7 @@ class SectorConfig(BaseModel): 2045: 0.8, 2050: 1, }, - description="The share of ships powered by methanol in a given year.", + description="The share of ships powered by methanol in a given year (exogenous mode only).", ) shipping_oil_share: dict[int, float] = Field( default_factory=lambda: { @@ -592,7 +619,19 @@ class SectorConfig(BaseModel): 2045: 0.2, 2050: 0, }, - description="The share of ships powered by oil in a given year.", + description="The share of ships powered by oil in a given year (exogenous mode only).", + ) + shipping_lng_share: dict[int, float] = Field( + default_factory=lambda: { + 2020: 0, + 2025: 0, + 2030: 0, + 2035: 0, + 2040: 0, + 2045: 0, + 2050: 0, + }, + description="The share of ships powered by LNG in a given year (exogenous mode only). Gas is drawn from the gas bus and liquefied via CH4 liquefaction, as in endogenous mode.", ) shipping_methanol_efficiency: float = Field( 0.46, @@ -602,6 +641,18 @@ class SectorConfig(BaseModel): 0.40, description="The efficiency of oil-powered ships in the conversion of oil to meet shipping needs (propulsion). Base value derived from 2011.", ) + shipping_lng_efficiency: float = Field( + 0.45, + description="Placeholder efficiency of LNG (dual-fuel) ship engines per unit of fuel actually burnt; the methane-slip share (shipping_lng_methane_slip) is deducted on top, so the useful efficiency is shipping_lng_efficiency * (1 - shipping_lng_methane_slip). Adjust once a technology-data-sourced figure is available.", + ) + shipping_lng_methane_slip: float = Field( + 0.031, + description="Share of LNG fuel mass that leaves the ship engine unburnt as methane (methane slip). Default 3.1% is the FuelEU Maritime (Regulation (EU) 2023/1805, Annex II) default for LNG Otto dual-fuel medium-speed engines. Slipped methane delivers no propulsion work, is converted to CO2-equivalent with shipping_methane_gwp100 and counted against the CO2 limit.", + ) + shipping_methane_gwp100: float = Field( + 25.0, + description="100-year global warming potential of methane used to convert LNG methane slip to CO2-equivalent. Default 25 (IPCC AR4), as used by FuelEU Maritime.", + ) aviation_demand_factor: float = Field( 1.0, diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index fb1f6db651..e981194002 100755 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -5088,6 +5088,85 @@ def add_aviation( ) +def _add_lng_liquefaction( + n: pypsa.Network, + costs: pd.DataFrame, + nodes: pd.Index, + spatial: SimpleNamespace, +) -> None: + """ + Add a per-node " LNG" bus fed from the gas bus by a "CH4 + liquefaction" Link. Shared by the endogenous and exogenous shipping + implementations. + + Gas-fuelled shipping only exists in practice as LNG -- a ship cannot + bunker directly from a pipeline -- so liquefaction is unconditional + whenever LNG shipping is enabled. The step is electricity-driven, not + gas-combusting: CH4 passes through at efficiency=1 (technology-data + "methane-input" of 1.0) and the refrigeration load is drawn from the + node's electricity bus via bus2 ("electricity-input"). + """ + n.add( + "Bus", + nodes, + suffix=" LNG", + carrier="LNG", + location=nodes, + unit="MWh_LHV", + ) + + n.add( + "Link", + nodes + " CH4 liquefaction", + bus0=spatial.gas.df.loc[nodes, "nodes"].values, + bus1=nodes + " LNG", + bus2=nodes, + carrier="CH4 liquefaction", + efficiency=1.0, + efficiency2=-costs.at["CH4 liquefaction", "electricity-input"], + capital_cost=costs.at["CH4 liquefaction", "capital_cost"], + p_nom_extendable=True, + lifetime=costs.at["CH4 liquefaction", "lifetime"], + ) + + +def _shipping_lng_co2_equivalent(costs: pd.DataFrame, options: dict) -> float: + """ + Tank-to-wake CO2-equivalent emissions of LNG-fuelled shipping, in + tCO2eq per MWh_LHV of LNG fed to the engine. + + A share ``s = options["shipping_lng_methane_slip"]`` of the fuel (by + mass) leaves the engine unburnt as methane (FuelEU Maritime "Cslip"). + The burnt share emits combustion CO2, the slipped share is converted to + CO2eq with ``options["shipping_methane_gwp100"]``; both are routed to + "co2 atmosphere", so methane slip counts against the CO2 limit: + + (1 - s) * CO2 intensity of gas + s * m_CH4 * GWP100 + + with m_CH4 = 3.6 GJ / 50 MJ/kg = 0.072 t CH4 per MWh_LHV. The slipped + fuel also does no work: see ``_shipping_lng_useful_efficiency``. + """ + slip = options["shipping_lng_methane_slip"] + methane_t_per_mwh = 3.6 / 50.0 + return (1 - slip) * costs.at["gas", "CO2 intensity"] + slip * ( + methane_t_per_mwh * options["shipping_methane_gwp100"] + ) + + +def _shipping_lng_useful_efficiency(options: dict) -> float: + """ + Propulsion energy per MWh_LHV of LNG fed to the engine. + + ``options["shipping_lng_efficiency"]`` is the efficiency of the fuel + that is actually burnt; the slipped share + ``options["shipping_lng_methane_slip"]`` leaves unburnt and delivers no + work, so the useful efficiency is ``eta_LNG * (1 - slip)``. + """ + return options["shipping_lng_efficiency"] * ( + 1 - options["shipping_lng_methane_slip"] + ) + + def add_shipping( n: pypsa.Network, costs: pd.DataFrame, @@ -5100,6 +5179,23 @@ def add_shipping( ) -> None: logger.info("Add shipping") + if options.get("shipping_endogenous", False): + nodes = pop_layout.index + nhours = n.snapshot_weightings.generators.sum() + nyears = nhours / 8760 + domestic_navigation = pop_weighted_energy_totals.loc[ + nodes, ["total domestic navigation"] + ].squeeze() + international_navigation = ( + pd.read_csv(shipping_demand_file, index_col=0).squeeze(axis=1) * nyears + ) + all_navigation = domestic_navigation + international_navigation + p_set = all_navigation * 1e6 / nhours + _add_shipping_endogenous( + n, costs, p_set, nodes, options, spatial, investment_year + ) + return + nodes = pop_layout.index nhours = n.snapshot_weightings.generators.sum() nyears = nhours / 8760 @@ -5107,8 +5203,14 @@ def add_shipping( 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) + shipping_lng_share = get(options.get("shipping_lng_share", 0), investment_year) - total_share = shipping_hydrogen_share + shipping_methanol_share + shipping_oil_share + total_share = ( + shipping_hydrogen_share + + shipping_methanol_share + + shipping_oil_share + + shipping_lng_share + ) if total_share != 1: logger.warning( f"Total shipping shares sum up to {total_share:.2%}, corresponding to increased or decreased demand assumptions." @@ -5246,6 +5348,205 @@ def add_shipping( efficiency2=costs.at["oil", "CO2 intensity"], ) + if shipping_lng_share: + efficiency = options["shipping_oil_efficiency"] / ( + _shipping_lng_useful_efficiency(options) + ) + p_set_lng = ( + shipping_lng_share + * p_set.rename(lambda x: x + " shipping LNG") + * efficiency + ) + + _add_lng_liquefaction(n, costs, nodes, spatial) + + n.add( + "Bus", + nodes + " shipping LNG", + location=nodes, + carrier="shipping LNG", + unit="MWh_LHV", + ) + + n.add( + "Load", + nodes + " shipping LNG", + bus=nodes + " shipping LNG", + carrier="shipping LNG", + p_set=p_set_lng, + ) + + n.add( + "Link", + nodes + " shipping LNG", + bus0=nodes + " LNG", + bus1=nodes + " shipping LNG", + bus2="co2 atmosphere", + carrier="shipping LNG", + p_nom_extendable=True, + efficiency2=_shipping_lng_co2_equivalent(costs, options), + ) + + +def _add_shipping_endogenous( + n: pypsa.Network, + costs: pd.DataFrame, + p_set: pd.Series, + nodes: pd.Index, + options: dict, + spatial: SimpleNamespace, + investment_year: int, +) -> None: + """ + Endogenous shipping: one shared per-node " shipping" + service-demand Bus/Load, fed by competing supply Links from oil, + methanol, gas, and hydrogen. The optimiser picks the cost-minimal fuel + mix each snapshot rather than following a fixed exogenous share. + + Each fuel Link's ``efficiency`` converts its own raw fuel energy into + the shared bus's "oil-equivalent" service-energy units (matching the + historical demand data's own convention) as + (that fuel's engine efficiency) / options["shipping_oil_efficiency"]; + for oil this is 1 by construction. Oil and LNG combustion additionally + emit to "co2 atmosphere" via ``efficiency2`` (their CO2 intensity, same + convention as gas/oil-for-industry); methanol's combustion emission + here is offset elsewhere in the network by its own upstream synthesis + from captured CO2 (methanolisation); hydrogen (via fuel cell) emits + nothing at the point of use. + + Gas-fuelled shipping only exists in practice as LNG -- a ship cannot + bunker directly from a pipeline -- so gas is unconditionally liquefied + to LNG (own "CH4 liquefaction" Link, real capital cost -- an LNG plant, + not a ship retrofit) before the "shipping LNG" Link draws from that LNG + bus. Unlike the optional hydrogen liquefaction step below (gaseous H2 + is a physically valid alternative fuel), there is no non-liquefied + alternative for gas, so this is not a configurable option. The + liquefaction step is electricity-driven, not gas-combusting: CH4 passes + through at efficiency=1 (no gas is burned to run the process, matching + the technology-data "methane-input" of 1.0), and the parasitic + refrigeration load is drawn separately from the node's electricity bus + via bus2 ("electricity-input" from technology-data). + + Individual fuels are toggled independently via options["shipping_oil"] + / ["shipping_methanol"] / ["shipping_lng"] / ["shipping_hydrogen"] + (each a flat bool or a year-indexed dict, resolved at investment_year) + -- at least one must be true for this investment_year. The mix is + entirely a model outcome, constrained only by the economy-wide + CO2Limit/fossil_fuel_limit (no shipping-specific emissions cap). + """ + fuel_enabled = { + fuel: bool(get(options[f"shipping_{fuel}"], investment_year)) + for fuel in ["oil", "methanol", "lng", "hydrogen"] + } + + if not any(fuel_enabled.values()): + raise ValueError( + "At least one of sector.shipping_oil/shipping_methanol/" + "shipping_lng/shipping_hydrogen must be true for " + f"investment_year={investment_year}." + ) + + n.add("Carrier", "shipping") + n.add( + "Bus", + nodes + " shipping", + location=nodes, + carrier="shipping", + unit="MWh_LHV", + ) + n.add( + "Load", + nodes + " shipping", + bus=nodes + " shipping", + carrier="shipping", + p_set=p_set.rename(lambda x: x + " shipping"), + ) + + oil_efficiency = options["shipping_oil_efficiency"] + + if fuel_enabled["oil"]: + n.add( + "Link", + nodes + " shipping oil", + bus0=spatial.oil.nodes, + bus1=nodes + " shipping", + bus2="co2 atmosphere", + carrier="shipping oil", + p_nom_extendable=True, + efficiency=1.0, + efficiency2=costs.at["oil", "CO2 intensity"], + ) + + if fuel_enabled["methanol"]: + n.add( + "Link", + nodes + " shipping methanol", + bus0=spatial.methanol.nodes, + bus1=nodes + " shipping", + bus2="co2 atmosphere", + carrier="shipping methanol", + p_nom_extendable=True, + efficiency=options["shipping_methanol_efficiency"] / oil_efficiency, + efficiency2=costs.at["methanolisation", "carbondioxide-input"], + ) + + if fuel_enabled["lng"]: + # Gas-fuelled shipping only exists in practice as LNG -- a ship + # cannot bunker directly from a pipeline -- so liquefaction is + # unconditional here, unlike the optional hydrogen liquefaction + # step below (gaseous H2 is a physically valid alternative; raw + # pipeline gas bunkered directly onto a ship is not). + _add_lng_liquefaction(n, costs, nodes, spatial) + + n.add( + "Link", + nodes + " shipping LNG", + bus0=nodes + " LNG", + bus1=nodes + " shipping", + bus2="co2 atmosphere", + carrier="shipping LNG", + p_nom_extendable=True, + efficiency=_shipping_lng_useful_efficiency(options) / oil_efficiency, + efficiency2=_shipping_lng_co2_equivalent(costs, options), + ) + + if fuel_enabled["hydrogen"]: + if options["shipping_hydrogen_liquefaction"]: + n.add( + "Bus", + nodes, + suffix=" H2 liquid", + carrier="H2 liquid", + location=nodes, + unit="MWh_LHV", + ) + + n.add( + "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", "capital_cost"], + p_nom_extendable=True, + lifetime=costs.at["H2 liquefaction", "lifetime"], + ) + + h2_bus = nodes + " H2 liquid" + else: + h2_bus = nodes + " H2" + + n.add( + "Link", + nodes + " H2 for shipping", + bus0=h2_bus, + bus1=nodes + " shipping", + carrier="H2 for shipping", + p_nom_extendable=True, + efficiency=costs.at["fuel cell", "efficiency"] / oil_efficiency, + ) + def add_waste_heat( n: pypsa.Network, From 7046714e3550969b3ec14032aaaf926d2de3839c Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Thu, 19 Nov 2026 10:00:17 +0100 Subject: [PATCH 2/6] Harmonise endogenous and exogenous shipping fuels, fold liquefaction into links - shipping_endogenous lists fuels that compete for the demand left by the shares of the other fuels - fuel links run at constant output, liquefaction of gas and hydrogen is part of the links - methanol and LNG ships as efficient as oil ships (Fourth IMO GHG Study 2020) - update transport design docs, release notes and overnight test objective --- config/config.default.yaml | 10 +- config/plotting.default.yaml | 1 + config/schema.default.json | 196 +++------- config/test/config.overnight.yaml | 2 +- doc/design/transport.md | 22 +- doc/publications.bib | 9 + doc/release_notes.md | 2 + scripts/lib/validation/config/plotting.py | 1 + scripts/lib/validation/config/sector.py | 51 +-- scripts/prepare_sector_network.py | 426 ++++++---------------- 10 files changed, 209 insertions(+), 511 deletions(-) diff --git a/config/config.default.yaml b/config/config.default.yaml index 5e871ad81c..4e3c268fa0 100644 --- a/config/config.default.yaml +++ b/config/config.default.yaml @@ -840,11 +840,7 @@ sector: agriculture_machinery_fuel_efficiency: 0.7 agriculture_machinery_electric_efficiency: 0.3 shipping_hydrogen_liquefaction: false - shipping_endogenous: false - shipping_oil: true - shipping_methanol: true - shipping_lng: true - shipping_hydrogen: false + shipping_endogenous: [] shipping_hydrogen_share: 2020: 0 2025: 0 @@ -877,9 +873,9 @@ sector: 2040: 0 2045: 0 2050: 0 - shipping_methanol_efficiency: 0.46 + shipping_methanol_efficiency: 0.4 shipping_oil_efficiency: 0.4 - shipping_lng_efficiency: 0.45 + shipping_lng_efficiency: 0.4 shipping_lng_methane_slip: 0.031 shipping_methane_gwp100: 25.0 aviation_demand_factor: 1.0 diff --git a/config/plotting.default.yaml b/config/plotting.default.yaml index e5bad43b4e..6e0bc0d3a5 100644 --- a/config/plotting.default.yaml +++ b/config/plotting.default.yaml @@ -447,6 +447,7 @@ plotting: gas for industry CC: "#692e0a" gas pipeline: "#ebbca0" gas pipeline new: "#a87c62" + shipping LNG: "#a3471c" oil: "#c9c9c9" oil primary: "#d2d2d2" oil refining: "#e6e6e6" diff --git a/config/schema.default.json b/config/schema.default.json index 635a385302..30e75f36cc 100644 --- a/config/schema.default.json +++ b/config/schema.default.json @@ -5226,106 +5226,54 @@ }, "shipping_hydrogen_liquefaction": { "default": false, - "description": "Whether to include liquefaction costs for hydrogen demand in shipping.", + "description": "Whether to include liquefaction costs and electricity demand for hydrogen in shipping.", "type": "boolean" }, "shipping_endogenous": { - "default": false, - "description": "If true, shipping fuel choice is endogenous: enabled fuels (shipping_oil/methanol/lng/hydrogen) compete on a shared per-node demand bus and the optimiser picks the cost-minimal mix. If false (default), the fixed year-indexed shipping_*_share values are used.", - "type": "boolean" - }, - "shipping_oil": { - "anyOf": [ - { - "type": "boolean" - }, - { - "additionalProperties": { - "type": "boolean" - }, - "type": "object" - } - ], - "default": true, - "description": "Whether oil is an available fuel for shipping." - }, - "shipping_methanol": { - "anyOf": [ - { - "type": "boolean" - }, - { - "additionalProperties": { - "type": "boolean" - }, - "type": "object" - } - ], - "default": true, - "description": "Whether methanol is an available fuel for shipping." - }, - "shipping_lng": { - "anyOf": [ - { - "type": "boolean" - }, - { - "additionalProperties": { - "type": "boolean" - }, - "type": "object" - } - ], - "default": true, - "description": "Whether LNG (drawn from the existing gas bus/network and liquefied) is an available fuel for shipping." - }, - "shipping_hydrogen": { - "anyOf": [ - { - "type": "boolean" - }, - { - "additionalProperties": { - "type": "boolean" - }, - "type": "object" - } - ], - "default": false, - "description": "Whether hydrogen is an available fuel for shipping." + "description": "Fuels with an optimised instead of an exogenous share. They compete for the shipping demand that the `shipping_*_share` settings of the other fuels leave uncovered, and each supplies a constant output over the year. Ship costs do not differ by fuel, so the cheapest fuel tends to supply all of this demand.", + "items": { + "enum": [ + "hydrogen", + "methanol", + "oil", + "lng" + ], + "type": "string" + }, + "type": "array" }, "shipping_hydrogen_share": { "additionalProperties": { "type": "number" }, - "description": "The share of ships powered by hydrogen in a given year (exogenous mode only).", + "description": "The share of ships powered by hydrogen in a given year.", "type": "object" }, "shipping_methanol_share": { "additionalProperties": { "type": "number" }, - "description": "The share of ships powered by methanol in a given year (exogenous mode only).", + "description": "The share of ships powered by methanol in a given year.", "type": "object" }, "shipping_oil_share": { "additionalProperties": { "type": "number" }, - "description": "The share of ships powered by oil in a given year (exogenous mode only).", + "description": "The share of ships powered by oil in a given year.", "type": "object" }, "shipping_lng_share": { "additionalProperties": { "type": "number" }, - "description": "The share of ships powered by LNG in a given year (exogenous mode only). Gas is drawn from the gas bus and liquefied via CH4 liquefaction, as in endogenous mode.", + "description": "The share of ships powered by LNG in a given year. The costs and electricity demand of gas liquefaction are included.", "type": "object" }, "shipping_methanol_efficiency": { - "default": 0.46, - "description": "The efficiency of methanol-powered ships in the conversion of methanol to meet shipping needs (propulsion). The efficiency increase from oil can be 10-15% higher according to the `IEA `_.", - "markdownDescription": "The efficiency of methanol-powered ships in the conversion of methanol to meet shipping needs (propulsion). The efficiency increase from oil can be 10-15% higher according to the [IEA ](https://web.archive.org/web/20220119063102/https://iea-amf.org/app/webroot/files/file/Annex%20Reports/AMF_Annex_56.pdf).", + "default": 0.4, + "description": "The efficiency of methanol-powered ships in the conversion of methanol to meet shipping needs (propulsion). Equal to oil-powered ships, as methanol engines and diesel engines consume similar amounts of fuel energy according to the `Fourth IMO GHG Study 2020 `_ (Table 19).", + "markdownDescription": "The efficiency of methanol-powered ships in the conversion of methanol to meet shipping needs (propulsion). Equal to oil-powered ships, as methanol engines and diesel engines consume similar amounts of fuel energy according to the [Fourth IMO GHG Study 2020 ](https://www.imo.org/en/ourwork/environment/pages/fourth-imo-greenhouse-gas-study-2020.aspx) (Table 19).", "type": "number" }, "shipping_oil_efficiency": { @@ -5334,18 +5282,18 @@ "type": "number" }, "shipping_lng_efficiency": { - "default": 0.45, - "description": "Placeholder efficiency of LNG (dual-fuel) ship engines per unit of fuel actually burnt; the methane-slip share (shipping_lng_methane_slip) is deducted on top, so the useful efficiency is shipping_lng_efficiency * (1 - shipping_lng_methane_slip). Adjust once a technology-data-sourced figure is available.", + "default": 0.4, + "description": "The efficiency of LNG-powered ships in the conversion of LNG to meet shipping needs (propulsion), including the fuel lost as methane slip. Equal to oil-powered ships for the same reason as `shipping_methanol_efficiency`.", "type": "number" }, "shipping_lng_methane_slip": { "default": 0.031, - "description": "Share of LNG fuel mass that leaves the ship engine unburnt as methane (methane slip). Default 3.1% is the FuelEU Maritime (Regulation (EU) 2023/1805, Annex II) default for LNG Otto dual-fuel medium-speed engines. Slipped methane delivers no propulsion work, is converted to CO2-equivalent with shipping_methane_gwp100 and counted against the CO2 limit.", + "description": "Share of LNG that leaves the ship engine unburnt as methane. It counts as CO2 equivalent towards the CO2 limit. Default for LNG Otto dual-fuel medium-speed engines from FuelEU Maritime (Regulation (EU) 2023/1805, Annex II).", "type": "number" }, "shipping_methane_gwp100": { "default": 25.0, - "description": "100-year global warming potential of methane used to convert LNG methane slip to CO2-equivalent. Default 25 (IPCC AR4), as used by FuelEU Maritime.", + "description": "100-year global warming potential of methane to convert the methane slip of LNG-powered ships to CO2 equivalent.", "type": "number" }, "aviation_demand_factor": { @@ -13288,106 +13236,54 @@ }, "shipping_hydrogen_liquefaction": { "default": false, - "description": "Whether to include liquefaction costs for hydrogen demand in shipping.", + "description": "Whether to include liquefaction costs and electricity demand for hydrogen in shipping.", "type": "boolean" }, "shipping_endogenous": { - "default": false, - "description": "If true, shipping fuel choice is endogenous: enabled fuels (shipping_oil/methanol/lng/hydrogen) compete on a shared per-node demand bus and the optimiser picks the cost-minimal mix. If false (default), the fixed year-indexed shipping_*_share values are used.", - "type": "boolean" - }, - "shipping_oil": { - "anyOf": [ - { - "type": "boolean" - }, - { - "additionalProperties": { - "type": "boolean" - }, - "type": "object" - } - ], - "default": true, - "description": "Whether oil is an available fuel for shipping." - }, - "shipping_methanol": { - "anyOf": [ - { - "type": "boolean" - }, - { - "additionalProperties": { - "type": "boolean" - }, - "type": "object" - } - ], - "default": true, - "description": "Whether methanol is an available fuel for shipping." - }, - "shipping_lng": { - "anyOf": [ - { - "type": "boolean" - }, - { - "additionalProperties": { - "type": "boolean" - }, - "type": "object" - } - ], - "default": true, - "description": "Whether LNG (drawn from the existing gas bus/network and liquefied) is an available fuel for shipping." - }, - "shipping_hydrogen": { - "anyOf": [ - { - "type": "boolean" - }, - { - "additionalProperties": { - "type": "boolean" - }, - "type": "object" - } - ], - "default": false, - "description": "Whether hydrogen is an available fuel for shipping." + "description": "Fuels with an optimised instead of an exogenous share. They compete for the shipping demand that the `shipping_*_share` settings of the other fuels leave uncovered, and each supplies a constant output over the year. Ship costs do not differ by fuel, so the cheapest fuel tends to supply all of this demand.", + "items": { + "enum": [ + "hydrogen", + "methanol", + "oil", + "lng" + ], + "type": "string" + }, + "type": "array" }, "shipping_hydrogen_share": { "additionalProperties": { "type": "number" }, - "description": "The share of ships powered by hydrogen in a given year (exogenous mode only).", + "description": "The share of ships powered by hydrogen in a given year.", "type": "object" }, "shipping_methanol_share": { "additionalProperties": { "type": "number" }, - "description": "The share of ships powered by methanol in a given year (exogenous mode only).", + "description": "The share of ships powered by methanol in a given year.", "type": "object" }, "shipping_oil_share": { "additionalProperties": { "type": "number" }, - "description": "The share of ships powered by oil in a given year (exogenous mode only).", + "description": "The share of ships powered by oil in a given year.", "type": "object" }, "shipping_lng_share": { "additionalProperties": { "type": "number" }, - "description": "The share of ships powered by LNG in a given year (exogenous mode only). Gas is drawn from the gas bus and liquefied via CH4 liquefaction, as in endogenous mode.", + "description": "The share of ships powered by LNG in a given year. The costs and electricity demand of gas liquefaction are included.", "type": "object" }, "shipping_methanol_efficiency": { - "default": 0.46, - "description": "The efficiency of methanol-powered ships in the conversion of methanol to meet shipping needs (propulsion). The efficiency increase from oil can be 10-15% higher according to the `IEA `_.", - "markdownDescription": "The efficiency of methanol-powered ships in the conversion of methanol to meet shipping needs (propulsion). The efficiency increase from oil can be 10-15% higher according to the [IEA ](https://web.archive.org/web/20220119063102/https://iea-amf.org/app/webroot/files/file/Annex%20Reports/AMF_Annex_56.pdf).", + "default": 0.4, + "description": "The efficiency of methanol-powered ships in the conversion of methanol to meet shipping needs (propulsion). Equal to oil-powered ships, as methanol engines and diesel engines consume similar amounts of fuel energy according to the `Fourth IMO GHG Study 2020 `_ (Table 19).", + "markdownDescription": "The efficiency of methanol-powered ships in the conversion of methanol to meet shipping needs (propulsion). Equal to oil-powered ships, as methanol engines and diesel engines consume similar amounts of fuel energy according to the [Fourth IMO GHG Study 2020 ](https://www.imo.org/en/ourwork/environment/pages/fourth-imo-greenhouse-gas-study-2020.aspx) (Table 19).", "type": "number" }, "shipping_oil_efficiency": { @@ -13396,18 +13292,18 @@ "type": "number" }, "shipping_lng_efficiency": { - "default": 0.45, - "description": "Placeholder efficiency of LNG (dual-fuel) ship engines per unit of fuel actually burnt; the methane-slip share (shipping_lng_methane_slip) is deducted on top, so the useful efficiency is shipping_lng_efficiency * (1 - shipping_lng_methane_slip). Adjust once a technology-data-sourced figure is available.", + "default": 0.4, + "description": "The efficiency of LNG-powered ships in the conversion of LNG to meet shipping needs (propulsion), including the fuel lost as methane slip. Equal to oil-powered ships for the same reason as `shipping_methanol_efficiency`.", "type": "number" }, "shipping_lng_methane_slip": { "default": 0.031, - "description": "Share of LNG fuel mass that leaves the ship engine unburnt as methane (methane slip). Default 3.1% is the FuelEU Maritime (Regulation (EU) 2023/1805, Annex II) default for LNG Otto dual-fuel medium-speed engines. Slipped methane delivers no propulsion work, is converted to CO2-equivalent with shipping_methane_gwp100 and counted against the CO2 limit.", + "description": "Share of LNG that leaves the ship engine unburnt as methane. It counts as CO2 equivalent towards the CO2 limit. Default for LNG Otto dual-fuel medium-speed engines from FuelEU Maritime (Regulation (EU) 2023/1805, Annex II).", "type": "number" }, "shipping_methane_gwp100": { "default": 25.0, - "description": "100-year global warming potential of methane used to convert LNG methane slip to CO2-equivalent. Default 25 (IPCC AR4), as used by FuelEU Maritime.", + "description": "100-year global warming potential of methane to convert the methane slip of LNG-powered ships to CO2 equivalent.", "type": "number" }, "aviation_demand_factor": { diff --git a/config/test/config.overnight.yaml b/config/test/config.overnight.yaml index 6414f858f4..98ae1f1c01 100644 --- a/config/test/config.overnight.yaml +++ b/config/test/config.overnight.yaml @@ -115,7 +115,7 @@ solving: check_objective: enable: true - expected_value: 567930630.22 + expected_value: 573311403.37 plotting: map: diff --git a/doc/design/transport.md b/doc/design/transport.md index 12ba5c6787..20503c3872 100644 --- a/doc/design/transport.md +++ b/doc/design/transport.md @@ -8,7 +8,8 @@ Transport comprises land transport, aviation and shipping. The fuel mix of transport is exogenous, because it follows vehicle fleets and policy rather than energy system cost, and it is given per planning year so that it can -trace a transition path [@brownSynergiesSector2018a]. +trace a transition path [@brownSynergiesSector2018a]. Only for shipping can +the fuel mix optionally be optimised. ## Demand @@ -42,9 +43,22 @@ engines add an oil demand, see [Oil](oil.md). **Aviation** consumes kerosene. It is an oil demand that can be met by fossil kerosene or synthetic fuels, and optionally by kerosene made from methanol. -**Shipping** can run on oil, methanol or hydrogen, with prescribed shares per -planning year. The energy for liquefying hydrogen can be included where -hydrogen is used. +**Shipping** can run on oil, methanol, hydrogen or liquefied natural gas +(LNG), with prescribed shares per planning year. LNG is gas from the gas +network that is liquefied with electricity, see [Methane](methane.md). LNG +engines release a share of the fuel unburnt, and this methane slip counts +towards the emission limit in CO~2~ equivalents. Methanol and LNG ships +are assumed to be as efficient as oil ships [@imoFourthGHG2020]. The cost and electricity +demand of liquefying hydrogen can be included where hydrogen is used. + +Optionally, the shares of selected fuels are optimised instead. These fuels +compete for the demand that the prescribed shares of the other fuels leave +uncovered, and each supplies a constant output over the year. + +!!! warning "Optimised shipping fuels ignore the fleet" + Ship costs do not differ by fuel and the existing fleet is not tracked. + The cheapest fuel therefore tends to take all of the optimised demand, + and the mix can change abruptly between planning years. ## Storage diff --git a/doc/publications.bib b/doc/publications.bib index fdac421c05..9d8167cbbe 100644 --- a/doc/publications.bib +++ b/doc/publications.bib @@ -580,6 +580,15 @@ @misc{hybritSummaryFindings2021 url = {https://dh5k8ug1gwbyz.cloudfront.net/uploads/2021/02/Hybrit-broschure-engelska.pdf} } +@techreport{imoFourthGHG2020, + title = {Fourth {{IMO GHG}} Study 2020}, + author = {{International Maritime Organization}}, + year = {2021}, + address = {London}, + institution = {{International Maritime Organization}}, + url = {https://www.imo.org/en/ourwork/environment/pages/fourth-imo-greenhouse-gas-study-2020.aspx} +} + @article{kullmannValueRecycling2022, title = {The Value of Recycling for Low-Carbon Energy Systems - a Case Study of {{Germany}}'s Energy Transition}, author = {Kullmann, Felix and Markewitz, Peter and Kotzur, Leander and Stolten, Detlef}, diff --git a/doc/release_notes.md b/doc/release_notes.md index a5265fd8f1..d3c0f38011 100644 --- a/doc/release_notes.md +++ b/doc/release_notes.md @@ -5,6 +5,8 @@ +* Feature: Add LNG as shipping fuel (`sector: shipping_lng_share`) and optionally optimise the shares of the fuels listed in `sector: shipping_endogenous`. `sector: shipping_hydrogen_liquefaction` now includes the electricity demand ([#2317](https://github.com/PyPSA/pypsa-eur/pull/2317)). +* Change: Methanol-powered ships are now as efficient as oil-powered ships (`sector: shipping_methanol_efficiency`), following the Fourth IMO GHG Study 2020. This changes default results ([#2317](https://github.com/PyPSA/pypsa-eur/pull/2317)). * Fix: Gas pipelines ending in regions without an onshore region, e.g. offshore junctions at high resolution, now get gas and H2 buses instead of leaving the network inconsistent ([#2429](https://github.com/PyPSA/pypsa-eur/pull/2429)). * Fix: Offshore wind profiles no longer fail for clustered buses without an onshore region; the nearest onshore regions then serve as the shoreline ([#2425](https://github.com/PyPSA/pypsa-eur/pull/2425)). * Fix: Hydro reservoir storage (`renewable: hydro: hydro_max_hours`) no longer depends on the first unit of each country, and the default now matches the country totals. This changes default results ([#2428](https://github.com/PyPSA/pypsa-eur/pull/2428)). diff --git a/scripts/lib/validation/config/plotting.py b/scripts/lib/validation/config/plotting.py index dc4e8693ac..ac67ef48ab 100644 --- a/scripts/lib/validation/config/plotting.py +++ b/scripts/lib/validation/config/plotting.py @@ -664,6 +664,7 @@ def _default_balance_map_interactive() -> _BalanceMapInteractiveConfig: "gas for industry CC": "#692e0a", "gas pipeline": "#ebbca0", "gas pipeline new": "#a87c62", + "shipping LNG": "#a3471c", # oil "oil": "#c9c9c9", "oil primary": "#d2d2d2", diff --git a/scripts/lib/validation/config/sector.py b/scripts/lib/validation/config/sector.py index 1275e6244d..1756a7fd5e 100644 --- a/scripts/lib/validation/config/sector.py +++ b/scripts/lib/validation/config/sector.py @@ -725,35 +725,12 @@ class SectorConfig(BaseModel): shipping_hydrogen_liquefaction: bool = Field( False, - description="Whether to include liquefaction costs for hydrogen demand in shipping.", + description="Whether to include liquefaction costs and electricity demand for hydrogen in shipping.", ) - shipping_endogenous: bool = Field( - False, - description="If true, shipping fuel choice is endogenous: enabled fuels (shipping_oil/methanol/lng/hydrogen) compete on a shared per-node demand bus and the optimiser picks the cost-minimal mix. If false (default), the fixed year-indexed shipping_*_share values are used.", - ) - # Endogenous shipping: each enabled fuel below competes on a shared - # per-node demand bus (add_shipping in prepare_sector_network.py); the - # optimiser picks the cost-minimal mix rather than following a fixed - # exogenous share. At least one of the four must be true (resolved per - # investment_year when given as a year-indexed dict). Each can be a - # flat bool, or a year-indexed dict (e.g. {2030: false, 2035: true}) to - # unlock/retire a fuel at a given planning horizon under myopic - # foresight. - shipping_oil: bool | dict[int, bool] = Field( - True, description="Whether oil is an available fuel for shipping." - ) - shipping_methanol: bool | dict[int, bool] = Field( - True, description="Whether methanol is an available fuel for shipping." - ) - shipping_lng: bool | dict[int, bool] = Field( - True, - description="Whether LNG (drawn from the existing gas bus/network and liquefied) is an available fuel for shipping.", - ) - shipping_hydrogen: bool | dict[int, bool] = Field( - False, description="Whether hydrogen is an available fuel for shipping." + shipping_endogenous: list[Literal["hydrogen", "methanol", "oil", "lng"]] = Field( + default_factory=list, + description="Fuels with an optimised instead of an exogenous share. They compete for the shipping demand that the `shipping_*_share` settings of the other fuels leave uncovered, and each supplies a constant output over the year. Ship costs do not differ by fuel, so the cheapest fuel tends to supply all of this demand.", ) - # Exogenous shipping (shipping_endogenous: false): fixed shares per year, - # should sum to 1. shipping_hydrogen_share: dict[int, float] = Field( default_factory=lambda: { 2020: 0, @@ -764,7 +741,7 @@ class SectorConfig(BaseModel): 2045: 0, 2050: 0, }, - description="The share of ships powered by hydrogen in a given year (exogenous mode only).", + description="The share of ships powered by hydrogen in a given year.", ) shipping_methanol_share: dict[int, float] = Field( default_factory=lambda: { @@ -776,7 +753,7 @@ class SectorConfig(BaseModel): 2045: 0.8, 2050: 1, }, - description="The share of ships powered by methanol in a given year (exogenous mode only).", + description="The share of ships powered by methanol in a given year.", ) shipping_oil_share: dict[int, float] = Field( default_factory=lambda: { @@ -788,7 +765,7 @@ class SectorConfig(BaseModel): 2045: 0.2, 2050: 0, }, - description="The share of ships powered by oil in a given year (exogenous mode only).", + description="The share of ships powered by oil in a given year.", ) shipping_lng_share: dict[int, float] = Field( default_factory=lambda: { @@ -800,27 +777,27 @@ class SectorConfig(BaseModel): 2045: 0, 2050: 0, }, - description="The share of ships powered by LNG in a given year (exogenous mode only). Gas is drawn from the gas bus and liquefied via CH4 liquefaction, as in endogenous mode.", + description="The share of ships powered by LNG in a given year. The costs and electricity demand of gas liquefaction are included.", ) shipping_methanol_efficiency: float = Field( - 0.46, - description="The efficiency of methanol-powered ships in the conversion of methanol to meet shipping needs (propulsion). The efficiency increase from oil can be 10-15% higher according to the `IEA `_.", + 0.40, + description="The efficiency of methanol-powered ships in the conversion of methanol to meet shipping needs (propulsion). Equal to oil-powered ships, as methanol engines and diesel engines consume similar amounts of fuel energy according to the `Fourth IMO GHG Study 2020 `_ (Table 19).", ) shipping_oil_efficiency: float = Field( 0.40, description="The efficiency of oil-powered ships in the conversion of oil to meet shipping needs (propulsion). Base value derived from 2011.", ) shipping_lng_efficiency: float = Field( - 0.45, - description="Placeholder efficiency of LNG (dual-fuel) ship engines per unit of fuel actually burnt; the methane-slip share (shipping_lng_methane_slip) is deducted on top, so the useful efficiency is shipping_lng_efficiency * (1 - shipping_lng_methane_slip). Adjust once a technology-data-sourced figure is available.", + 0.40, + description="The efficiency of LNG-powered ships in the conversion of LNG to meet shipping needs (propulsion), including the fuel lost as methane slip. Equal to oil-powered ships for the same reason as `shipping_methanol_efficiency`.", ) shipping_lng_methane_slip: float = Field( 0.031, - description="Share of LNG fuel mass that leaves the ship engine unburnt as methane (methane slip). Default 3.1% is the FuelEU Maritime (Regulation (EU) 2023/1805, Annex II) default for LNG Otto dual-fuel medium-speed engines. Slipped methane delivers no propulsion work, is converted to CO2-equivalent with shipping_methane_gwp100 and counted against the CO2 limit.", + description="Share of LNG that leaves the ship engine unburnt as methane. It counts as CO2 equivalent towards the CO2 limit. Default for LNG Otto dual-fuel medium-speed engines from FuelEU Maritime (Regulation (EU) 2023/1805, Annex II).", ) shipping_methane_gwp100: float = Field( 25.0, - description="100-year global warming potential of methane used to convert LNG methane slip to CO2-equivalent. Default 25 (IPCC AR4), as used by FuelEU Maritime.", + description="100-year global warming potential of methane to convert the methane slip of LNG-powered ships to CO2 equivalent.", ) aviation_demand_factor: float = Field( diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index add278f8ca..2bcf80ca7b 100755 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -5651,85 +5651,6 @@ def add_aviation( ) -def _add_lng_liquefaction( - n: pypsa.Network, - costs: pd.DataFrame, - nodes: pd.Index, - spatial: SimpleNamespace, -) -> None: - """ - Add a per-node " LNG" bus fed from the gas bus by a "CH4 - liquefaction" Link. Shared by the endogenous and exogenous shipping - implementations. - - Gas-fuelled shipping only exists in practice as LNG -- a ship cannot - bunker directly from a pipeline -- so liquefaction is unconditional - whenever LNG shipping is enabled. The step is electricity-driven, not - gas-combusting: CH4 passes through at efficiency=1 (technology-data - "methane-input" of 1.0) and the refrigeration load is drawn from the - node's electricity bus via bus2 ("electricity-input"). - """ - n.add( - "Bus", - nodes, - suffix=" LNG", - carrier="LNG", - location=nodes, - unit="MWh_LHV", - ) - - n.add( - "Link", - nodes + " CH4 liquefaction", - bus0=spatial.gas.df.loc[nodes, "nodes"].values, - bus1=nodes + " LNG", - bus2=nodes, - carrier="CH4 liquefaction", - efficiency=1.0, - efficiency2=-costs.at["CH4 liquefaction", "electricity-input"], - capital_cost=costs.at["CH4 liquefaction", "capital_cost"], - p_nom_extendable=True, - lifetime=costs.at["CH4 liquefaction", "lifetime"], - ) - - -def _shipping_lng_co2_equivalent(costs: pd.DataFrame, options: dict) -> float: - """ - Tank-to-wake CO2-equivalent emissions of LNG-fuelled shipping, in - tCO2eq per MWh_LHV of LNG fed to the engine. - - A share ``s = options["shipping_lng_methane_slip"]`` of the fuel (by - mass) leaves the engine unburnt as methane (FuelEU Maritime "Cslip"). - The burnt share emits combustion CO2, the slipped share is converted to - CO2eq with ``options["shipping_methane_gwp100"]``; both are routed to - "co2 atmosphere", so methane slip counts against the CO2 limit: - - (1 - s) * CO2 intensity of gas + s * m_CH4 * GWP100 - - with m_CH4 = 3.6 GJ / 50 MJ/kg = 0.072 t CH4 per MWh_LHV. The slipped - fuel also does no work: see ``_shipping_lng_useful_efficiency``. - """ - slip = options["shipping_lng_methane_slip"] - methane_t_per_mwh = 3.6 / 50.0 - return (1 - slip) * costs.at["gas", "CO2 intensity"] + slip * ( - methane_t_per_mwh * options["shipping_methane_gwp100"] - ) - - -def _shipping_lng_useful_efficiency(options: dict) -> float: - """ - Propulsion energy per MWh_LHV of LNG fed to the engine. - - ``options["shipping_lng_efficiency"]`` is the efficiency of the fuel - that is actually burnt; the slipped share - ``options["shipping_lng_methane_slip"]`` leaves unburnt and delivers no - work, so the useful efficiency is ``eta_LNG * (1 - slip)``. - """ - return options["shipping_lng_efficiency"] * ( - 1 - options["shipping_lng_methane_slip"] - ) - - def add_shipping( n: pypsa.Network, costs: pd.DataFrame, @@ -5740,41 +5661,35 @@ def add_shipping( spatial: SimpleNamespace, investment_year: int, ) -> None: - logger.info("Add shipping") + """ + Add shipping demand supplied by hydrogen, methanol, oil and LNG. - if options.get("shipping_endogenous", False): - nodes = pop_layout.index - nhours = n.snapshot_weightings.generators.sum() - nyears = nhours / 8760 - domestic_navigation = pop_weighted_energy_totals.loc[ - nodes, ["total domestic navigation"] - ].squeeze() - international_navigation = ( - pd.read_csv(shipping_demand_file, index_col=0).squeeze(axis=1) * nyears - ) - all_navigation = domestic_navigation + international_navigation - p_set = all_navigation * 1e6 / nhours - _add_shipping_endogenous( - n, costs, p_set, nodes, options, spatial, investment_year - ) - return + Each fuel covers an exogenous share of the demand. The fuels listed in + `shipping_endogenous` instead compete for the demand that the shares of + the other fuels leave uncovered. This demand is in oil-equivalent energy + and each competing fuel supplies a constant output over the year. + """ + logger.info("Add shipping") nodes = pop_layout.index nhours = n.snapshot_weightings.generators.sum() nyears = nhours / 8760 - 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) - shipping_lng_share = get(options.get("shipping_lng_share", 0), investment_year) + endogenous = options["shipping_endogenous"] + share = { + fuel: 0 if fuel in endogenous else get(shares, investment_year) + for fuel, shares in { + "hydrogen": options["shipping_hydrogen_share"], + "methanol": options["shipping_methanol_share"], + "oil": options["shipping_oil_share"], + "lng": options["shipping_lng_share"], + }.items() + } - total_share = ( - shipping_hydrogen_share - + shipping_methanol_share - + shipping_oil_share - + shipping_lng_share - ) - if total_share != 1: + total_share = sum(share.values()) + if endogenous and total_share >= 1: + endogenous = [] + elif not endogenous and total_share != 1: logger.warning( f"Total shipping shares sum up to {total_share:.2%}, corresponding to increased or decreased demand assumptions." ) @@ -5788,16 +5703,88 @@ def add_shipping( 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) + # fuel demand per oil-equivalent demand + oil_efficiency = options["shipping_oil_efficiency"] + fuel_demand = { + "hydrogen": oil_efficiency / costs.at["fuel cell", "efficiency"], + "methanol": oil_efficiency / options["shipping_methanol_efficiency"], + "oil": 1.0, + "lng": oil_efficiency / options["shipping_lng_efficiency"], + } + + hydrogen_liquefaction = {} + if options["shipping_hydrogen_liquefaction"]: + hydrogen_liquefaction = dict( + bus2=nodes, + efficiency2=-costs.at["H2 liquefaction", "electricity-input"], + capital_cost=costs.at["H2 liquefaction", "capital_cost"], ) - efficiency = oil_efficiency / costs.at["fuel cell", "efficiency"] - shipping_hydrogen_share = get( - options["shipping_hydrogen_share"], investment_year + + # unburnt methane with 50 MJ/kg counts as CO2 equivalent + slip = options["shipping_lng_methane_slip"] + lng_co2_intensity = (1 - slip) * costs.at["gas", "CO2 intensity"] + lng_co2_intensity += slip * 3.6 / 50 * options["shipping_methane_gwp100"] + + supply = { + "hydrogen": dict( + bus0=nodes + " H2", + carrier="H2 for shipping", + **hydrogen_liquefaction, + ), + "methanol": dict( + bus0=spatial.methanol.nodes, + bus2="co2 atmosphere", + carrier="shipping methanol", + efficiency2=costs.at["methanolisation", "carbondioxide-input"], + ), + "oil": dict( + bus0=spatial.oil.nodes, + bus2="co2 atmosphere", + carrier="shipping oil", + efficiency2=costs.at["oil", "CO2 intensity"], + ), + # includes the liquefaction of gas to LNG + "lng": dict( + bus0=spatial.gas.df.loc[nodes, "nodes"].values, + bus2="co2 atmosphere", + bus3=nodes, + carrier="shipping LNG", + efficiency2=lng_co2_intensity, + efficiency3=-costs.at["CH4 liquefaction", "electricity-input"], + capital_cost=costs.at["CH4 liquefaction", "capital_cost"], + ), + } + + if endogenous: + n.add( + "Bus", + nodes + " shipping", + location=nodes, + carrier="shipping", + unit="MWh_LHV", ) - if options["shipping_hydrogen_liquefaction"]: + n.add( + "Load", + nodes + " shipping", + bus=nodes + " shipping", + carrier="shipping", + p_set=(1 - total_share) * p_set.rename(lambda x: x + " shipping"), + ) + + for fuel in endogenous: + n.add( + "Link", + nodes + " " + supply[fuel]["carrier"], + bus1=nodes + " shipping", + p_nom_extendable=True, + p_min_pu=1, + efficiency=1 / fuel_demand[fuel], + **supply[fuel], + ) + + if share["hydrogen"]: + if hydrogen_liquefaction: n.add( "Bus", nodes, @@ -5813,39 +5800,28 @@ def add_shipping( bus0=nodes + " H2", bus1=nodes + " H2 liquid", carrier="H2 liquefaction", - efficiency=costs.at["H2 liquefaction", "efficiency"], - capital_cost=costs.at["H2 liquefaction", "capital_cost"], p_nom_extendable=True, - lifetime=costs.at["H2 liquefaction", "lifetime"], + **hydrogen_liquefaction, ) 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.add( "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"] + p_set=share["hydrogen"] * p_set * fuel_demand["hydrogen"], ) + if share["methanol"]: p_set_methanol_shipping = ( - shipping_methanol_share + share["methanol"] * p_set.rename(lambda x: x + " shipping methanol") - * efficiency + * fuel_demand["methanol"] ) if not options["methanol"]["regional_methanol_demand"]: @@ -5870,16 +5846,13 @@ def add_shipping( n.add( "Link", spatial.methanol.shipping, - bus0=spatial.methanol.nodes, bus1=spatial.methanol.shipping, - bus2="co2 atmosphere", - carrier="shipping methanol", p_nom_extendable=True, - efficiency2=costs.at["methanolisation", "carbondioxide-input"], + **supply["methanol"], ) - if shipping_oil_share: - p_set_oil = shipping_oil_share * p_set.rename(lambda x: x + " shipping oil") + if share["oil"]: + p_set_oil = share["oil"] * p_set.rename(lambda x: x + " shipping oil") if not options["regional_oil_demand"]: p_set_oil = p_set_oil.sum() @@ -5903,26 +5876,18 @@ def add_shipping( n.add( "Link", spatial.oil.shipping, - bus0=spatial.oil.nodes, bus1=spatial.oil.shipping, - bus2="co2 atmosphere", - carrier="shipping oil", p_nom_extendable=True, - efficiency2=costs.at["oil", "CO2 intensity"], + **supply["oil"], ) - if shipping_lng_share: - efficiency = options["shipping_oil_efficiency"] / ( - _shipping_lng_useful_efficiency(options) - ) + if share["lng"]: p_set_lng = ( - shipping_lng_share + share["lng"] * p_set.rename(lambda x: x + " shipping LNG") - * efficiency + * fuel_demand["lng"] ) - _add_lng_liquefaction(n, costs, nodes, spatial) - n.add( "Bus", nodes + " shipping LNG", @@ -5942,172 +5907,9 @@ def add_shipping( n.add( "Link", nodes + " shipping LNG", - bus0=nodes + " LNG", bus1=nodes + " shipping LNG", - bus2="co2 atmosphere", - carrier="shipping LNG", - p_nom_extendable=True, - efficiency2=_shipping_lng_co2_equivalent(costs, options), - ) - - -def _add_shipping_endogenous( - n: pypsa.Network, - costs: pd.DataFrame, - p_set: pd.Series, - nodes: pd.Index, - options: dict, - spatial: SimpleNamespace, - investment_year: int, -) -> None: - """ - Endogenous shipping: one shared per-node " shipping" - service-demand Bus/Load, fed by competing supply Links from oil, - methanol, gas, and hydrogen. The optimiser picks the cost-minimal fuel - mix each snapshot rather than following a fixed exogenous share. - - Each fuel Link's ``efficiency`` converts its own raw fuel energy into - the shared bus's "oil-equivalent" service-energy units (matching the - historical demand data's own convention) as - (that fuel's engine efficiency) / options["shipping_oil_efficiency"]; - for oil this is 1 by construction. Oil and LNG combustion additionally - emit to "co2 atmosphere" via ``efficiency2`` (their CO2 intensity, same - convention as gas/oil-for-industry); methanol's combustion emission - here is offset elsewhere in the network by its own upstream synthesis - from captured CO2 (methanolisation); hydrogen (via fuel cell) emits - nothing at the point of use. - - Gas-fuelled shipping only exists in practice as LNG -- a ship cannot - bunker directly from a pipeline -- so gas is unconditionally liquefied - to LNG (own "CH4 liquefaction" Link, real capital cost -- an LNG plant, - not a ship retrofit) before the "shipping LNG" Link draws from that LNG - bus. Unlike the optional hydrogen liquefaction step below (gaseous H2 - is a physically valid alternative fuel), there is no non-liquefied - alternative for gas, so this is not a configurable option. The - liquefaction step is electricity-driven, not gas-combusting: CH4 passes - through at efficiency=1 (no gas is burned to run the process, matching - the technology-data "methane-input" of 1.0), and the parasitic - refrigeration load is drawn separately from the node's electricity bus - via bus2 ("electricity-input" from technology-data). - - Individual fuels are toggled independently via options["shipping_oil"] - / ["shipping_methanol"] / ["shipping_lng"] / ["shipping_hydrogen"] - (each a flat bool or a year-indexed dict, resolved at investment_year) - -- at least one must be true for this investment_year. The mix is - entirely a model outcome, constrained only by the economy-wide - CO2Limit/fossil_fuel_limit (no shipping-specific emissions cap). - """ - fuel_enabled = { - fuel: bool(get(options[f"shipping_{fuel}"], investment_year)) - for fuel in ["oil", "methanol", "lng", "hydrogen"] - } - - if not any(fuel_enabled.values()): - raise ValueError( - "At least one of sector.shipping_oil/shipping_methanol/" - "shipping_lng/shipping_hydrogen must be true for " - f"investment_year={investment_year}." - ) - - n.add("Carrier", "shipping") - n.add( - "Bus", - nodes + " shipping", - location=nodes, - carrier="shipping", - unit="MWh_LHV", - ) - n.add( - "Load", - nodes + " shipping", - bus=nodes + " shipping", - carrier="shipping", - p_set=p_set.rename(lambda x: x + " shipping"), - ) - - oil_efficiency = options["shipping_oil_efficiency"] - - if fuel_enabled["oil"]: - n.add( - "Link", - nodes + " shipping oil", - bus0=spatial.oil.nodes, - bus1=nodes + " shipping", - bus2="co2 atmosphere", - carrier="shipping oil", - p_nom_extendable=True, - efficiency=1.0, - efficiency2=costs.at["oil", "CO2 intensity"], - ) - - if fuel_enabled["methanol"]: - n.add( - "Link", - nodes + " shipping methanol", - bus0=spatial.methanol.nodes, - bus1=nodes + " shipping", - bus2="co2 atmosphere", - carrier="shipping methanol", - p_nom_extendable=True, - efficiency=options["shipping_methanol_efficiency"] / oil_efficiency, - efficiency2=costs.at["methanolisation", "carbondioxide-input"], - ) - - if fuel_enabled["lng"]: - # Gas-fuelled shipping only exists in practice as LNG -- a ship - # cannot bunker directly from a pipeline -- so liquefaction is - # unconditional here, unlike the optional hydrogen liquefaction - # step below (gaseous H2 is a physically valid alternative; raw - # pipeline gas bunkered directly onto a ship is not). - _add_lng_liquefaction(n, costs, nodes, spatial) - - n.add( - "Link", - nodes + " shipping LNG", - bus0=nodes + " LNG", - bus1=nodes + " shipping", - bus2="co2 atmosphere", - carrier="shipping LNG", - p_nom_extendable=True, - efficiency=_shipping_lng_useful_efficiency(options) / oil_efficiency, - efficiency2=_shipping_lng_co2_equivalent(costs, options), - ) - - if fuel_enabled["hydrogen"]: - if options["shipping_hydrogen_liquefaction"]: - n.add( - "Bus", - nodes, - suffix=" H2 liquid", - carrier="H2 liquid", - location=nodes, - unit="MWh_LHV", - ) - - n.add( - "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", "capital_cost"], - p_nom_extendable=True, - lifetime=costs.at["H2 liquefaction", "lifetime"], - ) - - h2_bus = nodes + " H2 liquid" - else: - h2_bus = nodes + " H2" - - n.add( - "Link", - nodes + " H2 for shipping", - bus0=h2_bus, - bus1=nodes + " shipping", - carrier="H2 for shipping", p_nom_extendable=True, - efficiency=costs.at["fuel cell", "efficiency"] / oil_efficiency, + **supply["lng"], ) From 8f1d30a86cba422b2c6cc65d2b8444f50e0583a2 Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Thu, 19 Nov 2026 10:05:00 +0100 Subject: [PATCH 3/6] Update myopic test objective values --- config/test/config.myopic.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/test/config.myopic.yaml b/config/test/config.myopic.yaml index 154f95a7d7..7c2f3a7c02 100644 --- a/config/test/config.myopic.yaml +++ b/config/test/config.myopic.yaml @@ -118,9 +118,9 @@ solving: check_objective: enable: true expected_value: - 2030: 590080918.18 - 2040: 444268247.80 - 2050: 331321452.53 + 2030: 596737106.04 + 2040: 460935262.27 + 2050: 350446083.49 plotting: map: From eff4f8c5f4202940b149d243e67e7454264354e4 Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Thu, 19 Nov 2026 10:31:27 +0100 Subject: [PATCH 4/6] Always liquefy hydrogen for shipping, remove shipping_hydrogen_liquefaction --- config/config.default.yaml | 1 - config/schema.default.json | 10 ----- doc/design/transport.md | 4 +- doc/release_notes.md | 2 +- scripts/lib/validation/config/sector.py | 4 -- scripts/prepare_sector_network.py | 54 +++++++++++-------------- 6 files changed, 27 insertions(+), 48 deletions(-) diff --git a/config/config.default.yaml b/config/config.default.yaml index 4e3c268fa0..1fe8ea3325 100644 --- a/config/config.default.yaml +++ b/config/config.default.yaml @@ -839,7 +839,6 @@ sector: agriculture_machinery_oil_share: 0.5 agriculture_machinery_fuel_efficiency: 0.7 agriculture_machinery_electric_efficiency: 0.3 - shipping_hydrogen_liquefaction: false shipping_endogenous: [] shipping_hydrogen_share: 2020: 0 diff --git a/config/schema.default.json b/config/schema.default.json index 30e75f36cc..cb739ff952 100644 --- a/config/schema.default.json +++ b/config/schema.default.json @@ -5224,11 +5224,6 @@ "description": "The efficiency of oil-powered machinery in the conversion of oil to meet agricultural needs.", "type": "number" }, - "shipping_hydrogen_liquefaction": { - "default": false, - "description": "Whether to include liquefaction costs and electricity demand for hydrogen in shipping.", - "type": "boolean" - }, "shipping_endogenous": { "description": "Fuels with an optimised instead of an exogenous share. They compete for the shipping demand that the `shipping_*_share` settings of the other fuels leave uncovered, and each supplies a constant output over the year. Ship costs do not differ by fuel, so the cheapest fuel tends to supply all of this demand.", "items": { @@ -13234,11 +13229,6 @@ "description": "The efficiency of oil-powered machinery in the conversion of oil to meet agricultural needs.", "type": "number" }, - "shipping_hydrogen_liquefaction": { - "default": false, - "description": "Whether to include liquefaction costs and electricity demand for hydrogen in shipping.", - "type": "boolean" - }, "shipping_endogenous": { "description": "Fuels with an optimised instead of an exogenous share. They compete for the shipping demand that the `shipping_*_share` settings of the other fuels leave uncovered, and each supplies a constant output over the year. Ship costs do not differ by fuel, so the cheapest fuel tends to supply all of this demand.", "items": { diff --git a/doc/design/transport.md b/doc/design/transport.md index 20503c3872..634e474889 100644 --- a/doc/design/transport.md +++ b/doc/design/transport.md @@ -48,8 +48,8 @@ kerosene or synthetic fuels, and optionally by kerosene made from methanol. network that is liquefied with electricity, see [Methane](methane.md). LNG engines release a share of the fuel unburnt, and this methane slip counts towards the emission limit in CO~2~ equivalents. Methanol and LNG ships -are assumed to be as efficient as oil ships [@imoFourthGHG2020]. The cost and electricity -demand of liquefying hydrogen can be included where hydrogen is used. +are assumed to be as efficient as oil ships [@imoFourthGHG2020]. Hydrogen is +liquefied with electricity too. Optionally, the shares of selected fuels are optimised instead. These fuels compete for the demand that the prescribed shares of the other fuels leave diff --git a/doc/release_notes.md b/doc/release_notes.md index d3c0f38011..bc1d97b9b9 100644 --- a/doc/release_notes.md +++ b/doc/release_notes.md @@ -5,7 +5,7 @@ -* Feature: Add LNG as shipping fuel (`sector: shipping_lng_share`) and optionally optimise the shares of the fuels listed in `sector: shipping_endogenous`. `sector: shipping_hydrogen_liquefaction` now includes the electricity demand ([#2317](https://github.com/PyPSA/pypsa-eur/pull/2317)). +* Feature: Add LNG as shipping fuel (`sector: shipping_lng_share`) and optionally optimise the shares of the fuels listed in `sector: shipping_endogenous`. Hydrogen for shipping is now always liquefied, including the electricity demand, and `sector: shipping_hydrogen_liquefaction` is removed ([#2317](https://github.com/PyPSA/pypsa-eur/pull/2317)). * Change: Methanol-powered ships are now as efficient as oil-powered ships (`sector: shipping_methanol_efficiency`), following the Fourth IMO GHG Study 2020. This changes default results ([#2317](https://github.com/PyPSA/pypsa-eur/pull/2317)). * Fix: Gas pipelines ending in regions without an onshore region, e.g. offshore junctions at high resolution, now get gas and H2 buses instead of leaving the network inconsistent ([#2429](https://github.com/PyPSA/pypsa-eur/pull/2429)). * Fix: Offshore wind profiles no longer fail for clustered buses without an onshore region; the nearest onshore regions then serve as the shoreline ([#2425](https://github.com/PyPSA/pypsa-eur/pull/2425)). diff --git a/scripts/lib/validation/config/sector.py b/scripts/lib/validation/config/sector.py index 1756a7fd5e..6f7ab27111 100644 --- a/scripts/lib/validation/config/sector.py +++ b/scripts/lib/validation/config/sector.py @@ -723,10 +723,6 @@ class SectorConfig(BaseModel): description="The efficiency of oil-powered machinery in the conversion of oil to meet agricultural needs.", ) - shipping_hydrogen_liquefaction: bool = Field( - False, - description="Whether to include liquefaction costs and electricity demand for hydrogen in shipping.", - ) shipping_endogenous: list[Literal["hydrogen", "methanol", "oil", "lng"]] = Field( default_factory=list, description="Fuels with an optimised instead of an exogenous share. They compete for the shipping demand that the `shipping_*_share` settings of the other fuels leave uncovered, and each supplies a constant output over the year. Ship costs do not differ by fuel, so the cheapest fuel tends to supply all of this demand.", diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index 2bcf80ca7b..d2970c3f81 100755 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -5688,6 +5688,7 @@ def add_shipping( total_share = sum(share.values()) if endogenous and total_share >= 1: + logger.info("Exogenous shipping shares leave no demand to optimise.") endogenous = [] elif not endogenous and total_share != 1: logger.warning( @@ -5712,13 +5713,11 @@ def add_shipping( "lng": oil_efficiency / options["shipping_lng_efficiency"], } - hydrogen_liquefaction = {} - if options["shipping_hydrogen_liquefaction"]: - hydrogen_liquefaction = dict( - bus2=nodes, - efficiency2=-costs.at["H2 liquefaction", "electricity-input"], - capital_cost=costs.at["H2 liquefaction", "capital_cost"], - ) + hydrogen_liquefaction = dict( + bus2=nodes, + efficiency2=-costs.at["H2 liquefaction", "electricity-input"], + capital_cost=costs.at["H2 liquefaction", "capital_cost"], + ) # unburnt methane with 50 MJ/kg counts as CO2 equivalent slip = options["shipping_lng_methane_slip"] @@ -5784,35 +5783,30 @@ def add_shipping( ) if share["hydrogen"]: - if hydrogen_liquefaction: - n.add( - "Bus", - nodes, - suffix=" H2 liquid", - carrier="H2 liquid", - location=nodes, - unit="MWh_LHV", - ) - - n.add( - "Link", - nodes + " H2 liquefaction", - bus0=nodes + " H2", - bus1=nodes + " H2 liquid", - carrier="H2 liquefaction", - p_nom_extendable=True, - **hydrogen_liquefaction, - ) + n.add( + "Bus", + nodes, + suffix=" H2 liquid", + carrier="H2 liquid", + location=nodes, + unit="MWh_LHV", + ) - shipping_bus = nodes + " H2 liquid" - else: - shipping_bus = nodes + " H2" + n.add( + "Link", + nodes + " H2 liquefaction", + bus0=nodes + " H2", + bus1=nodes + " H2 liquid", + carrier="H2 liquefaction", + p_nom_extendable=True, + **hydrogen_liquefaction, + ) n.add( "Load", nodes, suffix=" H2 for shipping", - bus=shipping_bus, + bus=nodes + " H2 liquid", carrier="H2 for shipping", p_set=share["hydrogen"] * p_set * fuel_demand["hydrogen"], ) From 5e77b2857c7b6f4708da24cbe2a8c45037259ad2 Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Thu, 19 Nov 2026 10:46:27 +0100 Subject: [PATCH 5/6] Unify shipping fuels in one loop, rename H2 for shipping to shipping hydrogen --- config/plotting.default.yaml | 2 +- doc/release_notes.md | 2 +- scripts/lib/validation/config/plotting.py | 2 +- scripts/prepare_sector_network.py | 189 ++++++---------------- 4 files changed, 55 insertions(+), 140 deletions(-) diff --git a/config/plotting.default.yaml b/config/plotting.default.yaml index 6e0bc0d3a5..adcb3a4c4b 100644 --- a/config/plotting.default.yaml +++ b/config/plotting.default.yaml @@ -649,7 +649,7 @@ plotting: retrofitting: "#8487e8" building retrofitting: "#8487e8" H2 for industry: "#f073da" - H2 for shipping: "#ebaee0" + shipping hydrogen: "#ebaee0" H2: "#bf13a0" hydrogen: "#bf13a0" retrofitted H2 boiler: "#e5a0d9" diff --git a/doc/release_notes.md b/doc/release_notes.md index bc1d97b9b9..bc998d2ffd 100644 --- a/doc/release_notes.md +++ b/doc/release_notes.md @@ -5,7 +5,7 @@ -* Feature: Add LNG as shipping fuel (`sector: shipping_lng_share`) and optionally optimise the shares of the fuels listed in `sector: shipping_endogenous`. Hydrogen for shipping is now always liquefied, including the electricity demand, and `sector: shipping_hydrogen_liquefaction` is removed ([#2317](https://github.com/PyPSA/pypsa-eur/pull/2317)). +* Feature: Add LNG as shipping fuel (`sector: shipping_lng_share`) and optionally optimise the shares of the fuels listed in `sector: shipping_endogenous`. Hydrogen for shipping is now always liquefied, including the electricity demand, `sector: shipping_hydrogen_liquefaction` is removed and the carrier `H2 for shipping` is renamed to `shipping hydrogen` ([#2317](https://github.com/PyPSA/pypsa-eur/pull/2317)). * Change: Methanol-powered ships are now as efficient as oil-powered ships (`sector: shipping_methanol_efficiency`), following the Fourth IMO GHG Study 2020. This changes default results ([#2317](https://github.com/PyPSA/pypsa-eur/pull/2317)). * Fix: Gas pipelines ending in regions without an onshore region, e.g. offshore junctions at high resolution, now get gas and H2 buses instead of leaving the network inconsistent ([#2429](https://github.com/PyPSA/pypsa-eur/pull/2429)). * Fix: Offshore wind profiles no longer fail for clustered buses without an onshore region; the nearest onshore regions then serve as the shoreline ([#2425](https://github.com/PyPSA/pypsa-eur/pull/2425)). diff --git a/scripts/lib/validation/config/plotting.py b/scripts/lib/validation/config/plotting.py index ac67ef48ab..ae4bf00b34 100644 --- a/scripts/lib/validation/config/plotting.py +++ b/scripts/lib/validation/config/plotting.py @@ -878,7 +878,7 @@ def _default_balance_map_interactive() -> _BalanceMapInteractiveConfig: "building retrofitting": "#8487e8", # hydrogen "H2 for industry": "#f073da", - "H2 for shipping": "#ebaee0", + "shipping hydrogen": "#ebaee0", "H2": "#bf13a0", "hydrogen": "#bf13a0", "retrofitted H2 boiler": "#e5a0d9", diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index d2970c3f81..68541f4fc5 100755 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -5713,22 +5713,19 @@ def add_shipping( "lng": oil_efficiency / options["shipping_lng_efficiency"], } - hydrogen_liquefaction = dict( - bus2=nodes, - efficiency2=-costs.at["H2 liquefaction", "electricity-input"], - capital_cost=costs.at["H2 liquefaction", "capital_cost"], - ) - # unburnt methane with 50 MJ/kg counts as CO2 equivalent slip = options["shipping_lng_methane_slip"] lng_co2_intensity = (1 - slip) * costs.at["gas", "CO2 intensity"] lng_co2_intensity += slip * 3.6 / 50 * options["shipping_methane_gwp100"] + # links for hydrogen and LNG include the liquefaction supply = { "hydrogen": dict( bus0=nodes + " H2", - carrier="H2 for shipping", - **hydrogen_liquefaction, + bus2=nodes, + carrier="shipping hydrogen", + efficiency2=-costs.at["H2 liquefaction", "electricity-input"], + capital_cost=costs.at["H2 liquefaction", "capital_cost"], ), "methanol": dict( bus0=spatial.methanol.nodes, @@ -5742,7 +5739,6 @@ def add_shipping( carrier="shipping oil", efficiency2=costs.at["oil", "CO2 intensity"], ), - # includes the liquefaction of gas to LNG "lng": dict( bus0=spatial.gas.df.loc[nodes, "nodes"].values, bus2="co2 atmosphere", @@ -5754,6 +5750,14 @@ def add_shipping( ), } + # demand buses and their locations for fuels with exogenous shares + demand = { + "hydrogen": (nodes + " shipping hydrogen", nodes), + "methanol": (spatial.methanol.shipping, spatial.methanol.demand_locations), + "oil": (spatial.oil.shipping, spatial.oil.demand_locations), + "lng": (nodes + " shipping LNG", nodes), + } + if endogenous: n.add( "Bus", @@ -5771,140 +5775,51 @@ def add_shipping( p_set=(1 - total_share) * p_set.rename(lambda x: x + " shipping"), ) - for fuel in endogenous: - n.add( - "Link", - nodes + " " + supply[fuel]["carrier"], - bus1=nodes + " shipping", - p_nom_extendable=True, - p_min_pu=1, - efficiency=1 / fuel_demand[fuel], - **supply[fuel], - ) - - if share["hydrogen"]: - n.add( - "Bus", - nodes, - suffix=" H2 liquid", - carrier="H2 liquid", - location=nodes, - unit="MWh_LHV", - ) - - n.add( - "Link", - nodes + " H2 liquefaction", - bus0=nodes + " H2", - bus1=nodes + " H2 liquid", - carrier="H2 liquefaction", - p_nom_extendable=True, - **hydrogen_liquefaction, - ) - - n.add( - "Load", - nodes, - suffix=" H2 for shipping", - bus=nodes + " H2 liquid", - carrier="H2 for shipping", - p_set=share["hydrogen"] * p_set * fuel_demand["hydrogen"], - ) - - if share["methanol"]: - p_set_methanol_shipping = ( - share["methanol"] - * p_set.rename(lambda x: x + " shipping methanol") - * fuel_demand["methanol"] - ) - - if not options["methanol"]["regional_methanol_demand"]: - p_set_methanol_shipping = p_set_methanol_shipping.sum() - - n.add( - "Bus", - spatial.methanol.shipping, - location=spatial.methanol.demand_locations, - carrier="shipping methanol", - unit="MWh_LHV", - ) - - n.add( - "Load", - spatial.methanol.shipping, - bus=spatial.methanol.shipping, - carrier="shipping methanol", - p_set=p_set_methanol_shipping, - ) - - n.add( - "Link", - spatial.methanol.shipping, - bus1=spatial.methanol.shipping, - p_nom_extendable=True, - **supply["methanol"], - ) - - if share["oil"]: - p_set_oil = share["oil"] * p_set.rename(lambda x: x + " shipping oil") + for fuel, link in supply.items(): + carrier = link["carrier"] - if not options["regional_oil_demand"]: - p_set_oil = p_set_oil.sum() - - n.add( - "Bus", - spatial.oil.shipping, - location=spatial.oil.demand_locations, - carrier="shipping oil", - unit="MWh_LHV", - ) - - n.add( - "Load", - spatial.oil.shipping, - bus=spatial.oil.shipping, - carrier="shipping oil", - p_set=p_set_oil, - ) + if fuel in endogenous: + n.add( + "Link", + nodes + " " + carrier, + bus1=nodes + " shipping", + p_nom_extendable=True, + p_min_pu=1, + efficiency=1 / fuel_demand[fuel], + **link, + ) - n.add( - "Link", - spatial.oil.shipping, - bus1=spatial.oil.shipping, - p_nom_extendable=True, - **supply["oil"], - ) + elif share[fuel]: + buses, locations = demand[fuel] - if share["lng"]: - p_set_lng = ( - share["lng"] - * p_set.rename(lambda x: x + " shipping LNG") - * fuel_demand["lng"] - ) + p_set_fuel = share[fuel] * fuel_demand[fuel] * p_set + p_set_fuel = p_set_fuel.rename(lambda x: f"{x} {carrier}") + if len(buses) < len(nodes): + p_set_fuel = p_set_fuel.sum() - n.add( - "Bus", - nodes + " shipping LNG", - location=nodes, - carrier="shipping LNG", - unit="MWh_LHV", - ) + n.add( + "Bus", + buses, + location=locations, + carrier=carrier, + unit="MWh_LHV", + ) - n.add( - "Load", - nodes + " shipping LNG", - bus=nodes + " shipping LNG", - carrier="shipping LNG", - p_set=p_set_lng, - ) + n.add( + "Load", + buses, + bus=buses, + carrier=carrier, + p_set=p_set_fuel, + ) - n.add( - "Link", - nodes + " shipping LNG", - bus1=nodes + " shipping LNG", - p_nom_extendable=True, - **supply["lng"], - ) + n.add( + "Link", + buses, + bus1=buses, + p_nom_extendable=True, + **link, + ) def add_waste_heat( From e1cdc59249cc791b9f3973c418ac10fd990be84d Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Thu, 19 Nov 2026 11:16:22 +0100 Subject: [PATCH 6/6] Account for hydrogen losses in liquefaction for shipping --- 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 68541f4fc5..9789832c54 100755 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -5706,8 +5706,10 @@ def add_shipping( # fuel demand per oil-equivalent demand oil_efficiency = options["shipping_oil_efficiency"] + # hydrogen input per liquefied hydrogen + h2_input = costs.at["H2 liquefaction", "hydrogen-input"] fuel_demand = { - "hydrogen": oil_efficiency / costs.at["fuel cell", "efficiency"], + "hydrogen": oil_efficiency * h2_input / costs.at["fuel cell", "efficiency"], "methanol": oil_efficiency / options["shipping_methanol_efficiency"], "oil": 1.0, "lng": oil_efficiency / options["shipping_lng_efficiency"], @@ -5724,8 +5726,8 @@ def add_shipping( bus0=nodes + " H2", bus2=nodes, carrier="shipping hydrogen", - efficiency2=-costs.at["H2 liquefaction", "electricity-input"], - capital_cost=costs.at["H2 liquefaction", "capital_cost"], + efficiency2=-costs.at["H2 liquefaction", "electricity-input"] / h2_input, + capital_cost=costs.at["H2 liquefaction", "capital_cost"] / h2_input, ), "methanol": dict( bus0=spatial.methanol.nodes,