From 474321c638065ddfd5dacfc541f73c3bbb71c6b0 Mon Sep 17 00:00:00 2001 From: Fabian Date: Fri, 21 Jul 2023 13:23:00 +0200 Subject: [PATCH] add_electricity: enable flattening hydro dispatch config.validation: reduce crossborder caps --- config/config.default.yaml | 1 + config/config.validation.yaml | 12 +++++++++++- config/test/config.validation.yaml | 4 ++-- scripts/add_electricity.py | 12 +++++++++++- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/config/config.default.yaml b/config/config.default.yaml index 2dd650b2..cca5018f 100644 --- a/config/config.default.yaml +++ b/config/config.default.yaml @@ -217,6 +217,7 @@ renewable: carriers: [ror, PHS, hydro] PHS_max_hours: 6 hydro_max_hours: "energy_capacity_totals_by_country" # one of energy_capacity_totals_by_country, estimate_by_large_installations or a float + flatten_dispatch: false clip_min_inflow: 1.0 # docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#conventional diff --git a/config/config.validation.yaml b/config/config.validation.yaml index bd76a9cd..1da44e8f 100644 --- a/config/config.validation.yaml +++ b/config/config.validation.yaml @@ -68,6 +68,7 @@ renewable: cutout: europe-2019-era5 hydro: cutout: europe-2019-era5 + flatten_dispatch: 0.1 conventional: unit_commitment: true @@ -75,12 +76,18 @@ conventional: nuclear: p_max_pu: "data/nuclear_p_max_pu.csv" # float of file name biomass: - p_max_pu: 0.7 + p_max_pu: 0.65 load: power_statistics: false # only for files from <2019; set false in order to get ENTSOE transparency data + +lines: + s_max_pu: 0.5 + under_construction: 'remove' # 'zero': set capacity to zero, 'remove': remove, 'keep': with full capacity + + links: include_tyndp: false @@ -89,9 +96,12 @@ costs: emission_prices: # in currency per tonne emission, only used with the option Ep co2: 25 + + solving: #tmpdir: "path/to/tmp" options: load_shedding: true rolling_horizon: true horizon: 365 + overlap: 24 diff --git a/config/test/config.validation.yaml b/config/test/config.validation.yaml index d16338a5..380718f9 100644 --- a/config/test/config.validation.yaml +++ b/config/test/config.validation.yaml @@ -22,6 +22,6 @@ conventional: solving: options: linearized_unit_commitment: true - horizon: 365 - overlap: 24 rolling_horizon: true + horizon: 389 + overlap: 24 diff --git a/scripts/add_electricity.py b/scripts/add_electricity.py index f5ddd01e..9f66c2f9 100755 --- a/scripts/add_electricity.py +++ b/scripts/add_electricity.py @@ -610,6 +610,16 @@ def attach_hydro(n, costs, ppl, profile_hydro, hydro_capacities, carriers, **par hydro.max_hours > 0, hydro.country.map(max_hours_country) ).fillna(6) + flatten_dispatch = params.get("flatten_dispatch", False) + if flatten_dispatch: + buffer = ( + flatten_dispatch if isinstance(flatten_dispatch, (int, float)) else 0.2 + ) + average_capacity_factor = inflow_t[hydro.index].mean() / hydro["p_nom"] + p_max_pu = (average_capacity_factor + buffer).clip(upper=1) + else: + p_max_pu = 1 + n.madd( "StorageUnit", hydro.index, @@ -619,7 +629,7 @@ def attach_hydro(n, costs, ppl, profile_hydro, hydro_capacities, carriers, **par max_hours=hydro_max_hours, capital_cost=costs.at["hydro", "capital_cost"], marginal_cost=costs.at["hydro", "marginal_cost"], - p_max_pu=1.0, # dispatch + p_max_pu=p_max_pu, # dispatch p_min_pu=0.0, # store efficiency_dispatch=costs.at["hydro", "efficiency"], efficiency_store=0.0,