add_electricity: enable flattening hydro dispatch

config.validation: reduce crossborder caps
This commit is contained in:
Fabian 2023-07-21 13:23:00 +02:00
parent 2df6157f1b
commit 474321c638
4 changed files with 25 additions and 4 deletions

View File

@ -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

View File

@ -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

View File

@ -22,6 +22,6 @@ conventional:
solving:
options:
linearized_unit_commitment: true
horizon: 365
overlap: 24
rolling_horizon: true
horizon: 389
overlap: 24

View File

@ -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,