Skip to content

Commit 1286734

Browse files
committed
use higher lifetime only for existing German gas CHPs
1 parent c373db2 commit 1286734

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

config/config.de.yaml

Lines changed: 1 addition & 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: 20250507_simple_scenarios
7+
prefix: 20253006_fix_chp_lifetime
88
name:
99
# - ExPol
1010
- KN2045_Mix

scripts/add_existing_baseyear.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,10 @@ def add_chp_plants(n, grouping_years, costs, baseyear):
510510
chp["lifetime"] = (chp.DateOut - chp["grouping_year"] + 1).fillna(
511511
snakemake.params.costs["fill_values"]["lifetime"]
512512
)
513+
chp.loc[chp.Fueltype == "gas", "lifetime"] = (
514+
chp.DateOut - chp["grouping_year"] + 1
515+
).fillna(40)
516+
513517
chp = chp.loc[
514518
chp.grouping_year + chp.lifetime > baseyear
515519
] # in add_brownfield this is build_year + lifetime <= baseyear
@@ -885,12 +889,19 @@ def add_heating_capacities_installed_before_baseyear(
885889

886890
assert valid_grouping_years.is_monotonic_increasing
887891

888-
# get number of years of each interval
889-
_years = valid_grouping_years.diff()
890-
# Fill NA from .diff() with value for the first interval
891-
_years[0] = valid_grouping_years[0] - baseyear + default_lifetime
892-
# Installation is assumed to be linear for the past
893-
ratios = _years / _years.sum()
892+
if len(valid_grouping_years) == 0:
893+
logger.warning(
894+
f"No valid grouping years found for {heat_system}. "
895+
"No existing capacities will be added."
896+
)
897+
ratios = []
898+
else:
899+
# get number of years of each interval
900+
_years = valid_grouping_years.diff()
901+
# Fill NA from .diff() with value for the first interval
902+
_years[0] = valid_grouping_years[0] - baseyear + default_lifetime
903+
# Installation is assumed to be linear for the past
904+
ratios = _years / _years.sum()
894905

895906
for ratio, grouping_year in zip(ratios, valid_grouping_years):
896907
# Add heat pumps

scripts/pypsa-de/modify_cost_data.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,6 @@ def carbon_component_fossils(costs, co2_price):
140140
f"Scaling central water tank storage investment costs to KEA Technikkatalog: {costs.loc['central water tank storage', 'investment'].value} {costs.loc['central water tank storage', 'investment'].unit}."
141141
)
142142

143-
# increase central gas CHP lifetime to 40 years
144-
costs.at[("central gas CHP", "lifetime"), "value"] = 40
145-
logger.info(
146-
f"Setting lifetime of central gas CHP to {costs.at[('central gas CHP', 'lifetime'), 'value']} {costs.at[('central gas CHP', 'lifetime'), 'unit']}."
147-
)
148-
149143
# decrease Fischer-Tropsch efficiency
150144
costs.at[("Fischer-Tropsch", "efficiency"), "value"] = (
151145
1 / costs.at[("Fischer-Tropsch", "hydrogen-input"), "value"]

0 commit comments

Comments
 (0)