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

Merge recent ariadne advancements #884

Merged
merged 17 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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
1 change: 1 addition & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
5d1ef8a64055a039aa4a0834d2d26fe7752fe9a0
92080b1cd2ca5f123158571481722767b99c2b27
13769f90af4500948b0376d57df4cceaa13e78b5
9865a970893d9e515786f33c629b14f71645bf1e
20 changes: 20 additions & 0 deletions doc/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,26 @@ Upcoming Release

* Cluster residential and services heat buses by default. Can be disabled with ``cluster_heat_buses: false``.

* Bugfix: Do not reduce district heat share when building population-weighted
energy statistics. Previously the district heating share was being multiplied
by the population weighting, reducing the DH share with multiple nodes.

* Move building of daily heat profile to its own rule
:mod:`build_hourly_heat_demand` from :mod:`prepare_sector_network`.

* In :mod:`build_energy_totals`, district heating shares are now reported in a
separate file.

* Move calculation of district heating share to its own rule
:mod:`build_district_heat_share`.

* Move building of distribution of existing heating to own rule
:mod:`build_existing_heating_distribution`. This makes the distribution of
existing heating to urban/rural, residential/services and spatially more
transparent.

* Bugfix: Correctly read out number of solver threads from configuration file.

* Air-sourced heat pumps can now also be built in rural areas. Previously, only
ground-sourced heat pumps were considered for this category.

Expand Down
20 changes: 18 additions & 2 deletions doc/sector.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ Rule ``add_existing_baseyear``

.. automodule:: add_existing_baseyear

Rule ``build_existing_heating_distribution``
==============================================================================

.. automodule:: build_existing_heating_distribution


Rule ``build_ammonia_production``
==============================================================================

Expand Down Expand Up @@ -60,10 +66,20 @@ Rule ``build_gas_network``

.. automodule:: build_gas_network

Rule ``build_heat_demand``
Rule ``build_daily_heat_demand``
==============================================================================

.. automodule:: build_daily_heat_demand

Rule ``build_hourly_heat_demand``
==============================================================================

.. automodule:: build_hourly_heat_demand

Rule ``build_district_heat_share``
==============================================================================

.. automodule:: build_heat_demand
.. automodule:: build_district_heat_share

Rule ``build_industrial_distribution_key``
==============================================================================
Expand Down
60 changes: 51 additions & 9 deletions rules/build_sector.smk
Original file line number Diff line number Diff line change
Expand Up @@ -123,26 +123,47 @@ rule cluster_gas_network:
"../scripts/cluster_gas_network.py"


rule build_heat_demands:
rule build_daily_heat_demand:
params:
snapshots={k: config["snapshots"][k] for k in ["start", "end", "inclusive"]},
input:
pop_layout=RESOURCES + "pop_layout_{scope}.nc",
regions_onshore=RESOURCES + "regions_onshore_elec_s{simpl}_{clusters}.geojson",
cutout="cutouts/" + CDIR + config["atlite"]["default_cutout"] + ".nc",
output:
heat_demand=RESOURCES + "heat_demand_{scope}_elec_s{simpl}_{clusters}.nc",
heat_demand=RESOURCES + "daily_heat_demand_{scope}_elec_s{simpl}_{clusters}.nc",
resources:
mem_mb=20000,
threads: 8
log:
LOGS + "build_heat_demands_{scope}_{simpl}_{clusters}.loc",
LOGS + "build_daily_heat_demand_{scope}_{simpl}_{clusters}.loc",
benchmark:
BENCHMARKS + "build_heat_demands/{scope}_s{simpl}_{clusters}"
BENCHMARKS + "build_daily_heat_demand/{scope}_s{simpl}_{clusters}"
conda:
"../envs/environment.yaml"
script:
"../scripts/build_heat_demand.py"
"../scripts/build_daily_heat_demand.py"


rule build_hourly_heat_demand:
params:
snapshots={k: config["snapshots"][k] for k in ["start", "end", "inclusive"]},
input:
heat_profile="data/heat_load_profile_BDEW.csv",
heat_demand=RESOURCES + "daily_heat_demand_{scope}_elec_s{simpl}_{clusters}.nc",
output:
heat_demand=RESOURCES + "hourly_heat_demand_{scope}_elec_s{simpl}_{clusters}.nc",
resources:
mem_mb=2000,
threads: 8
log:
LOGS + "build_hourly_heat_demand_{scope}_{simpl}_{clusters}.loc",
benchmark:
BENCHMARKS + "build_hourly_heat_demand/{scope}_s{simpl}_{clusters}"
conda:
"../envs/environment.yaml"
script:
"../scripts/build_hourly_heat_demand.py"


rule build_temperature_profiles:
Expand Down Expand Up @@ -235,6 +256,7 @@ rule build_energy_totals:
energy_name=RESOURCES + "energy_totals.csv",
co2_name=RESOURCES + "co2_totals.csv",
transport_name=RESOURCES + "transport_data.csv",
district_heat_share=RESOURCES + "district_heat_share.csv",
threads: 16
resources:
mem_mb=10000,
Expand Down Expand Up @@ -688,6 +710,26 @@ rule build_transport_demand:
"../scripts/build_transport_demand.py"


rule build_district_heat_share:
params:
sector=config["sector"],
input:
district_heat_share=RESOURCES + "district_heat_share.csv",
clustered_pop_layout=RESOURCES + "pop_layout_elec_s{simpl}_{clusters}.csv",
output:
district_heat_share=RESOURCES
+ "district_heat_share_elec_s{simpl}_{clusters}_{planning_horizons}.csv",
threads: 1
resources:
mem_mb=1000,
log:
LOGS + "build_district_heat_share_s{simpl}_{clusters}_{planning_horizons}.log",
conda:
"../envs/environment.yaml"
script:
"../scripts/build_district_heat_share.py"


rule prepare_sector_network:
params:
co2_budget=config["co2_budget"],
Expand Down Expand Up @@ -727,7 +769,6 @@ rule prepare_sector_network:
if config["foresight"] == "overnight"
else RESOURCES
+ "biomass_potentials_s{simpl}_{clusters}_{planning_horizons}.csv",
heat_profile="data/heat_load_profile_BDEW.csv",
costs="data/costs_{}.csv".format(config["costs"]["year"])
if config["foresight"] == "overnight"
else "data/costs_{planning_horizons}.csv",
Expand All @@ -740,9 +781,10 @@ rule prepare_sector_network:
simplified_pop_layout=RESOURCES + "pop_layout_elec_s{simpl}.csv",
industrial_demand=RESOURCES
+ "industrial_energy_demand_elec_s{simpl}_{clusters}_{planning_horizons}.csv",
heat_demand_urban=RESOURCES + "heat_demand_urban_elec_s{simpl}_{clusters}.nc",
heat_demand_rural=RESOURCES + "heat_demand_rural_elec_s{simpl}_{clusters}.nc",
heat_demand_total=RESOURCES + "heat_demand_total_elec_s{simpl}_{clusters}.nc",
hourly_heat_demand_total=RESOURCES
+ "hourly_heat_demand_total_elec_s{simpl}_{clusters}.nc",
district_heat_share=RESOURCES
+ "district_heat_share_elec_s{simpl}_{clusters}_{planning_horizons}.csv",
temp_soil_total=RESOURCES + "temp_soil_total_elec_s{simpl}_{clusters}.nc",
temp_soil_rural=RESOURCES + "temp_soil_rural_elec_s{simpl}_{clusters}.nc",
temp_soil_urban=RESOURCES + "temp_soil_urban_elec_s{simpl}_{clusters}.nc",
Expand Down
39 changes: 37 additions & 2 deletions rules/solve_myopic.smk
Original file line number Diff line number Diff line change
@@ -1,8 +1,42 @@
# SPDX-FileCopyrightText: : 2023 The PyPSA-Eur Authors
# SPDX-FileCopyrightText: : 2023-4 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT


rule build_existing_heating_distribution:
params:
baseyear=config["scenario"]["planning_horizons"][0],
sector=config["sector"],
existing_capacities=config["existing_capacities"],
input:
existing_heating="data/existing_infrastructure/existing_heating_raw.csv",
clustered_pop_layout=RESOURCES + "pop_layout_elec_s{simpl}_{clusters}.csv",
clustered_pop_energy_layout=RESOURCES
+ "pop_weighted_energy_totals_s{simpl}_{clusters}.csv",
district_heat_share=RESOURCES
+ "district_heat_share_elec_s{simpl}_{clusters}_{planning_horizons}.csv",
output:
existing_heating_distribution=RESOURCES
+ "existing_heating_distribution_elec_s{simpl}_{clusters}_{planning_horizons}.csv",
wildcard_constraints:
planning_horizons=config["scenario"]["planning_horizons"][0], #only applies to baseyear
threads: 1
resources:
mem_mb=2000,
log:
LOGS
+ "build_existing_heating_distribution_elec_s{simpl}_{clusters}_{planning_horizons}.log",
benchmark:
(
BENCHMARKS
+ "build_existing_heating_distribution/elec_s{simpl}_{clusters}_{planning_horizons}"
)
conda:
"../envs/environment.yaml"
script:
"../scripts/build_existing_heating_distribution.py"


rule add_existing_baseyear:
params:
baseyear=config["scenario"]["planning_horizons"][0],
Expand All @@ -19,7 +53,8 @@ rule add_existing_baseyear:
costs="data/costs_{}.csv".format(config["scenario"]["planning_horizons"][0]),
cop_soil_total=RESOURCES + "cop_soil_total_elec_s{simpl}_{clusters}.nc",
cop_air_total=RESOURCES + "cop_air_total_elec_s{simpl}_{clusters}.nc",
existing_heating="data/existing_infrastructure/existing_heating_raw.csv",
existing_heating_distribution=RESOURCES
+ "existing_heating_distribution_elec_s{simpl}_{clusters}_{planning_horizons}.csv",
existing_solar="data/existing_infrastructure/solar_capacity_IRENA.csv",
existing_onwind="data/existing_infrastructure/onwind_capacity_IRENA.csv",
existing_offwind="data/existing_infrastructure/offwind_capacity_IRENA.csv",
Expand Down
2 changes: 2 additions & 0 deletions rules/solve_perfect.smk
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ rule add_existing_baseyear:
costs="data/costs_{}.csv".format(config["scenario"]["planning_horizons"][0]),
cop_soil_total=RESOURCES + "cop_soil_total_elec_s{simpl}_{clusters}.nc",
cop_air_total=RESOURCES + "cop_air_total_elec_s{simpl}_{clusters}.nc",
existing_heating_distribution=RESOURCES
+ "existing_heating_distribution_elec_s{simpl}_{clusters}_{planning_horizons}.csv",
existing_heating="data/existing_infrastructure/existing_heating_raw.csv",
existing_solar="data/existing_infrastructure/solar_capacity_IRENA.csv",
existing_onwind="data/existing_infrastructure/onwind_capacity_IRENA.csv",
Expand Down
Loading
Loading