Skip to content

Commit 926239b

Browse files
Michapre-commit-ci[bot]
andauthored
Simplify scenarios (#84)
* start by making Mix the default scenario * make script more robust * - change syntax of national co2_budget - define a default national_co2_budget - allow empty scenario, which falls back to the defaults specified in pypsa.de.yaml * simplify scenario definitions, fallback to defaults more often * change prefix * ariadne_template is data not resources * fix rounding error * disable interactive mode in final plotting script * decouple ariadne DB pre-workflow from scenario management * fix key error * error if co2 budget for country other than DE specified * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * improve wording --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 765a126 commit 926239b

File tree

8 files changed

+129
-152
lines changed

8 files changed

+129
-152
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Changelog
2+
- Simplified scenarion definition and made `Mix` the default scenario
23
- 0.3: workflow is all public now, no longer requires credentials to internal data
34
- Allowing myopic optimization until 2050
45
- CHP plants located in onshore regions without district heating are represented as EOP plants

Snakefile

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -266,13 +266,13 @@ rule retrieve_egon_data:
266266

267267
rule retrieve_ariadne_database:
268268
params:
269-
db_name=config_provider("iiasa_database", "db_name"),
270-
leitmodelle=config_provider("iiasa_database", "leitmodelle"),
271-
scenarios=config_provider("iiasa_database", "scenarios"),
269+
db_name=config["iiasa_database"]["db_name"],
270+
leitmodelle=config["iiasa_database"]["leitmodelle"],
271+
scenarios=config["iiasa_database"]["scenarios"],
272272
output:
273-
data=resources("ariadne_database.csv"),
273+
data="resources/ariadne_database.csv",
274274
log:
275-
"logs/pypsa-de/retrieve_ariadne_database.log",
275+
"logs/retrieve_ariadne_database.log",
276276
resources:
277277
mem_mb=1000,
278278
script:
@@ -315,7 +315,7 @@ rule build_mobility_demand:
315315
planning_horizons=config_provider("scenario", "planning_horizons"),
316316
leitmodelle=config_provider("iiasa_database", "leitmodelle"),
317317
input:
318-
ariadne=resources("ariadne_database.csv"),
318+
ariadne="resources/ariadne_database.csv",
319319
clustered_pop_layout=resources("pop_layout_base_s_{clusters}.csv"),
320320
output:
321321
mobility_demand=resources(
@@ -453,7 +453,7 @@ rule modify_existing_heating:
453453
iiasa_reference_scenario=config_provider("iiasa_database", "reference_scenario"),
454454
leitmodelle=config_provider("iiasa_database", "leitmodelle"),
455455
input:
456-
ariadne=resources("ariadne_database.csv"),
456+
ariadne="resources/ariadne_database.csv",
457457
existing_heating="data/existing_infrastructure/existing_heating_raw.csv",
458458
output:
459459
existing_heating=resources("existing_heating.csv"),
@@ -501,7 +501,7 @@ rule modify_industry_demand:
501501
params:
502502
reference_scenario=config_provider("iiasa_database", "reference_scenario"),
503503
input:
504-
ariadne=resources("ariadne_database.csv"),
504+
ariadne="resources/ariadne_database.csv",
505505
industrial_production_per_country_tomorrow=resources(
506506
"industrial_production_per_country_tomorrow_{planning_horizons}.csv"
507507
),
@@ -570,7 +570,7 @@ rule download_ariadne_template:
570570
keep_local=True,
571571
),
572572
output:
573-
resources("template_ariadne_database.xlsx"),
573+
"data/template_ariadne_database.xlsx",
574574
run:
575575
move(input[0], output[0])
576576

@@ -589,7 +589,7 @@ rule export_ariadne_variables:
589589
NEP_year=config_provider("costs", "NEP"),
590590
NEP_transmission=config_provider("costs", "transmission"),
591591
input:
592-
template=resources("template_ariadne_database.xlsx"),
592+
template="data/template_ariadne_database.xlsx",
593593
industry_demands=expand(
594594
resources(
595595
"industrial_energy_demand_base_s_{clusters}_{planning_horizons}.csv"
@@ -639,7 +639,7 @@ rule plot_ariadne_variables:
639639
reference_scenario=config_provider("iiasa_database", "reference_scenario"),
640640
input:
641641
exported_variables_full=RESULTS + "ariadne/exported_variables_full.xlsx",
642-
ariadne_database=resources("ariadne_database.csv"),
642+
ariadne_database="resources/ariadne_database.csv",
643643
output:
644644
primary_energy=RESULTS + "ariadne/primary_energy.png",
645645
primary_energy_detailed=RESULTS + "ariadne/primary_energy_detailed.png",
@@ -703,10 +703,10 @@ rule ariadne_all:
703703

704704
rule build_scenarios:
705705
params:
706-
scenarios=config_provider("run", "name"),
707-
leitmodelle=config_provider("iiasa_database", "leitmodelle"),
706+
scenarios=config["run"]["name"],
707+
leitmodelle=config["iiasa_database"]["leitmodelle"],
708708
input:
709-
ariadne_database=resources("ariadne_database.csv"),
709+
ariadne_database="resources/ariadne_database.csv",
710710
scenario_yaml=config["run"]["scenarios"]["manual_file"],
711711
output:
712712
scenario_yaml=config["run"]["scenarios"]["file"],

config/config.de.yaml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#run
66
run:
7-
prefix: 20250425_public_db
7+
prefix: 20250507_simple_scenarios
88
name:
99
# - ExPol
1010
- KN2045_Mix
@@ -269,6 +269,9 @@ first_technology_occurrence:
269269

270270
costs:
271271
horizon: "mean" # "optimist", "pessimist" or "mean"
272+
NEP: 2023
273+
transmission: "overhead" # either overhead line ("overhead") or underground cable ("underground")
274+
272275

273276
# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#sector
274277
sector:
@@ -342,6 +345,9 @@ sector:
342345
# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#industry
343346
industry:
344347
ammonia: false
348+
steam_biomass_fraction: 0.4
349+
steam_hydrogen_fraction: 0.3
350+
steam_electricity_fraction: 0.3
345351
St_primary_fraction:
346352
2020: 0.6
347353
2025: 0.55
@@ -428,6 +434,16 @@ solving:
428434
H2 pipeline retrofitted: 0.05
429435
fractional_last_unit_size: true
430436
constraints:
437+
# The default CO2 budget uses the KSG targets, and the non CO2 emissions from the REMIND model in the KN2045_Mix scenario
438+
co2_budget_national:
439+
DE:
440+
2020: 0.671
441+
2025: 0.523
442+
2030: 0.346
443+
2035: 0.216
444+
2040: 0.09
445+
2045: -0.05
446+
2050: -0.048
431447
efuel_export_ban: false
432448
limits_capacity_max:
433449
Generator:
@@ -511,6 +527,10 @@ solving:
511527
# EEG2023; Ziel for 2024: 88 GW and for 2026: 128 GW,
512528
# assuming at least 1/3 of difference reached in 2025
513529
2025: 101
530+
Link:
531+
H2 Electrolysis:
532+
DE:
533+
2030: 5
514534
# For reference, this are the values specified in the laws
515535
# limits_capacity_min:
516536
# Generator:

config/scenarios.manual.yaml

Lines changed: 3 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ ExPol:
2323
2050: 0.419
2424

2525
costs:
26-
horizon: "mean"
27-
NEP: 2023
2826
transmission: "underground" # either overhead line ("overhead") or underground cable ("underground")
2927
solving:
3028
constraints:
@@ -56,10 +54,6 @@ ExPol:
5654
DE:
5755
2030: 215 # uba Projektionsbericht
5856

59-
industry:
60-
steam_biomass_fraction: 0.4
61-
steam_hydrogen_fraction: 0.3
62-
steam_electricity_fraction: 0.3
6357

6458
sector:
6559
district_heating:
@@ -72,32 +66,13 @@ ExPol:
7266

7367

7468
KN2045_Mix:
69+
# Default scenario, defined in pypsa.de.yaml
7570
# Ausgewogener Mix an Technologien zur Dekarbonisierung der Sektoren
7671
# Breites Energieträgerportfolio in der Endenergie (Strom, Wasserstoff, synthetische Kraftstoffe)
7772
# Ausbau der erneuerbare Stromerzeugung erreicht politisch gesetzte Ziele
7873
# Importe erneuerbar erzeugter Energien auf mittlerem Niveau
7974
# dient als Referenzszenario in der Familie der Ariadne-Szenarien
8075

81-
iiasa_database:
82-
reference_scenario: KN2045_Mix
83-
co2_budget_DE_source: KSG
84-
85-
costs:
86-
horizon: "mean"
87-
NEP: 2023
88-
transmission: "overhead" # either overhead line ("overhead") or underground cable ("underground")
89-
solving:
90-
constraints:
91-
limits_capacity_min:
92-
Link:
93-
H2 Electrolysis:
94-
DE:
95-
2030: 5
96-
97-
industry:
98-
steam_biomass_fraction: 0.4
99-
steam_hydrogen_fraction: 0.3
100-
steam_electricity_fraction: 0.3
10176

10277
KN2045_Elek:
10378
# Fokus auf dem Hochlauf von Technologien zur direkten Elektrifizierung der Sektoren
@@ -107,12 +82,7 @@ KN2045_Elek:
10782

10883
iiasa_database:
10984
reference_scenario: KN2045_Elek
110-
co2_budget_DE_source: KSG
11185

112-
costs:
113-
horizon: "mean"
114-
NEP: 2023
115-
transmission: "overhead" # either overhead line ("overhead") or underground cable ("underground")
11686
solving:
11787
constraints:
11888
limits_volume_max:
@@ -153,11 +123,6 @@ KN2045_Elek:
153123
2040: 170
154124
2045: 250
155125
2050: 250
156-
limits_capacity_min:
157-
Link:
158-
H2 Electrolysis:
159-
DE:
160-
2030: 5
161126

162127
industry:
163128
steam_biomass_fraction: 0.4
@@ -172,12 +137,7 @@ KN2045_H2:
172137

173138
iiasa_database:
174139
reference_scenario: KN2045_H2
175-
co2_budget_DE_source: KSG
176140

177-
costs:
178-
horizon: "mean"
179-
NEP: 2023
180-
transmission: "overhead" # either overhead line ("overhead") or underground cable ("underground")
181141
solving:
182142
constraints:
183143
limits_volume_max:
@@ -231,11 +191,6 @@ KN2045_H2:
231191
2040: 0
232192
2045: 200
233193
2050: 200
234-
limits_capacity_min:
235-
Link:
236-
H2 Electrolysis:
237-
DE:
238-
2030: 5
239194

240195
industry:
241196
steam_biomass_fraction: 0.4
@@ -250,35 +205,7 @@ KN2045_NFniedrig:
250205
# dient als Referenzszenario in der Familie der Ariadne-Szenarien
251206

252207
iiasa_database:
253-
reference_scenario: KN2045plus_LowDemand
254-
co2_budget_DE_source: KSG
255-
256-
costs:
257-
horizon: "mean"
258-
NEP: 2023
259-
transmission: "overhead" # either overhead line ("overhead") or underground cable ("underground")
260-
solving:
261-
constraints:
262-
# boundary condition of maximum volumes
263-
limits_volume_max:
264-
h2_import:
265-
DE:
266-
2020: 0
267-
2025: 5
268-
2030: 15
269-
2035: 115
270-
2040: 220
271-
2045: 325
272-
2050: 325
273-
limits_capacity_min:
274-
Link:
275-
H2 Electrolysis:
276-
DE:
277-
2030: 5
278-
industry:
279-
steam_biomass_fraction: 0.4
280-
steam_hydrogen_fraction: 0.3
281-
steam_electricity_fraction: 0.3
208+
reference_scenario: KN2045_NFniedrig
282209

283210
sector:
284211
reduce_space_heat_exogenously_factor:
@@ -298,35 +225,7 @@ KN2045_NFhoch:
298225
# dient als Referenzszenario in der Familie der Ariadne-Szenarien
299226

300227
iiasa_database:
301-
reference_scenario: KN2045minus_SupplyFocus
302-
co2_budget_DE_source: KSG
303-
304-
costs:
305-
horizon: "mean"
306-
NEP: 2023
307-
transmission: "overhead" # either overhead line ("overhead") or underground cable ("underground")
308-
solving:
309-
constraints:
310-
# boundary condition of maximum volumes
311-
limits_volume_max:
312-
h2_import:
313-
DE:
314-
2020: 0
315-
2025: 5
316-
2030: 15
317-
2035: 115
318-
2040: 220
319-
2045: 325
320-
2050: 325
321-
limits_capacity_min:
322-
Link:
323-
H2 Electrolysis:
324-
DE:
325-
2030: 5
326-
industry:
327-
steam_biomass_fraction: 0.4
328-
steam_hydrogen_fraction: 0.3
329-
steam_electricity_fraction: 0.3
228+
reference_scenario: KN2045_NFhoch
330229

331230
sector:
332231
reduce_space_heat_exogenously_factor:

0 commit comments

Comments
 (0)