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

Feature jg #6

Merged
merged 40 commits into from
Feb 9, 2024
Merged

Feature jg #6

merged 40 commits into from
Feb 9, 2024

Conversation

JulianGeis
Copy link
Contributor

@JulianGeis JulianGeis commented Jan 17, 2024

The "Wasserstoff Kernnetz" is a starting network for hydrogen transport proposed by the Vereinigung der Fernleitungsnetzbetreiber Gas e.V. -> https://fnb-gas.de/wasserstoffnetz-wasserstoff-kernnetz/
It is supposed to be build up until 2032, starting in 2025. To adapt the scenarios on the newly planned infrastructure, this feature implements the kernnetz.

Summary:

  • added functionality to include the wasserstoff kernnetz based on the functionality for the gas network
  • options are added to config
  • scripts to add build and to cluster the kernnetz are included
  • locations for the kernnetz are included
  • local testing worked fine

Map of the FNB Gas e.V:
image

Kernnetz after build_kernnetz.py:
image

Kernnetz with 22 model regions after clustering:
image

Kernnetz after integration in pypsa-ariadne with currently 22 clusters:
image
image

Code used to reproduce the plots:

import pypsa 
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
import pandas as pd

n = pypsa.Network(path)
n.links.bus0 = n.links.bus0.str[:-3]
n.links.bus1 = n.links.bus1.str[:-3]

n.links[(n.links.carrier == "H2 pipeline") & (n.links.p_nom_min > 0)][["bus0", "bus1","p_nom_min"]]

fig, ax = plt.subplots(1, 1, figsize=(20,20), subplot_kw={"projection":ccrs.PlateCarree()})
n.links = n.links[n.links.carrier == "H2 pipeline"]

n.plot(ax=ax, line_widths=0, link_widths=n.links.p_nom_min/(n.links.p_nom_min+0.01)) 

@JulianGeis JulianGeis requested a review from fneum January 17, 2024 10:55
@JulianGeis JulianGeis marked this pull request as draft January 17, 2024 11:26
@JulianGeis JulianGeis self-assigned this Jan 17, 2024
@JulianGeis JulianGeis marked this pull request as ready for review January 17, 2024 17:13
@fneum
Copy link
Member

fneum commented Jan 22, 2024

@JulianGeis, we can worry about the merge conflicts after you've had a look at the code review.

JulianGeis and others added 9 commits January 22, 2024 16:21
removed the clipping and set the default build_year to 2032
The constraint in additional_functionality.py was incredibly
unperformant, raising presolving time by 4 hours.

Now the restriction is applied before solving with:

n.links_t.p_max_pu = p_min_pu = load_profile_pu

for new boilers.
Boiler bug: The forced p_min/max_pu profiles for new boilers were
being carried forward to future years by add_brownfield.py and
interfering with the separate constraint for existing boiler profiles
in additional_functionality.py (that allows a profile
downscaling). This created infeasibilities.

Retrofitting bug: The exogeneous space heating reduction in
config.yaml was under "industry" instead of "sector" so not being
taken over at all.
Copy link
Member

@fneum fneum left a comment

Choose a reason for hiding this comment

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

@JulianGeis, have a look at my changes in ef5afa0.

Looks good! I have checked the main mechanisms, and I think this can be merged now.

Here's what I changed:

  • I removed some accidental code additions.
  • The function reduce_capacity is now vectorized. You generally want to avoid iterating over rows of a dataframe with .iterrows() as this can lead to performance regressions.
  • The lossy_bidirectional_links() function can get a subset to avoid duplicate links in pathway optimisation
  • some small-ish code simplifications, in particular in the block fixing the capacities for investment years before 2030 :)
  • added mock_snakemake()
  • removed most function inceptions, i.e. function definitions inside functions
  • added color for Wasserstoffkernnetz for plotting

config/config.yaml Outdated Show resolved Hide resolved
@fneum fneum merged commit 59aba91 into master Feb 9, 2024
@lindnemi lindnemi deleted the feature_jg branch June 10, 2024 12:16
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.

3 participants