Skip to content

Commit 509d7b1

Browse files
cpschauMichalindnemitoniseiboldcpschau
authored
Representation of German district heating systems as subnodes (#58)
* change V2G and offwind assumptions * taking config[industry][DRI_fraction] from FORECAST to sort out coal use for steel in 2045 * change key for ariadne 1 DB * reading steam_fractions from FORECAST Final Energy excl Non-Energy Use * exclude industry_sector_ratios.csv from shared resources * remove steam_fraction config from config.yaml * update submodule * PyPSA-Ariadne specific steam fractions independent from FORECAST * bug fix not initializing industry since it's already in the scenarios.manual.yaml file * improve numerical stability * improve numerical stability * update submodule * exclude the "co2 sequestered" store from accounting * get "link" dont drop "store" to avoid errors * minor improvements for exports * checkout corresponding branch in pypsa-eur * add config prefix * correct year for renewable estimation * limit offshore expansion in 2030 * new cutout from Fabian * additional keys * update submodule * use the modded n.statistics to get investments * add offwind transmission investment * minor fixes * add endpoints to investment averages * adapt to pypsa upstream changes * minor fix * explicitly report offwind investments * update submodule * update submodule * reduce DH buildout potential, especially for CurPol and WorstCase * changes to update submodule to master * update to upstream changes * adapt to pypsa changes * rename investment -> overnight_cost * more investment -> overnight_cost renaming * final touches for the renaming * added new script for DH modifications * function for update of urban heat loads * Preserve aggregate DH demand * update submodule * quickfix for pypsa version until new release * add subnodes and loads * adjust snapshots * update submodule * ignore errors when dropping stores * Update pypsa version * use NEP DC costs * make unravelling of oil bus consistent with new refineries I.e. separate DE oil primary from DE oil. * upstream fix for connection_overnight_cost * fix renwable: config key * rename cutout * update exporter * update DC stations costs * Create Changelog.md * Create PULL_REQUEST_TEMPLATE.md * ci: add validator * select images and add repo owner path * load chps, change function header * Update PULL_REQUEST_TEMPLATE.md * Update Changelog.md * update submodule * Update .pre-commit-config.yaml * remove reuse check * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Using config_provider for additional functionality exclusively (#154) * using exclusively config_provider * moving bc to solving config * style changes * minor style changes * cosmetic changes * add back default values of constraints * remove unused function arguments * small fix for exporter * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: Michael Lindner <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * Create .git-blame-ignore-revs (#158) * minor changes for running single node network (#160) * minor changes for running single node network * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * Fix hydrogen import boundary condition (#159) * include retrofitted and Kernnetz pipelines for hydrogen import boundary condition * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * bugfixing mock_snakemake and fullfilling prerequisites for review --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * Accounting renewable CH4 without spatially resolved CH4 network (#146) * first stab at accounting CH4 when not spatially resolving CH4 network * unravelling in prepare_sector_network * changing H2_retrofit config * fix regions without boiler profiles * stash * add option for high spatial resolution in config * config fixes * more config fixes * ... * Update scenarios.manual.yaml * ignore errors when dropping stores * Update pypsa version * adding CH4 to national CO2 target * config revert * disable additional scenarios * correctly assign renewable gas bus to * avoid cycle flows of renewable gas * fix AI hallucination * add tech_color * fix exporter * update submodule * account for carrier shares in imports and exports of renewable gases * update submodule * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: JulianGeis <[email protected]> Co-authored-by: Julian Geis <[email protected]> Co-authored-by: Michael Lindner <[email protected]> Co-authored-by: Micha <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * Hydrogen Gas Turbines and Retrofitting of Gas Turbines (#151) * first stab at enabling H2 and H2 retrofit gas plants * forcing gas turbines from one year on * fixing efficiency of hydrogen gas turbines * bug fixing params * dropping gas plants after forcing them to retrofit * make unravelling of oil bus consistent with new refineries I.e. separate DE oil primary from DE oil. * update exporter * ci: add validator * select images and add repo owner path * Update PULL_REQUEST_TEMPLATE.md * Update Changelog.md * update submodule * Update .pre-commit-config.yaml * remove reuse check * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Using config_provider for additional functionality exclusively (#154) * using exclusively config_provider * moving bc to solving config * style changes * minor style changes * cosmetic changes * add back default values of constraints * remove unused function arguments * small fix for exporter * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: Michael Lindner <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * Create .git-blame-ignore-revs (#158) * minor changes for running single node network (#160) * minor changes for running single node network * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * Fix hydrogen import boundary condition (#159) * include retrofitted and Kernnetz pipelines for hydrogen import boundary condition * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * bugfixing mock_snakemake and fullfilling prerequisites for review --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * first stab at enabling H2 and H2 retrofit gas plants * forcing gas turbines from one year on * fix merge bugs * change exporter to report hydrogen plants * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * change name of retrofitted H2 * updating exporter * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix bus0 auf H2 plants * finish rename of h2 retrofit * default efficiency = 1 --------- Co-authored-by: Tom Brown <[email protected]> Co-authored-by: Michael Lindner <[email protected]> Co-authored-by: lkstrp <[email protected]> Co-authored-by: Micha <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Julian Geis <[email protected]> * minor fixes * Include spain (#163) * edit default focus weights * update high spatial weights as well * Add 'ES' to list of countries * aviod focus_weights > 1 * request more plots from validator * [pre-commit.ci] pre-commit autoupdate (#165) updates: - [github.com/psf/black-pre-commit-mirror: 24.4.2 → 24.8.0](psf/black-pre-commit-mirror@24.4.2...24.8.0) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * Update post-discretization size for H2 (#167) * ci: adjust ci to new validator (#164) * validator dev * chore: remove `.gitkeep` * fix: use correct plots path * fix * fix: ignore prs from forks * remove dev mode * Modify dh systems (#113) * added new script for DH modifications * function for update of urban heat loads * Preserve aggregate DH demand * remove subnodes * extra rule for egon data retrieval * Merge main * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add dh progress * adjusted demand preservation for grid losses, improved comments * change script structure; modify dh shares in csv before prepare_sector_network * added docstring for script; changed logger config; excluded snakemake input from function; renamed inputs * change snakemake input file name in Snakefile * use technology mapping from metadata * changed spelling of eGo^n and adapted reference of data set in docstring * extended docstrings; added translation of 'Fernwaerme'; load snakemake input outside function * extended changelog; added config prefix * changed date format of prefix --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Micha <[email protected]> * Limit German CO2 sequestration in each investment year (#170) * add_func: use same function for add_max/min_capacity_limits to avoid boilerplate code repetition * add_func: stores in add_{min/max}_limits; limit DE co2 sequestration Extend the functions add_{min/max}_limits in additional_functionality.py to allow stores. Add limits to DE CO2 sequestration based on feasibility constraints. E.g. since EU target for 2030 is 50 MtCO2/a sequestration in Net Zero Industry Act, limit DE to 10 MtCO2/a, then relax with subsequent years. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * check if constraint exists inside loop --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Michael Lindner <[email protected]> Co-authored-by: Micha <[email protected]> * fix (#169) * update submodule * ci: add dependabot (#172) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Bump lkstrp/pypsa-validator in the github-actions group (#173) Bumps the github-actions group with 1 update: [lkstrp/pypsa-validator](https://github.com/lkstrp/pypsa-validator). Updates `lkstrp/pypsa-validator` from 0.1.2 to 0.1.3 - [Release notes](https://github.com/lkstrp/pypsa-validator/releases) - [Commits](PyPSA/pypsa-validator@v0.1.2...v0.1.3) --- updated-dependencies: - dependency-name: lkstrp/pypsa-validator dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * changed data source to Fernwärmeatlas; changed script structure; included CHPs * fixed nodal EB with gas boiler; fixed snakemake issues * changed input for add_brownfield * geolocations from file instead of geocoding * added links and stores except from heat pumps; adapted snakemake inputs for add_brownfield * add ASHP * fix bugs for heat pump integration * Bump lkstrp/pypsa-validator to `v0.1.4` (#178) * Update validate.yml * Update validate.yml * Merging master into Ariadne 2 (#177) * updating cost data for Bal scenario to technology-data 0.9.1 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update submodule * additional path for new imports in scripts/definitions * temporarily allow biomass transport to fix CH bug * make computation more robust * even more robustness for gas_frcations calculations * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * switch off biomass_transport again, but temporarily disable must_run for biogas * fix index error * switch back to rule get_data workflow * adapt to upstream config rename * account hydrogen production by industrial processes * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update submodule * update submodule --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * Biogas (#184) * changes to incorporate biogas plants * explicitly report electricity from biogas * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * Adding Italy (#183) * config for 27 nodes adding Italy * document changes in log --------- Co-authored-by: Michael Lindner <[email protected]> * Updating cost horizon data (#182) * updating cost horizon data * fullfilling PR checklist --------- Co-authored-by: Michael Lindner <[email protected]> * Adding overnight costs in `modify_prenetwork` (#181) * robustely adding parameters for DE meoh and oil stores * adjust overnight costs for retrofitted gas plants * satisfy checklist and rename prefix * adding overnight costs to chps as well --------- Co-authored-by: Michael Lindner <[email protected]> * update submodule * bump prefix * Implement rising hub heights for wind; profile smoothing for offshore wind (#171) * enable wind profile smoothing; raise hub heights in 2030 and 2040 Smoothing by Gaussian kernel enabled following Gorm Andresen atlas implementation. Hub heights raised by 10m every 10 years versus PyPSA-Eur reference turbines (Vestas 3 MW for onwind, NREL 5 MW for offwind). * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * turn off onwind smoothing until GWA correction to wind speeds In this version two errors (lack of smoothing and lack of GWA correction) cancel out. Both should be fixed in medium-term. * disable offwind-float --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Lukas Trippe <[email protected]> Co-authored-by: Michael Lindner <[email protected]> * update submodule * Bump lkstrp/pypsa-validator to v0.2.0 (#185) * Bump lkstrp/pypsa-validator to v0.2.0 * Update dependabot.yml * Update validate.yml * improve exporter stability * importve numerical stability of exporter * update snakemake * update submodule * update submodule * downgrade submodule * update pypsa and submodule * Bump lkstrp/pypsa-validator from 0.2.0 to 0.2.1 in the github-actions group (#192) * Bump lkstrp/pypsa-validator in the github-actions group Bumps the github-actions group with 1 update: [lkstrp/pypsa-validator](https://github.com/lkstrp/pypsa-validator). Updates `lkstrp/pypsa-validator` from 0.2.0 to 0.2.1 - [Release notes](https://github.com/lkstrp/pypsa-validator/releases) - [Commits](PyPSA/pypsa-validator@v0.2.0...v0.2.1) --- updated-dependencies: - dependency-name: lkstrp/pypsa-validator dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions ... Signed-off-by: dependabot[bot] <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update validate.yml --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Lukas Trippe <[email protected]> * make exporter more robust * add gas trade to exporter * Update Germany specific costs (NEP, onwind, pellets) (#193) * for offwind use cost of 1 see 1 land inverter, instead of 2 land inverters * update NEP and offwind costs * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * modify pelletizing costs and onwind investments * rename * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * add marginal_cost for international trade links * round exported data to 5 significant decimals * adjustments to cop netcdf and existing heating distribution * fix extension of existing_heating df * fix snakemake issue for existing heating * dirty fix for workflow and optional output * match CHP by LAU shapes * added industry heat load * make workflow run after merge * add heat vent and remove load shedder * fix workflow * uncomment get_data * add type hints and docstrings; clean-up unused code snippets; simplify snakefile * change variable name row to subnode * add fernwaermeatlas data * change docstring to numpy * add comments * another docstring conversion to numpy format * one more numpy docstring * Pre-merge: remapped directory structure * Adjust add_existing_baseyear to allow for subnodes * fix snakefile * Add geothermal-sourced central heat pumps (#1359) * feat: add utilisation potential retrieval * feat: add build_heat_source_potentials module * feat: update config * feat: extend retrieve.smk * feat: pass potential to update prepare_sector_network * feat: update cop profile module * feat: update build_sector.smk accordingly * fix: use generator + links for heat source * clean up run.py * feat: generalise 'geothermal' to any heat source in Fraunhofer data * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * chor: simplify indexing * style: rename potentials var * fix: return 0 for COP calculation when source inlet temperature exceeds sink outlet temperature * refactor: remove unused function and clean up code in build_cop_profiles.run.py * style: clean-up comments in OnshoreRegionData.py and prepare_sector_network.py * feat: add direct heat source utilisation when source temp > forward temp * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * feat: add costs for geothermal heat source * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * style: pre-commit, add dev to gitignore * feat: replace access to config with unpack where possible Note: unpack() doesn't work in snakemake output, so geothermal is specified explicitly as only heat source! * feat: replace dict access to config in snakemake * doc: add docstrings, clean up code * docs: update release notes * doc: update configtables * doc: update data sourcs * update docs * Update config/config.default.yaml Co-authored-by: Lukas Trippe <[email protected]> * docs: fix data-retrieval docs * feat: turn off geothermal DH heat by default * style: remove "fraunhofer_" in naming * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * style: use snakemake.wildcards.heat_sources rather than additional param * Update doc/configtables/sector.csv Co-authored-by: Fabian Neumann <[email protected]> * Update doc/configtables/sector.csv Co-authored-by: Fabian Neumann <[email protected]> * docs: update sector.csv * refactor: refactor scaling factor calculation in run.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * docs: add direct_utilisation_heat_sources to configtables * udpate release_notes --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Lukas Trippe <[email protected]> Co-authored-by: Fabian Neumann <[email protected]> * fix workflow * cleaned up unnecessary code * EEM paper setup * replace corine with osm land cover data * mv ptes land eligibility to prepare_subnodes; fix ptes initialization; increase resolution of exclusion container * update prepare_sector_network * increase eem resolution * update TTES efficiencies * fix land eligibility * adjust snakemake mem requirements * fix eem config * fix ptes query * multithreaded potential calculation * use raster data from census to refine district heating areas * add resolution for exclusion container as parameter * preliminary fixes after merge * Add PTES and introduce PTES/TES energy-to-power ratios (#1546) * introduce etpr for TES using stores * add constraints * copleted implementation of constraints for TES stores * updated release notes * adjusted mock snakemake default * library change * update release notes * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Delete .DS_Store * change retrieval of etpr values in etpr_constraint * changed TES constraints check based on the configs * constraint checks * enhance error handling for the tes constraints * small changes * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * changed mock snakemake back to default settings * feat: add marginal cost for water tank chargers * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * docs: update add_retrofit_gas_boiler_constraint docs * docs: update return type annotation for get_heat_system_type method * feat: add heat vents for decentral and rural heating * feat: remove unnecessary central_heat_vent config * feat: pass heat vent marginal cost to prepare_sector_network * refactor: rename marginal_cost_storage to marginal_cost_home_battery_storage * docs: update configtables * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * docs: update release notes * add suggestions to ensure that charger and discharger align for charger ratio constraints and energy power constraints * add lifetime to PTES and TTES charger/discharger, so that they are built with correct baseyear * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * feat: add small penalty on ptes charging * feat: update fixed cost to capital cost str * feat: remove unnecessary passing of obsolete config * feat: remove unneeded config passing * feat: remove unneeded config passing * feat: remove unneeded config passing * Update scripts/solve_network.py * Update solve_network.py * feat: re-add TES necessary parameters * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Refactor string contains checks * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Amos Schledorn <[email protected]> Co-authored-by: Amos Schledorn <[email protected]> * adjustments to new geothermal potentials and heat_stores * hot fix for missing geothermal potentials in GB * adjust reference of df with subnodes to correctly handle demand(subnodes) > demand(cluster) * CHP plants in buffered dh area based on census instead of LAU * fix COP revision of predecessing network * single execution of build_existing_chp_de * adjust path in snakefile to networks subdirectory * convert chps to eops if no urban central heat bus is available * reference cities as bus locations * adjust docstring * adjust query of chp input path to removal of wildcards * updating mean cost data * rename sysgf scenario file * adjust chp path in add_existing_baseyear inputs * rename referenced sysgf scenario file * Revert "CHP plants in buffered dh area based on census instead of LAU" This reverts commit df75573. * remove outdated heat source rules * adjust subnode loads * remove if-clause from snakefile * skip adjustments in prepare_sector_network if subnodes activated * aligned mean costs files * clean-up prepare_sector_network * clean-up heating files * Fix: wildcards of build_renewable_profiles for scenario management 'base' were not the same * rename prefix * use absolute imports * switch back to get from _helpers * remove duplicate aviation sector * get correct investments year for aviation * load_costs instead of prepare_costs * simplify nep_costs * adjust to new naming of wind generators with resource classes * some more conforming with upstream changes * add another color for 2050 * complement datafiles * start by making Mix the default scenario * make script more robust * - change syntax of national co2_budget - define a default national_co2_budget - allow empty scenario, which falls back to the defaults specified in pypsa.de.yaml * simplify scenario definitions, fallback to defaults more often * change prefix * ariadne_template is data not resources * fix rounding error * disable interactive mode in final plotting script * decouple ariadne DB pre-workflow from scenario management * fix key error * review: addition, removal and renaming of config parameters; removed hard-coded parameters; resolved variables containing acronyms; isolated nested function; general refactoring * adjust configs * allow for dynamic ptes capacity and remove cases for ptes as storage unit * revert restriction of mother node ptes potentials * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Modularize and refactor add_subnodes * doc: extended docstring of add_subnodes * fix disabling of feature * get baseyear using config_provider * remove duplicated marginal cost for pit chargers * declared variable for transmission bus * added overnight costs for TES * used min_dh_share from config, removed obsolete function for encoding, adjusted docstring & comments * remove commented lines with neglected CHP techs * fix config provider usage * add check for load preservation * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Micha <[email protected]> Co-authored-by: Michael Lindner <[email protected]> Co-authored-by: toniseibold <[email protected]> Co-authored-by: cpschau <[email protected]> Co-authored-by: Tom Brown <[email protected]> Co-authored-by: lkstrp <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Toni Seibold <[email protected]> Co-authored-by: Julian Geis <[email protected]> Co-authored-by: JulianGeis <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Amos Schledorn <[email protected]> Co-authored-by: Fabian Neumann <[email protected]> Co-authored-by: Tom Kaehler <[email protected]> Co-authored-by: TomKae00 <[email protected]> Co-authored-by: Amos Schledorn <[email protected]>
1 parent c373db2 commit 509d7b1

17 files changed

+2061
-40
lines changed

Snakefile

Lines changed: 106 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,102 @@ rule build_egon_data:
346346
"scripts/pypsa-de/build_egon_data.py"
347347

348348

349+
rule prepare_district_heating_subnodes:
350+
params:
351+
district_heating=config_provider("sector", "district_heating"),
352+
baseyear=config_provider("scenario", "planning_horizons", 0),
353+
input:
354+
heating_technologies_nuts3=resources("heating_technologies_nuts3.geojson"),
355+
regions_onshore=resources("regions_onshore_base_s_{clusters}.geojson"),
356+
fernwaermeatlas="data/fernwaermeatlas/fernwaermeatlas.xlsx",
357+
cities="data/fernwaermeatlas/cities_geolocations.geojson",
358+
lau_regions="data/lau_regions.zip",
359+
census=storage(
360+
"https://www.zensus2022.de/static/Zensus_Veroeffentlichung/Zensus2022_Heizungsart.zip",
361+
keep_local=True,
362+
),
363+
osm_land_cover=storage(
364+
"https://heidata.uni-heidelberg.de/api/access/datafile/23053?format=original&gbrecs=true",
365+
keep_local=True,
366+
),
367+
natura=ancient("data/bundle/natura/natura.tiff"),
368+
groundwater_depth=storage(
369+
"http://thredds-gfnl.usc.es/thredds/fileServer/GLOBALWTDFTP/annualmeans/EURASIA_WTD_annualmean.nc",
370+
keep_local=True,
371+
),
372+
output:
373+
district_heating_subnodes=resources(
374+
"district_heating_subnodes_base_s_{clusters}.geojson"
375+
),
376+
regions_onshore_extended=resources(
377+
"regions_onshore_base-extended_s_{clusters}.geojson"
378+
),
379+
regions_onshore_restricted=resources(
380+
"regions_onshore_base-restricted_s_{clusters}.geojson"
381+
),
382+
resources:
383+
mem_mb=20000,
384+
script:
385+
"scripts/pypsa-de/prepare_district_heating_subnodes.py"
386+
387+
388+
def baseyear_value(wildcards):
389+
return config_provider("scenario", "planning_horizons", 0)(wildcards)
390+
391+
392+
rule add_district_heating_subnodes:
393+
params:
394+
district_heating=config_provider("sector", "district_heating"),
395+
baseyear=config_provider("scenario", "planning_horizons", 0),
396+
sector=config_provider("sector"),
397+
heat_pump_sources=config_provider(
398+
"sector", "heat_pump_sources", "urban central"
399+
),
400+
heat_utilisation_potentials=config_provider(
401+
"sector", "district_heating", "heat_utilisation_potentials"
402+
),
403+
direct_utilisation_heat_sources=config_provider(
404+
"sector", "district_heating", "direct_utilisation_heat_sources"
405+
),
406+
adjustments=config_provider("adjustments", "sector"),
407+
input:
408+
unpack(input_heat_source_power),
409+
network=resources(
410+
"networks/base_s_{clusters}_{opts}_{sector_opts}_{planning_horizons}.nc"
411+
),
412+
subnodes=resources("district_heating_subnodes_base_s_{clusters}.geojson"),
413+
nuts3=resources("nuts3_shapes.geojson"),
414+
regions_onshore=resources("regions_onshore_base_s_{clusters}.geojson"),
415+
fernwaermeatlas="data/fernwaermeatlas/fernwaermeatlas.xlsx",
416+
cities="data/fernwaermeatlas/cities_geolocations.geojson",
417+
cop_profiles=resources("cop_profiles_base_s_{clusters}_{planning_horizons}.nc"),
418+
direct_heat_source_utilisation_profiles=resources(
419+
"direct_heat_source_utilisation_profiles_base_s_{clusters}_{planning_horizons}.nc"
420+
),
421+
existing_heating_distribution=lambda w: resources(
422+
f"existing_heating_distribution_base_s_{{clusters}}_{baseyear_value(w)}.csv"
423+
),
424+
lau_regions="data/lau_regions.zip",
425+
output:
426+
network=resources(
427+
"networks/base-extended_s_{clusters}_{opts}_{sector_opts}_{planning_horizons}.nc"
428+
),
429+
district_heating_subnodes=resources(
430+
"district_heating_subnodes_base_s_{clusters}_{opts}_{sector_opts}_{planning_horizons}.geojson"
431+
),
432+
existing_heating_distribution_extended=(
433+
resources(
434+
"existing_heating_distribution_base-extended_s_{clusters}_{opts}_{sector_opts}_{planning_horizons}.csv"
435+
)
436+
if baseyear_value != "{planning_horizons}"
437+
else []
438+
),
439+
resources:
440+
mem_mb=10000,
441+
script:
442+
"scripts/pypsa-de/add_district_heating_subnodes.py"
443+
444+
349445
ruleorder: modify_district_heat_share > build_district_heat_share
350446

351447

@@ -481,6 +577,10 @@ rule retrieve_mastr:
481577

482578

483579
rule build_existing_chp_de:
580+
params:
581+
district_heating_subnodes=config_provider(
582+
"sector", "district_heating", "subnodes"
583+
),
484584
input:
485585
mastr_biomass="data/mastr/bnetza_open_mastr_2023-08-08_B_biomass.csv",
486586
mastr_combustion="data/mastr/bnetza_open_mastr_2023-08-08_B_combustion.csv",
@@ -489,8 +589,13 @@ rule build_existing_chp_de:
489589
keep_local=True,
490590
),
491591
regions=resources("regions_onshore_base_s_{clusters}.geojson"),
592+
district_heating_subnodes=lambda w: (
593+
resources("district_heating_subnodes_base_s_{clusters}.geojson")
594+
if config_provider("sector", "district_heating", "subnodes", "enable")(w)
595+
else []
596+
),
492597
output:
493-
german_chp=resources("german_chp_{clusters}.csv"),
598+
german_chp=resources("german_chp_base_s_{clusters}.csv"),
494599
log:
495600
logs("build_existing_chp_de_{clusters}.log"),
496601
script:

config/config.de.yaml

Lines changed: 18 additions & 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: 20250514_dhsubnodes
88
name:
99
# - ExPol
1010
- KN2045_Mix
@@ -289,6 +289,23 @@ sector:
289289
2040: 0.6
290290
2045: 0.8
291291
2050: 1.0
292+
subnodes:
293+
enable: false
294+
nlargest: 40
295+
census_areas:
296+
enable: true
297+
min_district_heating_share: 0.01
298+
processing:
299+
min_area: [10000, 100000, 0, 1000000]
300+
buffer_factor: [0.01, 0.05, 0.05, 0]
301+
limit_ptes_potential:
302+
enable: true
303+
limit_mother_nodes: true
304+
excluder_resolution: 10
305+
osm_landcover_codes: [21, 23, 32, 33]
306+
max_groundwater_depth: -10
307+
min_area: 10000
308+
default_capacity: 4500
292309
heat_vent:
293310
urban central: true
294311
urban decentral: true

config/config.sysgf.yaml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# SPDX-FileCopyrightText: : 2017-2024 The PyPSA-Eur Authors
2+
#
3+
# SPDX-License-Identifier: CC0-1.0
4+
5+
run:
6+
prefix: 20250514_dhsubnodes
7+
name:
8+
- Baseline
9+
# - No_PTES
10+
# - LowPTESCAPEX
11+
# - HighPTESCAPEX
12+
# - LowStandingLosses
13+
# - HighStandingLosses
14+
# - LowGroundWaterDepth
15+
# - HighGroundWaterDepth
16+
# - LowEtPRatio
17+
# - HighEtPRatio
18+
scenarios:
19+
enable: true
20+
manual_file: config/scenarios.sysgf.yaml
21+
file: config/scenarios.automated.yaml
22+
shared_resources:
23+
policy: base #stops recalculating
24+
exclude:
25+
- existing_heating.csv # specify files which should not be shared between scenarios
26+
- costs
27+
- retrieve_cost # This is necessary to save retrieve_cost_data_{year}.log in the correct folder
28+
- industry_sector_ratios
29+
- build_industry_sector_ratios # This is necessary to save build_industry_sector_ratios_data.log in the correct folder
30+
- modify_existing_heating
31+
32+
foresight: myopic
33+
34+
scenario:
35+
ll:
36+
- vopt
37+
clusters:
38+
- 27 #current options: 27, 49
39+
opts:
40+
- ''
41+
sector_opts:
42+
- none
43+
planning_horizons:
44+
# - 2020
45+
# - 2025
46+
# - 2030
47+
# - 2035
48+
# - 2040
49+
- 2045
50+
51+
clustering:
52+
temporal:
53+
resolution_sector: 365H
54+
55+
adjustments:
56+
electricity: false
57+
sector:
58+
absolute:
59+
StorageUnit:
60+
urban central water pits:
61+
standing_loss: 0.00012121
62+
urban central water tanks:
63+
standing_loss: 0.00015476
64+
65+
wasserstoff_kernnetz:
66+
enable: false
67+
68+
sector:
69+
district_heating:
70+
potential: 0.5
71+
subnodes:
72+
enable: true
73+
limited_heat_sources:
74+
geothermal:
75+
ignore_missing_regions: true
76+
heat_pump_sources:
77+
urban central:
78+
- air
79+
- geothermal
80+
urban decentral:
81+
- air
82+
rural:
83+
- air
84+
- ground
85+
86+
solving:
87+
constraints:
88+
CCL: false
89+
EQ: false
90+
BAU: false
91+
SAFE: false
92+
efuel_export_ban: false
93+
limits_capacity_max: {}
94+
limits_capacity_min: {}
95+
limits_volume_max: {}
96+
limits_volume_min: {}
97+
limits_power_max: {}

config/scenarios.sysgf.yaml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# -*- coding: utf-8 -*-
2+
# SPDX-FileCopyrightText: : 2017-2023 The PyPSA-Eur Authors
3+
#
4+
# SPDX-License-Identifier: MIT
5+
6+
Baseline:
7+
foresight: myopic
8+
iiasa_database:
9+
reference_scenario: KN2045_Mix
10+
co2_budget_DE_source: UBA
11+
12+
No_PTES:
13+
adjustments:
14+
electricity: false
15+
sector:
16+
absolute:
17+
Store:
18+
urban central water pits:
19+
e_nom_max: 0
20+
21+
LowPTESCAPEX:
22+
adjustments:
23+
electricity: false
24+
sector:
25+
factor:
26+
Store:
27+
urban central water pits:
28+
capital_cost: 0.5
29+
absolute:
30+
Store:
31+
urban central water pits:
32+
standing_loss: 0.00012121
33+
urban central water tanks:
34+
standing_loss: 0.00015476
35+
36+
HighPTESCAPEX:
37+
adjustments:
38+
electricity: false
39+
sector:
40+
factor:
41+
Store:
42+
urban central water pits:
43+
capital_cost: 2
44+
absolute:
45+
Store:
46+
urban central water pits:
47+
standing_loss: 0.00012121
48+
urban central water tanks:
49+
standing_loss: 0.00015476
50+
51+
LowStandingLosses:
52+
adjustments:
53+
electricity: false
54+
sector:
55+
absolute:
56+
Store:
57+
urban central water pits:
58+
standing_loss: 0
59+
60+
HighStandingLosses:
61+
adjustments:
62+
electricity: false
63+
sector:
64+
absolute:
65+
Store:
66+
urban central water pits:
67+
standing_loss: 0.0012121
68+
69+
LowGroundWaterDepth:
70+
sector:
71+
district_heating:
72+
subnodes:
73+
limit_ptes_potential:
74+
max_groundwater_depth: -25
75+
76+
HighGroundWaterDepth:
77+
sector:
78+
district_heating:
79+
subnodes:
80+
limit_ptes_potential:
81+
max_groundwater_depth: 0
82+
83+
LowEtPRatio:
84+
adjustments:
85+
electricity: false
86+
sector:
87+
factor:
88+
Link:
89+
urban central water pits charger:
90+
energy to power ratio: 0.5
91+
92+
HighEtPRatio:
93+
adjustments:
94+
electricity: false
95+
sector:
96+
factor:
97+
Link:
98+
urban central water pits charger:
99+
energy to power ratio: 2

0 commit comments

Comments
 (0)