for existing heating use new default_heating_lifetime

This is because old costs default (25) is longer than all heating
technologies (20). Script was distributing across 25 years, then
throwing out boilers older than 20 years, an inconsistent
behaviour.

Now existing boilers are smoothly distributed across 20 years.
This commit is contained in:
Tom Brown 2024-01-29 11:25:09 +01:00 committed by Fabian Neumann
parent d7f3f16a9b
commit 6d94439bbb
2 changed files with 3 additions and 8 deletions

View File

@ -357,6 +357,7 @@ existing_capacities:
grouping_years_power: [1980, 1985, 1990, 1995, 2000, 2005, 2010, 2015, 2020, 2025, 2030]
grouping_years_heat: [1980, 1985, 1990, 1995, 2000, 2005, 2010, 2015, 2019] # these should not extend 2020
threshold_capacity: 10
default_heating_lifetime: 20
conventional_carriers:
- lignite
- coal

View File

@ -429,7 +429,7 @@ def add_heating_capacities_installed_before_baseyear(
if int(grouping_year) + default_lifetime <= int(baseyear):
continue
# installation is assumed to be linear for the past 25 years (default lifetime)
# installation is assumed to be linear for the past default_lifetime years
ratio = (int(grouping_year) - int(grouping_years[i - 1])) / default_lifetime
n.madd(
@ -536,12 +536,6 @@ def add_heating_capacities_installed_before_baseyear(
],
)
# drop assets which are at the end of their lifetime
links_i = n.links[(n.links.build_year + n.links.lifetime <= baseyear)].index
logger.info("Removing following links because at end of their lifetime:")
logger.info(links_i)
n.mremove("Link", links_i)
if __name__ == "__main__":
if "snakemake" not in globals():
@ -598,7 +592,7 @@ if __name__ == "__main__":
.to_pandas()
.reindex(index=n.snapshots)
)
default_lifetime = snakemake.params.costs["fill_values"]["lifetime"]
default_lifetime = snakemake.params.existing_capacities["default_heating_lifetime"]
add_heating_capacities_installed_before_baseyear(
n,
baseyear,