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

Fix myopic optimization for networks with geothermal district heating #1453

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cpschau
Copy link
Contributor

@cpschau cpschau commented Dec 12, 2024

Changes proposed in this Pull Request

Geothermal heat for district heating was implemented in #1359. However, it was not working for the myopic code. This PR includes two changes, that fix the issue:

  1. The dataframe containing the existing heating distribution was extended to include all provided district heating heat pump sources in build_existing_heating_distribution.
  2. The indices of the heat pumps built in the predecessing planning horizon (relative to the planning horizon to be optimized) were adjusted for the COP correction in add_brownfield. This adjustment had to be done, because some heat pumps initialized in prepare_sector_network potentially disappear from their links_t dataframe if their efficiency equals zero (e.g. in Denmark where geothermal source temperatures can exceed district heating supply temperatures). This correction is done to account for the supply temperature dynamics in district heating and should be further adjusted as described in District heating efficiency gains applied to decentral heat pumps #1451 to depict efficiency gains for heat pumps due to technological learning.

Checklist

  • I tested my contribution locally and it works as intended.
  • Code and workflow changes are sufficiently documented.
  • Changed dependencies are added to envs/environment.yaml.
  • Changes in configuration options are added in config/config.default.yaml.
  • Changes in configuration options are documented in doc/configtables/*.csv.
  • Sources of newly added data are documented in doc/data_sources.rst.
  • A release note doc/release_notes.rst is added.

Copy link
Contributor

github-actions bot commented Dec 12, 2024

Validator Report

I am the Validator. Download all artifacts here.
I'll be back and edit this comment for each new commit.

❗ Run failed!

Download 'logs' artifact to see more details.

  • master failed in: make_summary
  • fix_geothermal_myopic failed in: make_summary

Model Metrics

Benchmarks Image not available Image not available Image not available

Comparing fix_geothermal_myopic (75f3c1e) with master (c7c664d).
Branch is 1 commits ahead and 0 commits behind.
Last updated on 2024-12-12 18:39:23 CET.

Copy link
Contributor

@amos-schledorn amos-schledorn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for spotting this! Just had minor comments.
Also, could you update the release notes and show a quick before/after comparison of COPs to make sure everything is working as expected? (e.g. a cooked-down version of the last plot in this PR: #1290 )

@@ -244,6 +244,7 @@ def update_heat_pump_efficiency(n: pypsa.Network, n_p: pypsa.Network, year: int)
# get names of heat pumps in previous iteration
heat_pump_idx_previous_iteration = n_p.links.index[
n_p.links.index.str.contains("heat pump")
& n_p.links.index.str[:-4].isin(n.links_t.efficiency.columns.str[:-4])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I would need an additional comment here to follow here :)

for heat_pump_source in snakemake.params.sector["heat_pump_sources"][
"urban central"
]:
nodal_heat_name_tech[("urban central", f"{heat_pump_source} heat pump")] = 0.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you have the time: could you add a comment or two to the function and convert the function header to a docstring?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants