diff --git a/README.md b/README.md index d5a72b77..5c918c9a 100644 --- a/README.md +++ b/README.md @@ -65,10 +65,10 @@ The dataset consists of: (alternating current lines at and above 220kV voltage level and all high voltage direct current lines) and 3803 substations. - The open power plant database - [powerplantmatching](https://github.com/FRESNA/powerplantmatching). + [powerplantmatching](https://github.com/PyPSA/powerplantmatching). - Electrical demand time series from the [OPSD project](https://open-power-system-data.org/). -- Renewable time series based on ERA5 and SARAH, assembled using the [atlite tool](https://github.com/FRESNA/atlite). +- Renewable time series based on ERA5 and SARAH, assembled using the [atlite tool](https://github.com/PyPSA/atlite). - Geographical potentials for wind and solar generators based on land use (CORINE) and excluding nature reserves (Natura2000) are computed with the [atlite library](https://github.com/PyPSA/atlite). A sector-coupled extension adds demand diff --git a/config/config.default.yaml b/config/config.default.yaml index 621eb8ce..10d16614 100644 --- a/config/config.default.yaml +++ b/config/config.default.yaml @@ -397,6 +397,7 @@ sector: biomass: true industry: true agriculture: true + fossil_fuels: true district_heating: potential: 0.6 progress: @@ -610,6 +611,7 @@ sector: conventional_generation: OCGT: gas biomass_to_liquid: false + electrobiofuels: false biosng: false limit_max_growth: enable: false @@ -632,6 +634,11 @@ sector: max_boost: 0.25 var_cf: true sustainability_factor: 0.0025 + solid_biomass_import: + enable: false + price: 54 #EUR/MWh + max_amount: 1390 # TWh + upstream_emissions_factor: .1 #share of solid biomass CO2 emissions at full combustion # docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#industry industry: @@ -1029,6 +1036,7 @@ plotting: biogas: '#e3d37d' biomass: '#baa741' solid biomass: '#baa741' + solid biomass import: '#d5ca8d' solid biomass transport: '#baa741' solid biomass for industry: '#7a6d26' solid biomass for industry CC: '#47411c' @@ -1042,6 +1050,7 @@ plotting: services rural biomass boiler: '#c6cf98' services urban decentral biomass boiler: '#dde5b5' biomass to liquid: '#32CD32' + electrobiofuels: 'red' BioSNG: '#123456' # power transmission lines: '#6c9459' diff --git a/doc/configtables/sector.csv b/doc/configtables/sector.csv index 5045cecd..c96aa629 100644 --- a/doc/configtables/sector.csv +++ b/doc/configtables/sector.csv @@ -4,8 +4,9 @@ heating,--,"{true, false}",Flag to include heating sector. biomass,--,"{true, false}",Flag to include biomass sector. industry,--,"{true, false}",Flag to include industry sector. agriculture,--,"{true, false}",Flag to include agriculture sector. +fossil_fuels,--,"{true, false}","Flag to include imports of fossil fuels ( [""coal"", ""gas"", ""oil"", ""lignite""])" district_heating,--,,`prepare_sector_network.py `_ --- potential,--,float,maximum fraction of urban demand which can be supplied by district heating. Ignored where below current fraction. +-- potential,--,float,maximum fraction of urban demand which can be supplied by district heating -- progress,--,Dictionary with planning horizons as keys., Increase of today's district heating demand to potential maximum district heating share. Progress = 0 means today's district heating share. Progress = 1 means maximum fraction of urban demand is supplied by district heating -- district_heating_loss,--,float,Share increase in district heat demand in urban central due to heat losses cluster_heat_buses,--,"{true, false}",Cluster residential and service heat buses in `prepare_sector_network.py `_ to one to save memory. @@ -153,3 +154,8 @@ enhanced_geothermal,,, -- max_boost,--,float,The maximum boost in power output under flexible operation -- var_cf,--,"{true, false}",Add option for variable capacity factor (see Ricks et al. 2024) -- sustainability_factor,--,float,Share of sourced heat that is replenished by the earth's core (see details in `build_egs_potentials.py `_) +solid_biomass_import,,, +-- enable,--,"{true, false}",Add option to include solid biomass imports +-- price,currency/MWh,float,Price for importing solid biomass +-- max_amount,Twh,float,Maximum solid biomass import potential +-- upstream_emissions_factor,p.u.,float,Upstream emissions of solid biomass imports diff --git a/doc/foresight.rst b/doc/foresight.rst index 400f67ce..43a93ead 100644 --- a/doc/foresight.rst +++ b/doc/foresight.rst @@ -242,7 +242,7 @@ Rule overview file `__ generated by pypsa-eur which, in turn, is based on the `powerplantmatching - `__ database. + `__ database. Existing wind and solar capacities are retrieved from `IRENA annual statistics `__ and distributed among the diff --git a/doc/preparation.rst b/doc/preparation.rst index 669f3392..4585f4db 100644 --- a/doc/preparation.rst +++ b/doc/preparation.rst @@ -25,7 +25,7 @@ With these and the externally extracted ENTSO-E online map topology Then the process continues by calculating conventional power plant capacities, potentials, and per-unit availability time series for variable renewable energy carriers and hydro power plants with the following rules: -- :mod:`build_powerplants` for today's thermal power plant capacities using `powerplantmatching `__ allocating these to the closest substation for each powerplant, +- :mod:`build_powerplants` for today's thermal power plant capacities using `powerplantmatching `__ allocating these to the closest substation for each powerplant, - :mod:`build_ship_raster` for building shipping traffic density, - :mod:`build_renewable_profiles` for the hourly capacity factors and installation potentials constrained by land-use in each substation's Voronoi cell for PV, onshore and offshore wind, and - :mod:`build_hydro_profile` for the hourly per-unit hydro power availability time series. diff --git a/doc/release_notes.rst b/doc/release_notes.rst index 383287a6..d2453bb1 100644 --- a/doc/release_notes.rst +++ b/doc/release_notes.rst @@ -10,6 +10,12 @@ Release Notes Upcoming Release ================ +* Add option to import solid biomass + +* Add option to produce electrobiofuels (flag ``electrobiofuels`) from solid biomass and hydrogen, as a combination of BtL and Fischer-Tropsch to make more use of the biogenic carbon + +* Add flag ``sector: fossil_fuels`` in config to remove the option of importing fossil fuels + * Renamed the carrier of batteries in BEVs from `battery storage` to `EV battery` and the corresponding bus carrier from `Li ion` to `EV battery`. This is to avoid confusion with stationary battery storage. * Changed default assumptions about waste heat usage from PtX and fuel cells in district heating. diff --git a/scripts/base_network.py b/scripts/base_network.py index 118e7dba..8172b332 100644 --- a/scripts/base_network.py +++ b/scripts/base_network.py @@ -808,7 +808,7 @@ def voronoi(points, outline, crs=4326): voronoi = gpd.GeoDataFrame(geometry=voronoi) joined = gpd.sjoin_nearest(pts, voronoi, how="right") - return joined.dissolve(by="Bus").squeeze() + return joined.dissolve(by="Bus").reindex(points.index).squeeze() def build_bus_shapes(n, country_shapes, offshore_shapes, countries): diff --git a/scripts/build_powerplants.py b/scripts/build_powerplants.py index 4e2bb88f..bde2bd38 100755 --- a/scripts/build_powerplants.py +++ b/scripts/build_powerplants.py @@ -6,7 +6,7 @@ # coding: utf-8 """ Retrieves conventional powerplant capacities and locations from -`powerplantmatching `_, assigns +`powerplantmatching `_, assigns these to buses and creates a ``.csv`` file. It is possible to amend the powerplant database with custom entries provided in ``data/custom_powerplants.csv``. @@ -30,17 +30,17 @@ Inputs ------ - ``networks/base.nc``: confer :ref:`base`. -- ``data/custom_powerplants.csv``: custom powerplants in the same format as `powerplantmatching `_ provides +- ``data/custom_powerplants.csv``: custom powerplants in the same format as `powerplantmatching `_ provides Outputs ------- -- ``resource/powerplants.csv``: A list of conventional power plants (i.e. neither wind nor solar) with fields for name, fuel type, technology, country, capacity in MW, duration, commissioning year, retrofit year, latitude, longitude, and dam information as documented in the `powerplantmatching README `_; additionally it includes information on the closest substation/bus in ``networks/base.nc``. +- ``resource/powerplants.csv``: A list of conventional power plants (i.e. neither wind nor solar) with fields for name, fuel type, technology, country, capacity in MW, duration, commissioning year, retrofit year, latitude, longitude, and dam information as documented in the `powerplantmatching README `_; additionally it includes information on the closest substation/bus in ``networks/base.nc``. .. image:: img/powerplantmatching.png :scale: 30 % - **Source:** `powerplantmatching on GitHub `_ + **Source:** `powerplantmatching on GitHub `_ Description ----------- diff --git a/scripts/cluster_gas_network.py b/scripts/cluster_gas_network.py index 6d4e6c48..b95c4580 100755 --- a/scripts/cluster_gas_network.py +++ b/scripts/cluster_gas_network.py @@ -58,6 +58,9 @@ def build_clustered_gas_network(df, bus_regions, length_factor=1.25): # drop pipes within the same region df = df.loc[df.bus1 != df.bus0] + if df.empty: + return df + # recalculate lengths as center to center * length factor df["length"] = df.apply( lambda p: length_factor diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index 898496d0..989bc4f9 100644 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -549,14 +549,17 @@ def add_carrier_buses(n, carrier, nodes=None): capital_cost=capital_cost, ) - n.madd( - "Generator", - nodes, - bus=nodes, - p_nom_extendable=True, - carrier=carrier, - marginal_cost=costs.at[carrier, "fuel"], - ) + fossils = ["coal", "gas", "oil", "lignite"] + if options.get("fossil_fuels", True) and carrier in fossils: + + n.madd( + "Generator", + nodes, + bus=nodes, + p_nom_extendable=True, + carrier=carrier, + marginal_cost=costs.at[carrier, "fuel"], + ) # TODO: PyPSA-Eur merge issue @@ -2677,6 +2680,54 @@ def add_biomass(n, costs): e_initial=solid_biomass_potentials_spatial, ) + if options["solid_biomass_import"].get("enable", False): + biomass_import_price = options["solid_biomass_import"]["price"] + # convert TWh in MWh + biomass_import_max_amount = options["solid_biomass_import"]["max_amount"] * 1e6 + biomass_import_upstream_emissions = options["solid_biomass_import"][ + "upstream_emissions_factor" + ] + + logger.info( + "Adding biomass import with cost %.2f EUR/MWh, a limit of %.2f TWh, and embedded emissions of %.2f%%", + biomass_import_price, + options["solid_biomass_import"]["max_amount"], + biomass_import_upstream_emissions * 100, + ) + + n.add("Carrier", "solid biomass import") + + n.madd( + "Bus", + ["EU solid biomass import"], + location="EU", + carrier="solid biomass import", + ) + + n.madd( + "Store", + ["solid biomass import"], + bus=["EU solid biomass import"], + carrier="solid biomass import", + e_nom=biomass_import_max_amount, + marginal_cost=biomass_import_price, + e_initial=biomass_import_max_amount, + ) + + n.madd( + "Link", + spatial.biomass.nodes, + suffix=" solid biomass import", + bus0=["EU solid biomass import"], + bus1=spatial.biomass.nodes, + bus2="co2 atmosphere", + carrier="solid biomass import", + efficiency=1.0, + efficiency2=biomass_import_upstream_emissions + * costs.at["solid biomass", "CO2 intensity"], + p_nom_extendable=True, + ) + n.madd( "Link", spatial.gas.biogas_to_gas, @@ -2809,28 +2860,23 @@ def add_biomass(n, costs): bus4=spatial.co2.df.loc[urban_central, "nodes"].values, carrier="urban central solid biomass CHP CC", p_nom_extendable=True, - capital_cost=costs.at[key, "fixed"] * costs.at[key, "efficiency"] + capital_cost=costs.at[key + " CC", "fixed"] + * costs.at[key + " CC", "efficiency"] + costs.at["biomass CHP capture", "fixed"] * costs.at["solid biomass", "CO2 intensity"], - marginal_cost=costs.at[key, "VOM"], - efficiency=costs.at[key, "efficiency"] + marginal_cost=costs.at[key + " CC", "VOM"], + efficiency=costs.at[key + " CC", "efficiency"] - costs.at["solid biomass", "CO2 intensity"] * ( costs.at["biomass CHP capture", "electricity-input"] + costs.at["biomass CHP capture", "compression-electricity-input"] ), - efficiency2=costs.at[key, "efficiency-heat"] - + costs.at["solid biomass", "CO2 intensity"] - * ( - costs.at["biomass CHP capture", "heat-output"] - + costs.at["biomass CHP capture", "compression-heat-output"] - - costs.at["biomass CHP capture", "heat-input"] - ), + efficiency2=costs.at[key + " CC", "efficiency-heat"], efficiency3=-costs.at["solid biomass", "CO2 intensity"] * costs.at["biomass CHP capture", "capture_rate"], efficiency4=costs.at["solid biomass", "CO2 intensity"] * costs.at["biomass CHP capture", "capture_rate"], - lifetime=costs.at[key, "lifetime"], + lifetime=costs.at[key + " CC", "lifetime"], ) if options["biomass_boiler"]: @@ -2872,11 +2918,12 @@ def add_biomass(n, costs): efficiency2=-costs.at["solid biomass", "CO2 intensity"] + costs.at["BtL", "CO2 stored"], p_nom_extendable=True, - capital_cost=costs.at["BtL", "fixed"], - marginal_cost=costs.at["BtL", "efficiency"] * costs.at["BtL", "VOM"], + capital_cost=costs.at["BtL", "fixed"] * costs.at["BtL", "efficiency"], + marginal_cost=costs.at["BtL", "VOM"] * costs.at["BtL", "efficiency"], ) - # TODO: Update with energy penalty + # Assuming that acid gas removal (incl. CO2) from syngas i performed with Rectisol + # process (Methanol) and that electricity demand for this is included in the base process n.madd( "Link", spatial.biomass.nodes, @@ -2892,9 +2939,46 @@ def add_biomass(n, costs): + costs.at["BtL", "CO2 stored"] * (1 - costs.at["BtL", "capture rate"]), efficiency3=costs.at["BtL", "CO2 stored"] * costs.at["BtL", "capture rate"], p_nom_extendable=True, - capital_cost=costs.at["BtL", "fixed"] + capital_cost=costs.at["BtL", "fixed"] * costs.at["BtL", "efficiency"] + costs.at["biomass CHP capture", "fixed"] * costs.at["BtL", "CO2 stored"], - marginal_cost=costs.at["BtL", "efficiency"] * costs.at["BtL", "VOM"], + marginal_cost=costs.at["BtL", "VOM"] * costs.at["BtL", "efficiency"], + ) + + # Electrobiofuels (BtL with hydrogen addition to make more use of biogenic carbon). + # Combination of efuels and biomass to liquid, both based on Fischer-Tropsch. + # Experimental version - use with caution + if options["electrobiofuels"]: + + efuel_scale_factor = costs.at["BtL", "C stored"] + name = ( + pd.Index(spatial.biomass.nodes) + + " " + + pd.Index(spatial.h2.nodes.str.replace(" H2", "")) + ) + n.madd( + "Link", + name, + suffix=" electrobiofuels", + bus0=spatial.biomass.nodes, + bus1=spatial.oil.nodes, + bus2=spatial.h2.nodes, + bus3="co2 atmosphere", + carrier="electrobiofuels", + lifetime=costs.at["electrobiofuels", "lifetime"], + efficiency=costs.at["electrobiofuels", "efficiency-biomass"], + efficiency2=-costs.at["electrobiofuels", "efficiency-hydrogen"], + efficiency3=-costs.at["solid biomass", "CO2 intensity"] + + costs.at["BtL", "CO2 stored"] + * (1 - costs.at["Fischer-Tropsch", "capture rate"]), + p_nom_extendable=True, + capital_cost=costs.at["BtL", "fixed"] * costs.at["BtL", "efficiency"] + + efuel_scale_factor + * costs.at["Fischer-Tropsch", "fixed"] + * costs.at["Fischer-Tropsch", "efficiency"], + marginal_cost=costs.at["BtL", "VOM"] * costs.at["BtL", "efficiency"] + + efuel_scale_factor + * costs.at["Fischer-Tropsch", "VOM"] + * costs.at["Fischer-Tropsch", "efficiency"], ) # BioSNG from solid biomass @@ -2912,11 +2996,12 @@ def add_biomass(n, costs): efficiency3=-costs.at["solid biomass", "CO2 intensity"] + costs.at["BioSNG", "CO2 stored"], p_nom_extendable=True, - capital_cost=costs.at["BioSNG", "fixed"], - marginal_cost=costs.at["BioSNG", "efficiency"] * costs.at["BioSNG", "VOM"], + capital_cost=costs.at["BioSNG", "fixed"] * costs.at["BioSNG", "efficiency"], + marginal_cost=costs.at["BioSNG", "VOM"] * costs.at["BioSNG", "efficiency"], ) - # TODO: Update with energy penalty for CC + # Assuming that acid gas removal (incl. CO2) from syngas i performed with Rectisol + # process (Methanol) and that electricity demand for this is included in the base process n.madd( "Link", spatial.biomass.nodes, @@ -2934,10 +3019,10 @@ def add_biomass(n, costs): + costs.at["BioSNG", "CO2 stored"] * (1 - costs.at["BioSNG", "capture rate"]), p_nom_extendable=True, - capital_cost=costs.at["BioSNG", "fixed"] + capital_cost=costs.at["BioSNG", "fixed"] * costs.at["BioSNG", "efficiency"] + costs.at["biomass CHP capture", "fixed"] * costs.at["BioSNG", "CO2 stored"], - marginal_cost=costs.at["BioSNG", "efficiency"] * costs.at["BioSNG", "VOM"], + marginal_cost=costs.at["BioSNG", "VOM"] * costs.at["BioSNG", "efficiency"], ) @@ -3165,10 +3250,11 @@ def add_industry(n, costs): ) domestic_navigation = pop_weighted_energy_totals.loc[ - nodes, "total domestic navigation" + nodes, ["total domestic navigation"] ].squeeze() international_navigation = ( - pd.read_csv(snakemake.input.shipping_demand, index_col=0).squeeze() * nyears + pd.read_csv(snakemake.input.shipping_demand, index_col=0).squeeze(axis=1) + * nyears ) all_navigation = domestic_navigation + international_navigation p_set = all_navigation * 1e6 / nhours @@ -3287,7 +3373,7 @@ def add_industry(n, costs): carrier="oil", ) - if "oil" not in n.generators.carrier.unique(): + if options.get("fossil_fuels", True) and "oil" not in n.generators.carrier.unique(): n.madd( "Generator", spatial.oil.nodes, @@ -3497,7 +3583,9 @@ def add_industry(n, costs): carrier="waste CHP CC", p_nom_extendable=True, capital_cost=costs.at["waste CHP CC", "fixed"] - * costs.at["waste CHP CC", "efficiency"], + * costs.at["waste CHP CC", "efficiency"] + + costs.at["biomass CHP capture", "fixed"] + * costs.at["oil", "CO2 intensity"], marginal_cost=costs.at["waste CHP CC", "VOM"], efficiency=costs.at["waste CHP CC", "efficiency"], efficiency2=costs.at["waste CHP CC", "efficiency-heat"], @@ -4342,10 +4430,9 @@ if __name__ == "__main__": snakemake = mock_snakemake( "prepare_sector_network", - # configfiles="test/config.overnight.yaml", simpl="", opts="", - clusters="37", + clusters="1", ll="vopt", sector_opts="", planning_horizons="2050",