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

Calibration run 2023/2024 #45

Open
wants to merge 12 commits into
base: form_energy_storage_dev
Choose a base branch
from
Open
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: 1 addition & 1 deletion .sync-send
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ scripts
config
config/test
data
resources/initial_main_scenarios
resources/validation_runs
envs
matplotlibrc
Snakefile
14 changes: 7 additions & 7 deletions config/config.form.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ logging:

# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#run
run:
prefix: "updated_initial_main_scenarios"
name: "main-mds-vanilla-dac-limit-ev40"
prefix: "validation_runs"
name: "2023-validation-run-1H"
scenarios:
enable: true
file: config/scenarios.form.yaml
Expand All @@ -34,15 +34,15 @@ scenario:
clusters:
- 52
planning_horizons:
- 2035
- 2023

# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#countries
countries: ['AT', 'BE', 'CH', 'CZ', 'DE', 'DK', 'FR', 'IT', 'LU', 'NL', 'PL', 'SE']

# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#snapshots
snapshots:
start: "2013-01-01"
end: "2014-01-01"
start: "2023-01-01"
end: "2024-01-01"
inclusive: 'left'

# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#enable
Expand Down Expand Up @@ -178,7 +178,7 @@ sector:
2035: 0.30 # FE input
land_transport_ice_share:
2035: 0.70
include_transport_emissions: false
include_transport_emissions: true
reduce_space_heat_exogenously: true
reduce_space_heat_exogenously_factor:
2035: 0.21
Expand All @@ -203,7 +203,7 @@ sector:

# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#costs
costs:
year: 2035
year: 2020
version: 67a5830
social_discountrate: 0.02
fill_values:
Expand Down
168 changes: 167 additions & 1 deletion config/scenarios.form.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -205,4 +205,170 @@ main-mds-vanilla-with-grids:
storage_units: ["li-ion battery", "iron-air battery"]
H2_network: true
gas_network: true
H2_retrofit: true
H2_retrofit: true

2023-validation-run-2920SEG:
#foresight: overnight # Needs to be myopic to include existing power plants
scenario:
ll:
- v1.0
planning_horizons:
- 2023
enable:
retrieve_cutout: false
final_adjustment: true
snapshots:
start: "2023-01-01"
end: "2024-01-01"
co2_budget:
2023: 1 #0.378
# 63% from https://commission.europa.eu/news/climate-report-shows-largest-annual-drop-eu-greenhouse-gas-emissions-decades-2024-11-05_en
# 60% factored in emission included sector from co2_totals_sector.csv (interpolation between 2015, 2030)
# 0.63 * 0.6 = 0.378
electricity:
max_hours:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it makes sense to include this in the scenario

li-ion battery: [1, 2, 4, 8]
extendable_carriers:
Generator: [] # remove extendability for all carrier except gas
powerplants_filter: DateOut >= 2023 and not Fueltype.isin(['Nuclear', 'Hard Coal', 'Lignite'])
custom_powerplants: DateIn <= 2023 and DateOut >= 2023
transmission_projects:
enable: false
include:
nep: false
ntc_year: 2025
atlite:
default_cutout: europe-2023-sarah3-era5
renewable:
onwind:
cutout: europe-2023-sarah3-era5
correction_factor: 0.93
offwind-ac:
cutout: europe-2023-sarah3-era5
offwind-dc:
cutout: europe-2023-sarah3-era5
offwind-float:
cutout: europe-2023-sarah3-era5
solar:
cutout: europe-2023-sarah3-era5
correction_factor: 0.854337 #Using ERA5 data requires correction factor for solar.
solar-hsat:
cutout: europe-2023-sarah3-era5
hydro:
cutout: europe-2023-sarah3-era5
#eia_norm_year: 2021 #The last year available from EIA for hydro is 2021. If not activated, the median value is chosen
load:
supplement_entsoe: true
biomass:
year: 2020
share_unsustainable_use_retained:
2023: 0.8
share_sustainable_potential_available:
2023: 0.2
sector:
district_heating:
progress:
2023: 0.15 #Rough estimate. 70M/448M population uses district heating https://iifiir.org/en/news/state-of-play-of-district-heating-and-cooling-in-europe
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may be reduced a bit, using PyPSA-ariadne

land_transport_fuel_cell_share:
2023: 0
land_transport_electric_share:
2023: 0.02 #https://ec.europa.eu/eurostat/web/products-eurostat-news/w/ddn-20240802-1
land_transport_ice_share:
2023: 0.98 # 1.00 - 0.02
co2_sequestration_potential:
2023: 0
stores: []
storage_units: []
methanation: false
bev_dsm: false
tes: false
v2g: false
SMR_cc: false
costs:
year: 2020
clustering:
temporal:
resolution_sector: 2920SEG

2023-validation-run-1H:
#foresight: overnight # Needs to be myopic to include existing power plants
scenario:
ll:
- v1.0
planning_horizons:
- 2023
enable:
retrieve_cutout: false
final_adjustment: true
snapshots:
start: "2023-01-01"
end: "2024-01-01"
co2_budget:
2023: 1 #0.378
# 63% from https://commission.europa.eu/news/climate-report-shows-largest-annual-drop-eu-greenhouse-gas-emissions-decades-2024-11-05_en
# 60% factored in emission included sector from co2_totals_sector.csv (interpolation between 2015, 2030)
# 0.63 * 0.6 = 0.378
electricity:
max_hours:
li-ion battery: [1, 2, 4, 8]
extendable_carriers:
Generator: [] # remove extendability for all carrier except gas
powerplants_filter: DateOut >= 2023 and not Fueltype.isin(['Nuclear', 'Hard Coal', 'Lignite'])
custom_powerplants: DateIn <= 2023 and DateOut >= 2023
transmission_projects:
enable: false
include:
nep: false
ntc_year: 2025
atlite:
default_cutout: europe-2023-sarah3-era5
renewable:
onwind:
cutout: europe-2023-sarah3-era5
correction_factor: 0.93
offwind-ac:
cutout: europe-2023-sarah3-era5
offwind-dc:
cutout: europe-2023-sarah3-era5
offwind-float:
cutout: europe-2023-sarah3-era5
solar:
cutout: europe-2023-sarah3-era5
correction_factor: 0.854337 #Using ERA5 data requires correction factor for solar.
solar-hsat:
cutout: europe-2023-sarah3-era5
hydro:
cutout: europe-2023-sarah3-era5
#eia_norm_year: 2021 #The last year available from EIA for hydro is 2021. If not activated, the median value is chosen
load:
supplement_entsoe: true
biomass:
year: 2020
share_unsustainable_use_retained:
2023: 0.8
share_sustainable_potential_available:
2023: 0.2
sector:
district_heating:
progress:
2023: 0.15 #Rough estimate. 70M/448M population uses district heating https://iifiir.org/en/news/state-of-play-of-district-heating-and-cooling-in-europe
land_transport_fuel_cell_share:
2023: 0
land_transport_electric_share:
2023: 0.02 #https://ec.europa.eu/eurostat/web/products-eurostat-news/w/ddn-20240802-1
land_transport_ice_share:
2023: 0.98 # 1.00 - 0.02
co2_sequestration_potential:
2023: 0
stores: []
storage_units: []
methanation: false
bev_dsm: false
tes: false
v2g: false
SMR_cc: false
costs:
year: 2020
clustering:
temporal:
resolution_sector: 1H
50 changes: 25 additions & 25 deletions data/TYNDP_NTC.csv
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
country1,country2,2030,2040,2035
AT,CH,1400,2400,1900
AT,CZ,1900,1900,1900
AT,DE,8500,8500,8500
AT,IT,1300,1800,1550
BE,FR,5300,6300,5800
BE,LU,1180,1180,1180
BE,NL,4400,4400,4400
BE,DE,1000,1000,1000
CH,DE,5400,5400,5400
CH,FR,6200,7200,6700
CH,IT,3950,5950,4950
CZ,DE,2600,2600,2600
CZ,PL,1800,2300,2050
DE,DK,4100,4100,4100
DE,FR,4800,4800,4800
DE,LU,2700,2700,2700
DE,NL,5000,6000,5500
DE,PL,3000,3000,3000
DE,SE,2015,3515,2765
DK,SE,4150,5115,4632.5
DK,NL,700,700,700
FR,IT,4100,5100,4600
FR,LU,380,380,380
PL,SE,1100,1600,1350
country1,country2,2025,2030,2035,2040
AT,CH,1200,1400,1900,2400
AT,CZ,900,1900,1900,1900
AT,DE,5400,8500,8500,8500
AT,IT,800,1300,1550,1800
BE,FR,4300,5300,5800,6300
BE,LU,680,1180,1180,1180
BE,NL,3400,4400,4400,4400
BE,DE,1000,1000,1000,1000
CH,DE,4200,5400,5400,5400
CH,FR,3300,6200,6700,7200
CH,IT,3750,3950,4950,5950
CZ,DE,2100,2600,2600,2600
CZ,PL,1400,1800,2050,2300
DE,DK,4700,4700,4700,4700
DE,FR,3300,4800,4800,4800
DE,LU,2300,2700,2700,2700
DE,NL,5000,5000,5500,6000
DE,PL,3000,3000,3000,3000
DE,SE,615,2015,2765,3515
DK,SE,2450,4150,4632.5,5115
DK,NL,700,700,700,700
FR,IT,4100,4100,4600,5100
FR,LU,380,380,380,380
PL,SE,600,1100,1350,1600
1 change: 1 addition & 0 deletions doc/configtables/load.csv
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ time_shift_for_large_gaps,string,string,"Periods which are used for copying time
manual_adjustments,bool,"{true, false}","Whether to adjust the load data manually according to the function in :func:`manual_adjustment`."
scaling_factor,--,float,"Global correction factor for the load time series."
fixed_year,--,Year or False,"To specify a fixed year for the load time series that deviates from the snapshots' year"
supplement_entsoe,bool,"{true, false}","Whether to supplement missing data for selected time period should be supplemented by ENTSO-E load data. Requires `ENTSO-E API key <https://transparency.entsoe.eu/content/static_content/Static%20content/web%20api/Guide.html>`_ to run."
supplement_synthetic,bool,"{true, false}","Whether to supplement missing data for selected time period should be supplemented by synthetic data from https://zenodo.org/records/10820928."
distribution_key,--,--,"Distribution key for spatially disaggregating the per-country electricity demand data."
-- gdp,float,"[0, 1]","Weighting factor for the GDP data in the distribution key."
Expand Down
5 changes: 5 additions & 0 deletions rules/build_electricity.smk
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ rule build_electricity_demand:
load=config_provider("load"),
input:
reported=ancient("data/electricity_demand_raw.csv"),
entsoe_load=lambda w: (
resources("historical_electricity_loads.csv")
if config_provider("load", "supplement_entsoe")(w)
else []
),
synthetic=lambda w: (
ancient("data/load_synthetic_raw.csv")
if config_provider("load", "supplement_synthetic")(w)
Expand Down
50 changes: 35 additions & 15 deletions rules/collect.smk
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,38 @@ rule solve_sector_networks_perfect:
run=config["run"]["name"],
),


rule validate_elec_networks:
input:
expand(
RESULTS + "figures/.statistics_plots_base_s_{clusters}_elec_l{ll}_{opts}",
**config["scenario"],
run=config["run"]["name"],
),
expand(
RESULTS
+ "figures/.validation_{kind}_plots_base_s_{clusters}_elec_l{ll}_{opts}",
**config["scenario"],
run=config["run"]["name"],
kind=["production", "prices", "cross_border"],
),
if config["foresight"] in ["myopic","overnight"]:
rule validate_elec_networks:
input:
expand(
RESULTS
+ "figures/.validation_{kind}_plots_base_s_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}",
**config["scenario"],
run=config["run"]["name"],
kind=["production","cross_border"],
),
elif config["foresight"] == "perfect":
rule validate_elec_networks:
input:
expand(
RESULTS
+ "figures/.validation_{kind}_plots_base_s_{clusters}_l{ll}_{opts}_{sector_opts}_brownfield_all_years",
**config["scenario"],
run=config["run"]["name"],
kind=["production", "prices", "cross_border"],
),
else:
rule validate_elec_networks:
input:
expand(
RESULTS + "figures/.statistics_plots_base_s_{clusters}_elec_l{ll}_{opts}",
**config["scenario"],
run=config["run"]["name"],
),
expand(
RESULTS
+ "figures/.validation_{kind}_plots_base_s_{clusters}_elec_l{ll}_{opts}",
**config["scenario"],
run=config["run"]["name"],
kind=["production", "prices", "cross_border"],
),
17 changes: 17 additions & 0 deletions rules/retrieve.smk
Original file line number Diff line number Diff line change
Expand Up @@ -630,3 +630,20 @@ if config["enable"]["retrieve"] and (
"data/osm-raw/{country}/substations_relation.json",
country=config_provider("countries"),
),

rule build_electricity_loads:
"""
This rule builds the electricity loads from ENTSO-E data.
The data is used to prepare the electricity demand if ENTSO-E load data is chosen.
"""
params:
snapshots=config_provider("snapshots"),
countries=config_provider("countries"),
output:
resources("historical_electricity_loads.csv"),
log:
logs("build_electricity_loads.log"),
resources:
mem_mb=5000,
script:
"../scripts/build_electricity_loads.py"
2 changes: 2 additions & 0 deletions rules/solve_myopic.smk
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ ruleorder: add_existing_baseyear > add_brownfield


rule final_adjustment_myopic:
params:
transmission_projects=config_provider("transmission_projects"),
input:
network=RESULTS
+ "prenetworks-brownfield/base_s_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
Expand Down
Loading