Skip to content

Commit cea7401

Browse files
authored
Merge pull request pik-piam#65 from irr-github/operational_reserves
Add Operational_reserves for sector coupled mode
2 parents 58a9d23 + 3fcc99d commit cea7401

17 files changed

+869
-19881
lines changed

config/default_config.yaml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,9 @@ Techs:
176176
non_dispatchable: ['Offshore Wind', 'Onshore Wind', 'Solar', 'Solar Residential', "Solar Thermal"]
177177
conv_techs: ["OCGT", "CCGT", "CHP gas", "gas boiler","coal boiler","coal power plant","CHP coal"]
178178
store_techs: ["H2","battery","water tanks","PHS"]
179-
coal_cc: true # currently myopic pathway only. CC = co2 cap
180-
hydrogen_lines: true # currently myopic pathway only
179+
non_dispatchable: ["onwind", "offwind", "solar", "solar thermal"]
180+
hydrogen_lines: true
181+
coal_ccs_retrofit: true # currently myopic pathway only. CC = co2 cap
181182

182183
## add components (overwrites vre tech choice)
183184
heat_coupling: false
@@ -303,10 +304,17 @@ security:
303304
line_margin: 70 # max percent of line capacity
304305

305306
existing_capacities:
306-
add: True
307-
grouping_years: [1980,1985, 1990, 1995, 2000, 2005, 2010, 2015, 2019, 2020, 2025, 2030, 2035, 2040, 2045, 2050, 2055, 2060]
307+
add: True # whether to add brownfield capacities
308+
grouping_years: [1980, 1985, 1990, 1995, 2000, 2005, 2010, 2015, 2019, 2020, 2025, 2030, 2035, 2040, 2045, 2050, 2055, 2060]
309+
collapse_years: False # Treat as a single unit when preparing & solving network
308310
threshold_capacity: 1 # TODO UNIT
309-
techs: ['coal','CHP coal', 'CHP gas', 'OCGT', 'CCGT', 'solar', 'solar thermal', 'onwind', 'offwind','coal boiler','ground heat pump','nuclear']
311+
techs: ['coal','CHP coal', 'CHP gas', 'OCGT', 'CCGT', 'solar', 'onwind', 'offwind', 'nuclear']
312+
313+
operational_reserve:
314+
activate: false
315+
epsilon_load: 0.02
316+
epsilon_vres: 0.02
317+
contingency: 300000 # MW
310318

311319
fetch_regions:
312320
simplify_tol: 0.5

config/pik_hpc_profile/config.yaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ set-resources:
5757
mem_mb: 80000
5858
time: 80
5959
solve_networks:
60-
mem_mb: 60000
60+
mem_mb: 90000
6161
time : 80
6262
threads: 6
6363
build_cutout:
@@ -115,9 +115,10 @@ set-resources:
115115
# GROUPS
116116

117117
groups:
118-
plot_network: plot
119-
plot_statistics: plot
120-
plot_snapshots: plot
118+
# plot_network: plot
119+
# plot_statistics: plot
120+
# plot_snapshots: plot
121+
prep_capacities: prepare_baseyear_capacities
121122
build_load_profiles: build_load
122123
prepare_networks: prep_network
123124
add_existing_baseyear: prep_network2
@@ -127,4 +128,5 @@ group-components:
127128
build_load: 3
128129
prep_network: 3
129130
prep_network2: 3
130-
summary: 3
131+
summary: 3
132+
prep_capacities: 3

config/plot_config.yaml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,9 @@ plotting:
146146
OCGT marginal: '#e0986c'
147147
OCGT-heat: '#e0986c'
148148
CCGT: '#a85522'
149-
CCGT gas: '#a85522'
149+
CCGT marginal: '#a85522'
150150
gas CCGT: '#a85522'
151+
CCGT gas: '#a85522'
151152
gas ccs: '#a85522'
152153
CCGT-CCS: '#76855B'
153154
gas CCGT-CCS: '#76855B'
@@ -164,9 +165,6 @@ plotting:
164165
fossil gas: '#e05b09'
165166
natural gas: '#e05b09'
166167
biogas to gas: '#e36311'
167-
CCGT: '#a85522'
168-
CCGT marginal: '#a85522'
169-
gas CCGT: '#a85522'
170168
allam: '#B98F76'
171169
gas for industry co2 to atmosphere: '#692e0a'
172170
gas for industry co2 to stored: '#8a3400'
@@ -175,8 +173,6 @@ plotting:
175173
gas pipeline: '#ebbca0'
176174
gas pipeline new: '#a87c62'
177175
gas-AC: "grey"
178-
179-
180176
# hot water storage
181177
water tanks: '#e69487'
182178
residential rural water tanks: '#f7b7a3'
@@ -416,6 +412,7 @@ plotting:
416412
# generatord
417413
battery: "Battery Storage"
418414
battery discharger: "Battery Discharger"
415+
# coal: "Coal"
419416
coal: "Coal Power Plant"
420417
coal cc: "Coal with carbon capture"
421418
coal ccs: "Coal with carbon capture"
@@ -424,15 +421,10 @@ plotting:
424421
hydro: "Reservoir & Dam"
425422
H2 fuel cell: "H2 Fuel Cell"
426423
PHS: "Pumped Hydro Storage"
427-
offwind: "Offshore Wind"
428-
onwind: "Onshore Wind"
429-
solar: "Solar"
430424
# H2: "Hydrogen Power"
431425
ror: "Run of River"
432-
solar thermal: "Solar Thermal"
433426
uranium: "Nuclear"
434427
hydroelectricity: "Hydroelectricity"
435-
coal: "Coal"
436428
offwind: "Offshore Wind"
437429
onwind: "Onshore Wind"
438430
solar: "Solar"

workflow/Snakefile

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -436,33 +436,20 @@ rule dag:
436436
"""
437437

438438
onerror:
439-
log_out = expand(LOG_DIR + "/_latest_snakemake.log", **config["scenario"])[0]
440439
res_dir = expand(RESULTS_DIR, **config["scenario"])[0]
441440
if not os.path.exists(res_dir):
442441
os.makedirs(res_dir)
443-
if not os.path.exists(LOG_DIR):
444-
os.makedirs(LOG_DIR)
445-
# log path is available from snakemake as "log"
446442
try:
447-
shutil.copy(log, os.path.dirname(log_out))
448443
yaml.dump(config, open(res_dir + "/run_config.yaml", "w"))
449444
except FileNotFoundError as e:
450445
logging.warning(f"Could not copy log file: {e}")
451446
except TypeError as e:
452447
logging.warning(f"Could not copy config file: {e}")
453-
logging.warning(f"Copying log file to {str(log_out)} failed?")
454-
logging.warning(f"saving config file to {str(res_dir)}/run_config.yaml failed?")
455448

456449
onsuccess:
457-
log_out = expand(LOG_DIR + "/_latest_snakemake.log", **config["scenario"])[0]
458450
res_dir = expand(RESULTS_DIR, **config["scenario"])[0]
459451
try:
460-
shutil.copy(log, log_out)
461-
yaml.dump(config, open(res_dir + "/run_config.yaml", "w"))
462-
except FileNotFoundError as e:
463-
logging.warning(f"Could not copy log file: {e}")
452+
with open(res_dir + "/run_config.yaml", "w") as f:
453+
yaml.dump(config, f )
464454
except TypeError as e:
465455
logging.warning(f"Could not copy config file: {e}")
466-
logging.warning(f"Copying log file to {str(log_out)} (type {type(log_out)}) failed?")
467-
logging.info(f"source was {str(log)}")
468-
logging.warning(f"sav config file to {str(res_dir)}/run_config.yaml failed?")

0 commit comments

Comments
 (0)