@@ -399,6 +399,102 @@ rule build_egon_data:
399399 "scripts/pypsa-de/build_egon_data.py"
400400
401401
402+ rule prepare_district_heating_subnodes :
403+ params :
404+ district_heating = config_provider ("sector" , "district_heating" ),
405+ baseyear = config_provider ("scenario" , "planning_horizons" , 0 ),
406+ input :
407+ heating_technologies_nuts3 = resources ("heating_technologies_nuts3.geojson" ),
408+ regions_onshore = resources ("regions_onshore_base_s_{clusters}.geojson" ),
409+ fernwaermeatlas = "data/fernwaermeatlas/fernwaermeatlas.xlsx" ,
410+ cities = "data/fernwaermeatlas/cities_geolocations.geojson" ,
411+ lau_regions = "data/lau_regions.zip" ,
412+ census = storage (
413+ "https://www.zensus2022.de/static/Zensus_Veroeffentlichung/Zensus2022_Heizungsart.zip" ,
414+ keep_local = True ,
415+ ),
416+ osm_land_cover = storage (
417+ "https://heidata.uni-heidelberg.de/api/access/datafile/23053?format=original&gbrecs=true" ,
418+ keep_local = True ,
419+ ),
420+ natura = ancient ("data/bundle/natura/natura.tiff" ),
421+ groundwater_depth = storage (
422+ "http://thredds-gfnl.usc.es/thredds/fileServer/GLOBALWTDFTP/annualmeans/EURASIA_WTD_annualmean.nc" ,
423+ keep_local = True ,
424+ ),
425+ output :
426+ district_heating_subnodes = resources (
427+ "district_heating_subnodes_base_s_{clusters}.geojson"
428+ ),
429+ regions_onshore_extended = resources (
430+ "regions_onshore_base-extended_s_{clusters}.geojson"
431+ ),
432+ regions_onshore_restricted = resources (
433+ "regions_onshore_base-restricted_s_{clusters}.geojson"
434+ ),
435+ resources :
436+ mem_mb = 20000 ,
437+ script :
438+ "scripts/pypsa-de/prepare_district_heating_subnodes.py"
439+
440+
441+ def baseyear_value (wildcards ):
442+ return config_provider ("scenario" , "planning_horizons" , 0 )(wildcards )
443+
444+
445+ rule add_district_heating_subnodes :
446+ params :
447+ district_heating = config_provider ("sector" , "district_heating" ),
448+ baseyear = config_provider ("scenario" , "planning_horizons" , 0 ),
449+ sector = config_provider ("sector" ),
450+ heat_pump_sources = config_provider (
451+ "sector" , "heat_pump_sources" , "urban central"
452+ ),
453+ heat_utilisation_potentials = config_provider (
454+ "sector" , "district_heating" , "heat_utilisation_potentials"
455+ ),
456+ direct_utilisation_heat_sources = config_provider (
457+ "sector" , "district_heating" , "direct_utilisation_heat_sources"
458+ ),
459+ adjustments = config_provider ("adjustments" , "sector" ),
460+ input :
461+ unpack (input_heat_source_power ),
462+ network = resources (
463+ "networks/base_s_{clusters}_{opts}_{sector_opts}_{planning_horizons}.nc"
464+ ),
465+ subnodes = resources ("district_heating_subnodes_base_s_{clusters}.geojson" ),
466+ nuts3 = resources ("nuts3_shapes.geojson" ),
467+ regions_onshore = resources ("regions_onshore_base_s_{clusters}.geojson" ),
468+ fernwaermeatlas = "data/fernwaermeatlas/fernwaermeatlas.xlsx" ,
469+ cities = "data/fernwaermeatlas/cities_geolocations.geojson" ,
470+ cop_profiles = resources ("cop_profiles_base_s_{clusters}_{planning_horizons}.nc" ),
471+ direct_heat_source_utilisation_profiles = resources (
472+ "direct_heat_source_utilisation_profiles_base_s_{clusters}_{planning_horizons}.nc"
473+ ),
474+ existing_heating_distribution = lambda w : resources (
475+ f"existing_heating_distribution_base_s_{{clusters}}_{ baseyear_value (w )} .csv"
476+ ),
477+ lau_regions = "data/lau_regions.zip" ,
478+ output :
479+ network = resources (
480+ "networks/base-extended_s_{clusters}_{opts}_{sector_opts}_{planning_horizons}.nc"
481+ ),
482+ district_heating_subnodes = resources (
483+ "district_heating_subnodes_base_s_{clusters}_{opts}_{sector_opts}_{planning_horizons}.geojson"
484+ ),
485+ existing_heating_distribution_extended = (
486+ resources (
487+ "existing_heating_distribution_base-extended_s_{clusters}_{opts}_{sector_opts}_{planning_horizons}.csv"
488+ )
489+ if baseyear_value != "{planning_horizons}"
490+ else []
491+ ),
492+ resources :
493+ mem_mb = 10000 ,
494+ script :
495+ "scripts/pypsa-de/add_district_heating_subnodes.py"
496+
497+
402498ruleorder : modify_district_heat_share > build_district_heat_share
403499
404500
@@ -534,6 +630,10 @@ rule retrieve_mastr:
534630
535631
536632rule build_existing_chp_de :
633+ params :
634+ district_heating_subnodes = config_provider (
635+ "sector" , "district_heating" , "subnodes"
636+ ),
537637 input :
538638 mastr_biomass = "data/mastr/bnetza_open_mastr_2023-08-08_B_biomass.csv" ,
539639 mastr_combustion = "data/mastr/bnetza_open_mastr_2023-08-08_B_combustion.csv" ,
@@ -542,8 +642,13 @@ rule build_existing_chp_de:
542642 keep_local = True ,
543643 ),
544644 regions = resources ("regions_onshore_base_s_{clusters}.geojson" ),
645+ district_heating_subnodes = lambda w : (
646+ resources ("district_heating_subnodes_base_s_{clusters}.geojson" )
647+ if config_provider ("sector" , "district_heating" , "subnodes" , "enable" )(w )
648+ else []
649+ ),
545650 output :
546- german_chp = resources ("german_chp_ {clusters}.csv" ),
651+ german_chp = resources ("german_chp_base_s_ {clusters}.csv" ),
547652 log :
548653 logs ("build_existing_chp_de_{clusters}.log" ),
549654 script :
0 commit comments