Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Approximate district heating COPs via Jensen et al. 2018 #1175

Merged
merged 74 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
167b056
remove obsolete rural/urban COPs and rename cop_..._total to cop_..._…
amos-schledorn Jul 19, 2024
f3c898f
build district heating heat pump COPs using approximation from Jensen…
amos-schledorn Jul 19, 2024
052394f
change naming from individual/district heating to denctral/central he…
amos-schledorn Jul 19, 2024
0c7e7cb
fix naming, udpate docs
amos-schledorn Jul 19, 2024
560373a
add DH cops to network
amos-schledorn Jul 19, 2024
46f9c7b
Merge remote-tracking branch 'origin/master' into update-district-hea…
amos-schledorn Jul 22, 2024
5361fac
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 22, 2024
de10492
Merge remote-tracking branch 'origin/master' into update-district-hea…
amos-schledorn Jul 23, 2024
0e6a737
update configtables
amos-schledorn Jul 24, 2024
3fac27f
use module structure
amos-schledorn Jul 24, 2024
a9f4c63
change default DH return temperature to 50C
amos-schledorn Jul 24, 2024
eb2911c
rename __main__ to run
amos-schledorn Jul 24, 2024
a4847a1
update build_sector.smk
amos-schledorn Jul 24, 2024
b720bd9
Merge remote-tracking branch 'origin/master' into update-district-hea…
amos-schledorn Jul 24, 2024
8d6feb6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 24, 2024
0c2f9b5
remove rural/urban temperature
amos-schledorn Jul 24, 2024
f86d94c
Merge remote-tracking branch 'origin/update-district-heating-cops' in…
amos-schledorn Jul 24, 2024
368971f
remove cop_total input from prepare_sector_network
amos-schledorn Jul 24, 2024
b80bb7b
update base year COPs
amos-schledorn Jul 25, 2024
744aaf7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 25, 2024
d297f84
update inputs for add_existing_baseyear
amos-schledorn Jul 25, 2024
da201e1
udpate add_brownfield COPs
amos-schledorn Jul 25, 2024
8875ab6
add licensing info
amos-schledorn Jul 25, 2024
64d0f29
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 25, 2024
e216944
Merge remote-tracking branch 'origin/master' into update-district-hea…
amos-schledorn Jul 25, 2024
3c5b11e
update release notes
amos-schledorn Jul 25, 2024
6c14d20
checkout sector configtable from master
amos-schledorn Jul 29, 2024
9183846
update sector configtable
amos-schledorn Jul 29, 2024
da3ad17
Merge branch 'master' into update-district-heating-cops
amos-schledorn Jul 29, 2024
160cb01
Update doc/configtables/sector.csv
amos-schledorn Jul 29, 2024
69b01e6
Update config/config.default.yaml
amos-schledorn Jul 29, 2024
1d3e399
remove duplicate staticmethods
amos-schledorn Jul 29, 2024
ff12480
Merge branch 'update-district-heating-cops' of https://github.com/PyP…
amos-schledorn Jul 29, 2024
9073e49
add link to paper in release notes
amos-schledorn Jul 29, 2024
0edf566
attempt to handle heat_pump_sources dynamically
amos-schledorn Jul 29, 2024
51f42b4
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 29, 2024
29479c5
pass heat source/system type to prepare_sector_network and add_existi…
amos-schledorn Jul 29, 2024
81618d4
Merge branch 'update-district-heating-cops' of https://github.com/PyP…
amos-schledorn Jul 29, 2024
1fe5451
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 29, 2024
5e73dae
add heat_pump_sources to config and docs
amos-schledorn Jul 30, 2024
a2c0311
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 30, 2024
4362300
update configtables and docs
amos-schledorn Jul 31, 2024
4cfca27
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 31, 2024
caa260f
update class docs
amos-schledorn Jul 31, 2024
2664e68
Merge branch 'update-district-heating-cops' of https://github.com/PyP…
amos-schledorn Jul 31, 2024
d273de8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 31, 2024
214efeb
make test.sh executable
amos-schledorn Jul 31, 2024
b0150bd
refactor prepare_sector_network.add_heat using Enums
amos-schledorn Aug 1, 2024
4a6dd2f
fix naming bugs
amos-schledorn Aug 2, 2024
318e05c
refactor naming
amos-schledorn Aug 2, 2024
76b377b
udpate docs
amos-schledorn Aug 2, 2024
bbf64a2
Refactor module structure
amos-schledorn Aug 2, 2024
e515289
Merge remote-tracking branch 'origin/master' into update-district-hea…
amos-schledorn Aug 2, 2024
3ccdde3
Merge remote-tracking branch 'origin/master' into update-district-hea…
amos-schledorn Aug 2, 2024
6b924ec
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 2, 2024
a990a89
update naming in add_existing_baseyear
amos-schledorn Aug 2, 2024
10e0b30
Merge branch 'update-district-heating-cops' of https://github.com/PyP…
amos-schledorn Aug 2, 2024
0259e06
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 2, 2024
5362c37
update myopic mode to heat system declarations
amos-schledorn Aug 5, 2024
5773877
Merge branch 'update-district-heating-cops' of https://github.com/PyP…
amos-schledorn Aug 5, 2024
390085a
update add_existing_baseyear
amos-schledorn Aug 5, 2024
7bd0c16
Merge remote-tracking branch 'origin/master' into update-district-hea…
amos-schledorn Aug 5, 2024
61bb225
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 5, 2024
f593983
update copyright notic in heatSector
amos-schledorn Aug 5, 2024
d40ff8e
Merge branch 'update-district-heating-cops' of https://github.com/PyP…
amos-schledorn Aug 5, 2024
268ff93
fix boiler buses for existing heating
amos-schledorn Aug 5, 2024
ea7fc92
update solve_perfect.add_existing_baseyear input/params
amos-schledorn Aug 5, 2024
93d60a2
remove obsolote cop inputs from solve_perfect.add_existing_baseyear
amos-schledorn Aug 5, 2024
4fe8eee
rename "enums" to "definitions" and write modules in snake case
amos-schledorn Aug 5, 2024
2e35bef
rename "enums" to "definitions" and write modules in snake case
amos-schledorn Aug 5, 2024
0e8fb80
clean up, improve docs
amos-schledorn Aug 5, 2024
6e8ea1b
Merge branch 'master' into update-district-heating-cops
fneum Aug 7, 2024
9c32932
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 7, 2024
bab392f
remove not needed function
lisazeyen Aug 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion config/config.default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,15 @@ sector:
2045: 0.8
2050: 1.0
district_heating_loss: 0.15
# check these numbers!
amos-schledorn marked this conversation as resolved.
Show resolved Hide resolved
forward_temperature: 90 #C
return_temperature: 50 #C
heat_source_cooling: 6 #K
heat_pump_cop_approximation:
refrigerant: ammonia
heat_exchanger_pinch_point_temperature_difference: 5 #K
isentropic_compressor_efficiency: 0.8
heat_loss: 0.0
cluster_heat_buses: true
heat_demand_cutout: default
bev_dsm_restriction_value: 0.75
Expand Down Expand Up @@ -490,7 +499,7 @@ sector:
aviation_demand_factor: 1.
HVC_demand_factor: 1.
time_dep_hp_cop: true
heat_pump_sink_T: 55.
heat_pump_sink_T_individual_heating: 55.
reduce_space_heat_exogenously: true
reduce_space_heat_exogenously_factor:
2020: 0.10 # this results in a space heat demand reduction of 10%
Expand Down
8 changes: 8 additions & 0 deletions doc/configtables/sector.csv
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ industry,--,"{true, false}",Flag to include industry sector.
agriculture,--,"{true, false}",Flag to include agriculture sector.
district_heating,--,,`prepare_sector_network.py <https://github.com/PyPSA/pypsa-eur-sec/blob/master/scripts/prepare_sector_network.py>`_
-- potential,--,float,maximum fraction of urban demand which can be supplied by district heating. Ignored where below current fraction.
-- forward_temperature,°C,float,Forward temperature in district heating
-- return_temperature,°C,float,Return temperature in district heating. Must be lower than forward temperature
-- heat_source_cooling,K,float,Cooling of heat source for heat pumps
-- heat_pump_cop_approximation,,,
-- refrigerant,--,"{ammonia, isobutane}",Heat pump refrigerant assumed for COP approximation
-- heat_exchanger_pinch_point_temperature_difference,K,float,Heat pump pinch point temperature difference in heat exchangers assumed for approximation.
-- isentropic_compressor_efficiency,--,float,Isentropic efficiency of heat pump compressor assumed for approximation. Must be between 0 and 1.
-- heat_loss,--,float,Heat pump heat loss assumed for approximation. Must be between 0 and 1.
amos-schledorn marked this conversation as resolved.
Show resolved Hide resolved
-- progress,--,Dictionary with planning horizons as keys., Increase of today's district heating demand to potential maximum district heating share. Progress = 0 means today's district heating share. Progress = 1 means maximum fraction of urban demand is supplied by district heating
-- district_heating_loss,--,float,Share increase in district heat demand in urban central due to heat losses
cluster_heat_buses,--,"{true, false}",Cluster residential and service heat buses in `prepare_sector_network.py <https://github.com/PyPSA/pypsa-eur-sec/blob/master/scripts/prepare_sector_network.py>`_ to one to save memory.
Expand Down
2 changes: 2 additions & 0 deletions doc/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Release Notes
Upcoming Release
================

* Changed heat pump COP approximation for central heating to be based on Jensen et al. 2018 and a default forward temperature of 90C. This is more realistic for district heating than the previously used approximation method.
amos-schledorn marked this conversation as resolved.
Show resolved Hide resolved

* Renamed the carrier of batteries in BEVs from `battery storage` to `EV battery` and the corresponding bus carrier from `Li ion` to `EV battery`. This is to avoid confusion with stationary battery storage.

* Changed default assumptions about waste heat usage from PtX and fuel cells in district heating.
Expand Down
46 changes: 40 additions & 6 deletions rules/build_sector.smk
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,37 @@ rule build_temperature_profiles:

rule build_cop_profiles:
params:
heat_pump_sink_T=config_provider("sector", "heat_pump_sink_T"),
heat_pump_sink_T_decentral_heating=config_provider(
"sector", "heat_pump_sink_T_individual_heating"
),
forward_temperature_central_heating=config_provider(
"sector", "district_heating", "forward_temperature"
),
return_temperature_central_heating=config_provider(
"sector", "district_heating", "return_temperature"
),
heat_source_cooling_central_heating=config_provider(
"sector", "district_heating", "heat_source_cooling"
),
heat_pump_cop_approximation_central_heating=config_provider(
"sector", "district_heating", "heat_pump_cop_approximation"
),
input:
temp_soil_total=resources("temp_soil_total_elec_s{simpl}_{clusters}.nc"),
temp_air_total=resources("temp_air_total_elec_s{simpl}_{clusters}.nc"),
output:
cop_soil_total=resources("cop_soil_total_elec_s{simpl}_{clusters}.nc"),
cop_air_total=resources("cop_air_total_elec_s{simpl}_{clusters}.nc"),
cop_air_decentral_heating=resources(
"cop_air_decentral_heating_elec_s{simpl}_{clusters}.nc"
),
cop_soil_decentral_heating=resources(
"cop_soil_decentral_heating_elec_s{simpl}_{clusters}.nc"
),
cop_air_central_heating=resources(
"cop_air_central_heating_elec_s{simpl}_{clusters}.nc"
),
cop_soil_central_heating=resources(
"cop_soil_central_heating_elec_s{simpl}_{clusters}.nc"
),
resources:
mem_mb=20000,
log:
Expand All @@ -233,7 +257,7 @@ rule build_cop_profiles:
conda:
"../envs/environment.yaml"
script:
"../scripts/build_cop_profiles.py"
"../scripts/build_cop_profiles/run.py"


def solar_thermal_cutout(wildcards):
Expand Down Expand Up @@ -1017,8 +1041,18 @@ rule prepare_sector_network:
),
temp_soil_total=resources("temp_soil_total_elec_s{simpl}_{clusters}.nc"),
temp_air_total=resources("temp_air_total_elec_s{simpl}_{clusters}.nc"),
cop_soil_total=resources("cop_soil_total_elec_s{simpl}_{clusters}.nc"),
cop_air_total=resources("cop_air_total_elec_s{simpl}_{clusters}.nc"),
cop_soil_decentral_heating=resources(
"cop_soil_decentral_heating_elec_s{simpl}_{clusters}.nc"
),
cop_air_decentral_heating=resources(
"cop_air_decentral_heating_elec_s{simpl}_{clusters}.nc"
),
cop_air_central_heating=resources(
"cop_air_central_heating_elec_s{simpl}_{clusters}.nc"
),
cop_soil_central_heating=resources(
"cop_soil_central_heating_elec_s{simpl}_{clusters}.nc"
),
solar_thermal_total=lambda w: (
resources("solar_thermal_total_elec_s{simpl}_{clusters}.nc")
if config_provider("sector", "solar_thermal")(w)
Expand Down
28 changes: 24 additions & 4 deletions rules/solve_myopic.smk
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,18 @@ rule add_existing_baseyear:
config_provider("scenario", "planning_horizons", 0)(w)
)
),
cop_soil_total=resources("cop_soil_total_elec_s{simpl}_{clusters}.nc"),
cop_air_total=resources("cop_air_total_elec_s{simpl}_{clusters}.nc"),
cop_soil_decentral_heating=resources(
"cop_soil_decentral_heating_elec_s{simpl}_{clusters}.nc"
),
cop_air_decentral_heating=resources(
"cop_air_decentral_heating_elec_s{simpl}_{clusters}.nc"
),
cop_air_central_heating=resources(
"cop_air_central_heating_elec_s{simpl}_{clusters}.nc"
),
cop_soil_central_heating=resources(
"cop_soil_central_heating_elec_s{simpl}_{clusters}.nc"
),
existing_heating_distribution=resources(
"existing_heating_distribution_elec_s{simpl}_{clusters}_{planning_horizons}.csv"
),
Expand Down Expand Up @@ -77,8 +87,18 @@ rule add_brownfield:
+ "prenetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
network_p=solved_previous_horizon, #solved network at previous time step
costs=resources("costs_{planning_horizons}.csv"),
cop_soil_total=resources("cop_soil_total_elec_s{simpl}_{clusters}.nc"),
cop_air_total=resources("cop_air_total_elec_s{simpl}_{clusters}.nc"),
cop_soil_decentral_heating=resources(
"cop_soil_decentral_heating_elec_s{simpl}_{clusters}.nc"
),
cop_air_decentral_heating=resources(
"cop_air_decentral_heating_elec_s{simpl}_{clusters}.nc"
),
cop_air_central_heating=resources(
"cop_air_central_heating_elec_s{simpl}_{clusters}.nc"
),
cop_soil_central_heating=resources(
"cop_soil_central_heating_elec_s{simpl}_{clusters}.nc"
),
output:
RESULTS
+ "prenetworks-brownfield/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
Expand Down
14 changes: 12 additions & 2 deletions rules/solve_perfect.smk
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,18 @@ rule add_existing_baseyear:
config_provider("scenario", "planning_horizons", 0)(w)
)
),
cop_soil_total=resources("cop_soil_total_elec_s{simpl}_{clusters}.nc"),
cop_air_total=resources("cop_air_total_elec_s{simpl}_{clusters}.nc"),
cop_soil_decentral_heating=resources(
"cop_soil_decentral_heating_elec_s{simpl}_{clusters}.nc"
),
cop_air_decentral_heating=resources(
"cop_air_decentral_heating_elec_s{simpl}_{clusters}.nc"
),
cop_air_central_heating=resources(
"cop_air_central_heating_elec_s{simpl}_{clusters}.nc"
),
cop_soil_central_heating=resources(
"cop_soil_central_heating_elec_s{simpl}_{clusters}.nc"
),
existing_heating_distribution=resources(
"existing_heating_distribution_elec_s{simpl}_{clusters}_{planning_horizons}.csv"
),
Expand Down
83 changes: 48 additions & 35 deletions scripts/add_existing_baseyear.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,11 +419,11 @@ def add_heating_capacities_installed_before_baseyear(
n,
baseyear,
grouping_years,
ashp_cop,
gshp_cop,
time_dep_hp_cop,
cop: dict,
time_dep_hp_cop: bool,
costs,
default_lifetime,
existing_heating: pd.DataFrame,
):
"""
Parameters
Expand All @@ -435,13 +435,13 @@ def add_heating_capacities_installed_before_baseyear(
currently assumed heating capacities split between residential and
services proportional to heating load in both 50% capacities
in rural buses 50% in urban buses
cop: dict
Dictionary with time-dependent coefficients of performance (COPs) for air and ground heat pumps as values and keys "air decentral", "ground decentral", "air central", "ground central"
time_dep_hp_cop: bool
If True, time-dependent (dynamic) COPs are used for heat pumps
"""
logger.debug(f"Adding heating capacities installed before {baseyear}")

existing_heating = pd.read_csv(
snakemake.input.existing_heating_distribution, header=[0, 1], index_col=0
)

for name in existing_heating.columns.get_level_values(0).unique():
name_type = "central" if name == "urban central" else "decentral"

Expand All @@ -457,12 +457,11 @@ def add_heating_capacities_installed_before_baseyear(
# Add heat pumps
costs_name = f"decentral {heat_pump_type}-sourced heat pump"

cop = {"air": ashp_cop, "ground": gshp_cop}

if time_dep_hp_cop:
efficiency = cop[heat_pump_type][nodes]
else:
efficiency = costs.at[costs_name, "efficiency"]
efficiency = (
cop[f"{heat_pump_type} {name_type}"][nodes]
if time_dep_hp_cop
else costs.at[costs_name, "efficiency"]
)

too_large_grouping_years = [gy for gy in grouping_years if gy >= int(baseyear)]
if too_large_grouping_years:
Expand Down Expand Up @@ -639,29 +638,43 @@ def add_heating_capacities_installed_before_baseyear(
)

if options["heating"]:
time_dep_hp_cop = options["time_dep_hp_cop"]
ashp_cop = (
xr.open_dataarray(snakemake.input.cop_air_total)
.to_pandas()
.reindex(index=n.snapshots)
)
gshp_cop = (
xr.open_dataarray(snakemake.input.cop_soil_total)
.to_pandas()
.reindex(index=n.snapshots)
)
default_lifetime = snakemake.params.existing_capacities[
"default_heating_lifetime"
]

add_heating_capacities_installed_before_baseyear(
n,
baseyear,
grouping_years_heat,
ashp_cop,
gshp_cop,
time_dep_hp_cop,
costs,
default_lifetime,
n=n,
fneum marked this conversation as resolved.
Show resolved Hide resolved
baseyear=baseyear,
grouping_years=grouping_years_heat,
cop={
"air decentral": xr.open_dataarray(
snakemake.input.cop_air_decentral_heating
)
.to_pandas()
.reindex(index=n.snapshots),
"ground decentral": xr.open_dataarray(
snakemake.input.cop_soil_decentral_heating
)
.to_pandas()
.reindex(index=n.snapshots),
"air central": xr.open_dataarray(
snakemake.input.cop_air_central_heating
)
.to_pandas()
.reindex(index=n.snapshots),
"ground central": xr.open_dataarray(
snakemake.input.cop_soil_central_heating
)
.to_pandas()
.reindex(index=n.snapshots),
},
amos-schledorn marked this conversation as resolved.
Show resolved Hide resolved
time_dep_hp_cop=options["time_dep_hp_cop"],
costs=costs,
default_lifetime=snakemake.params.existing_capacities[
"default_heating_lifetime"
],
existing_heating=pd.read_csv(
snakemake.input.existing_heating_distribution,
header=[0, 1],
index_col=0,
),
)

if options.get("cluster_heat_buses", False):
Expand Down
69 changes: 0 additions & 69 deletions scripts/build_cop_profiles.py

This file was deleted.

Loading
Loading