Skip to content

Conversation

daniel-rdt
Copy link
Member

Changes proposed in this Pull Request

This PR proposes a first implementation to create compatibility for the TYNDP H2 topology with myopic foresight optimization. The PR proposes to subtract the optimal H2 grid capacities from previous planning horizons from the the capacities and potentials of the current optimization year.

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.
  • Changes in configuration options are added in config/test/*.yaml.
  • Sources of newly added data are documented in doc/data_sources.rst.
  • A release note doc/release_notes.rst is added.

@daniel-rdt daniel-rdt self-assigned this Jun 16, 2025
@daniel-rdt daniel-rdt marked this pull request as ready for review June 17, 2025 13:35
@daniel-rdt daniel-rdt requested review from tgilon and coroa June 17, 2025 13:36
Copy link
Member

@tgilon tgilon 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 this PR!

While this feature is not strictly necessary, given that the TYNDP data does not provide any information on existing capacity or potential (no p_nom_min or p_nom_max defined), the approach taken is correct in its approach and ensures future compatibility. I assume that the investment candidates in the Investment Datasets/GRID.xlsx file will generate other links. Do you have the same vision?

Also, could you please add a release note before sending it?

For the record, this approach is identical to the one used for offshore hubs (see here).

@@ -110,6 +113,36 @@ def add_brownfield(
for tattr in n.component_attrs[c.name].index[selection]:
n.import_series_from_dataframe(c.pnl[tattr], c.name, tattr)

# adjust TYNDP H2 pipeline expansion by subtracting existing capacity from previous years from current year total capacity and potential
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# adjust TYNDP H2 pipeline expansion by subtracting existing capacity from previous years from current year total capacity and potential
# adjust TYNDP H2 pipeline expansion by subtracting existing capacity
# from previous years from current year total capacity and potential

@@ -51,6 +52,8 @@ def add_brownfield(
Ratio of hydrogen to methane capacity for pipeline retrofitting
capacity_threshold : float
Threshold for removing assets with low capacity
h2_topology_tyndp : bool
Whether to TYNDP H2 topology is used
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Whether to TYNDP H2 topology is used
Whether TYNDP H2 topology is used

Comment on lines +133 to +142
remaining_capacity = (
h2_pipe_capacity
- existing_capacity_p.reindex(index=h2_pipe_capacity.index).fillna(0)
).clip(lower=0)
remaining_potential = (
h2_pipe_potential
- existing_capacity_p.reindex(index=h2_pipe_capacity.index).fillna(0)
).clip(
lower=0
) # this should anyway never be negative. We will still clip to account for rounding errors
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
remaining_capacity = (
h2_pipe_capacity
- existing_capacity_p.reindex(index=h2_pipe_capacity.index).fillna(0)
).clip(lower=0)
remaining_potential = (
h2_pipe_potential
- existing_capacity_p.reindex(index=h2_pipe_capacity.index).fillna(0)
).clip(
lower=0
) # this should anyway never be negative. We will still clip to account for rounding errors
# values should be non-negative; clipping applied to handle rounding errors
remaining_capacity = (
h2_pipe_capacity
- existing_capacity_p.reindex(index=h2_pipe_capacity.index).fillna(0)
).clip(lower=0)
remaining_potential = (
h2_pipe_potential
- existing_capacity_p.reindex(index=h2_pipe_capacity.index).fillna(0)
).clip(
lower=0
)

Comment on lines +118 to +123
h2_pipelines_fixed_i = n.links[
(n.links.carrier == "H2 pipeline") & (n.links.build_year != year)
].index
h2_pipelines = n.links[
(n.links.carrier == "H2 pipeline") & (n.links.build_year == year)
].index
Copy link
Member

Choose a reason for hiding this comment

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

This is probably too restrictive, given that the maximum capacity of the electrolysers is also specified in the Investment Datasets/TRAJECTORY.xlsx file.

@daniel-rdt
Copy link
Member Author

Discussed to put the PR on hold until investment candidates for H2 are added to the model (see #64).

@tgilon tgilon changed the title feature: H2 myopic compatibility feat: H2 myopic compatibility Jul 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants