Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow absence of offshore wind from sector-coupled networks #944

Merged
merged 5 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ Upcoming Release
* The outputs of the rule ``retrieve_gas_infrastructure_data`` no longer
marked as ``protected()`` as the download size is small.

* Bugfix: allow modelling sector-coupled landlocked regions. (Fixed handling of offshore wind.)

PyPSA-Eur 0.10.0 (19th February 2024)
=====================================

Expand Down
11 changes: 9 additions & 2 deletions rules/build_sector.smk
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,14 @@ rule build_existing_heating_distribution:
"../scripts/build_existing_heating_distribution.py"


def input_profile_offwind(w):
return {
f"profile_{tech}": resources(f"profile_{tech}.nc")
for tech in ["offwind-ac", "offwind-dc"]
if (tech in config_provider("electricity", "renewable_carriers")(w))
}


rule prepare_sector_network:
params:
time_resolution=config_provider("clustering", "temporal", "resolution_sector"),
Expand All @@ -829,6 +837,7 @@ rule prepare_sector_network:
eurostat_report_year=config_provider("energy", "eurostat_report_year"),
RDIR=RDIR,
input:
unpack(input_profile_offwind),
**rules.cluster_gas_network.output,
**rules.build_gas_input_locations.output,
retro_cost=lambda w: (
Expand Down Expand Up @@ -882,8 +891,6 @@ rule prepare_sector_network:
if config_provider("foresight")(w) == "overnight"
else resources("costs_{planning_horizons}.csv")
),
profile_offwind_ac=resources("profile_offwind-ac.nc"),
profile_offwind_dc=resources("profile_offwind-dc.nc"),
h2_cavern=resources("salt_cavern_potentials_s{simpl}_{clusters}.csv"),
busmap_s=resources("busmap_elec_s{simpl}.csv"),
busmap=resources("busmap_elec_s{simpl}_{clusters}.csv"),
Expand Down
4 changes: 3 additions & 1 deletion scripts/prepare_sector_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,9 @@ def update_wind_solar_costs(n, costs):
# code adapted from pypsa-eur/scripts/add_electricity.py
for connection in ["dc", "ac"]:
tech = "offwind-" + connection
profile = snakemake.input["profile_offwind_" + connection]
if tech not in n.generators.carrier.values:
continue
profile = snakemake.input["profile_offwind-" + connection]
with xr.open_dataset(profile) as ds:

# if-statement for compatibility with old profiles
Expand Down
Loading