diff --git a/config/config.default.yaml b/config/config.default.yaml index f9c2912caf..1fe8ea3325 100644 --- a/config/config.default.yaml +++ b/config/config.default.yaml @@ -839,7 +839,7 @@ 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 2025: 0 @@ -864,8 +864,19 @@ sector: 2040: 0.45 2045: 0.2 2050: 0 - shipping_methanol_efficiency: 0.46 + shipping_lng_share: + 2020: 0 + 2025: 0 + 2030: 0 + 2035: 0 + 2040: 0 + 2045: 0 + 2050: 0 + shipping_methanol_efficiency: 0.4 shipping_oil_efficiency: 0.4 + shipping_lng_efficiency: 0.4 + 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 e5bad43b4e..adcb3a4c4b 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" @@ -648,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/config/schema.default.json b/config/schema.default.json index 3d368f1c01..cb739ff952 100644 --- a/config/schema.default.json +++ b/config/schema.default.json @@ -5224,10 +5224,18 @@ "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 for hydrogen demand 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": { + "enum": [ + "hydrogen", + "methanol", + "oil", + "lng" + ], + "type": "string" + }, + "type": "array" }, "shipping_hydrogen_share": { "additionalProperties": { @@ -5250,10 +5258,17 @@ "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. 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": { @@ -5261,6 +5276,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.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 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 to convert the methane slip of LNG-powered ships to CO2 equivalent.", + "type": "number" + }, "aviation_demand_factor": { "default": 1.0, "description": "The proportion of demand for aviation compared to today's consumption.", @@ -13199,10 +13229,18 @@ "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 for hydrogen demand 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": { + "enum": [ + "hydrogen", + "methanol", + "oil", + "lng" + ], + "type": "string" + }, + "type": "array" }, "shipping_hydrogen_share": { "additionalProperties": { @@ -13225,10 +13263,17 @@ "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. 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": { @@ -13236,6 +13281,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.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 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 to convert the methane slip of LNG-powered ships to CO2 equivalent.", + "type": "number" + }, "aviation_demand_factor": { "default": 1.0, "description": "The proportion of demand for aviation compared to today's consumption.", 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: 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..634e474889 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]. 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 +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..bc998d2ffd 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`. 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)). * 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..ae4bf00b34 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", @@ -877,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/lib/validation/config/sector.py b/scripts/lib/validation/config/sector.py index a4bb8b8f87..6f7ab27111 100644 --- a/scripts/lib/validation/config/sector.py +++ b/scripts/lib/validation/config/sector.py @@ -723,9 +723,9 @@ 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 for hydrogen demand 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.", ) shipping_hydrogen_share: dict[int, float] = Field( default_factory=lambda: { @@ -763,14 +763,38 @@ class SectorConfig(BaseModel): }, description="The share of ships powered by oil in a given year.", ) + 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. 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.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 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 to convert the methane slip of LNG-powered ships to CO2 equivalent.", + ) aviation_demand_factor: float = Field( 1.0, diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index e1a17bbdc1..9789832c54 100755 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -5661,18 +5661,36 @@ def add_shipping( spatial: SimpleNamespace, investment_year: int, ) -> None: + """ + Add shipping demand supplied by hydrogen, methanol, oil and LNG. + + 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) + 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 - if total_share != 1: + 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( f"Total shipping shares sum up to {total_share:.2%}, corresponding to increased or decreased demand assumptions." ) @@ -5686,128 +5704,124 @@ 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) - ) - efficiency = oil_efficiency / costs.at["fuel cell", "efficiency"] - shipping_hydrogen_share = get( - options["shipping_hydrogen_share"], investment_year - ) - - 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"], - ) - - 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, - ) + # 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 * h2_input / costs.at["fuel cell", "efficiency"], + "methanol": oil_efficiency / options["shipping_methanol_efficiency"], + "oil": 1.0, + "lng": oil_efficiency / options["shipping_lng_efficiency"], + } - if shipping_methanol_share: - efficiency = ( - options["shipping_oil_efficiency"] / options["shipping_methanol_efficiency"] - ) + # 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"] - p_set_methanol_shipping = ( - shipping_methanol_share - * p_set.rename(lambda x: x + " shipping methanol") - * efficiency - ) + # links for hydrogen and LNG include the liquefaction + supply = { + "hydrogen": dict( + bus0=nodes + " H2", + bus2=nodes, + carrier="shipping hydrogen", + 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, + 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"], + ), + "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 not options["methanol"]["regional_methanol_demand"]: - p_set_methanol_shipping = p_set_methanol_shipping.sum() + # 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", - spatial.methanol.shipping, - location=spatial.methanol.demand_locations, - carrier="shipping methanol", + nodes + " shipping", + location=nodes, + carrier="shipping", unit="MWh_LHV", ) n.add( "Load", - spatial.methanol.shipping, - bus=spatial.methanol.shipping, - carrier="shipping methanol", - p_set=p_set_methanol_shipping, + nodes + " shipping", + bus=nodes + " shipping", + carrier="shipping", + p_set=(1 - total_share) * p_set.rename(lambda x: x + " 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"], - ) + for fuel, link in supply.items(): + carrier = link["carrier"] - if shipping_oil_share: - p_set_oil = shipping_oil_share * p_set.rename(lambda x: x + " shipping 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, + ) - if not options["regional_oil_demand"]: - p_set_oil = p_set_oil.sum() + elif share[fuel]: + buses, locations = demand[fuel] - n.add( - "Bus", - spatial.oil.shipping, - location=spatial.oil.demand_locations, - carrier="shipping oil", - unit="MWh_LHV", - ) + 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( - "Load", - spatial.oil.shipping, - bus=spatial.oil.shipping, - carrier="shipping oil", - p_set=p_set_oil, - ) + n.add( + "Bus", + buses, + location=locations, + carrier=carrier, + unit="MWh_LHV", + ) - 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"], - ) + n.add( + "Load", + buses, + bus=buses, + carrier=carrier, + p_set=p_set_fuel, + ) + + n.add( + "Link", + buses, + bus1=buses, + p_nom_extendable=True, + **link, + ) def add_waste_heat(