Skip to content

Fix DC junctions in simplify_network#2147

Open
bobbyxng wants to merge 12 commits into
masterfrom
fix-simplify-network
Open

Fix DC junctions in simplify_network#2147
bobbyxng wants to merge 12 commits into
masterfrom
fix-simplify-network

Conversation

@bobbyxng
Copy link
Copy Markdown
Collaborator

@bobbyxng bobbyxng commented Apr 13, 2026

Closes open-energy-transition#275
@brynpickering @euronion
Same bug present in PyPSA-Eur upstream

Changes proposed in this Pull Request

  • Fixes overly aggressive DC link simplification in simplify_network (literal edge case example for new UK/Shetland HVDC and multi-terminal setup)
  • Updates supernodes so only true chain nodes (degree 2, also applied to DC) are collapsed. Preserves DC junction buses/multi-terminals (degree 3+) to avoid dropping branches in topologies like Shetland to onshore branching links.

Original base network topology
image

Before fix
remove_stubs: true
image

remove_stubs: false
image

After fix
remove_stubs: true
image

remove_stubs: false
image

Checklist

Required:

  • Changes are tested locally and behave as expected.
  • Code and workflow changes are documented.
  • A release note entry is added to doc/release_notes.rst.

@bobbyxng
Copy link
Copy Markdown
Collaborator Author

Clustered example 50 nodes with fix
image

@bobbyxng
Copy link
Copy Markdown
Collaborator Author

I had to add a new key, named it allow_ac_dc_mix for now to make this decision transparent/user configurable. Specifically, now that more DC buses "survive", it can happen that AC and DC buses in the same region (depending on clustering mode) are to be clustered. The question is, do you keep them separate (maintaining individual bus carriers) or allow DC buses to be clustered with AC buses (in this case all bus carriers become AC).

  • "Visually" this looks the same, however, the underlying subnetworks and topology, number of lines and links change.
  • For example, using config/test/config.clusters.yaml (administrative clustering)
    • allow_ac_dc_mix: false → 54 buses, 10 subnetworks (AC and DC kept separate)
    • allow_ac_dc_mix: true → 52 buses, 8 subnetworks (mixed clusters coerced to AC)

Open question, what to set as default. I believe the closest to replicate old behaviour is to allow mixing of AC and DC, but the technically more correct way would be to set allow_ac_dc_mix: false, as you also could have congestion between the AC and DC buses. Any thoughts? @fneum @brynpickering, maybe @martacki (given your clustering expertise :))

Comment thread scripts/cluster_network.py Outdated
Comment thread scripts/cluster_network.py Outdated
Comment thread scripts/cluster_network.py Outdated
@fneum
Copy link
Copy Markdown
Member

fneum commented May 4, 2026

I would suggest allow_ac_dc_mix: false as default, since mixing could be heavy simplification of network topology. Don't mind the extra buses.

Not sure the name is expressive enough though. Just looking at the name, one could assume separate synchronous zones (like Balearic Islands, DK etc.) can be clustered / simplified.

Comment on lines -418 to -422
# TODO Quick Fix for osm-prebuilt-version 0.6
for way_i in ["way/140248154", "way/975637991"]:
if way_i in n.buses.index:
n.buses.loc[way_i, "carrier"] = "AC"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@FabianHofmann Can you double-check that this indeed can be removed? I don't see the need to keep this anymore after the changes in this PR

@bobbyxng
Copy link
Copy Markdown
Collaborator Author

Thanks both @brynpickering and @fneum, I think I addressed all your comments. Regarding the config term, how about allow_ac_dc_mixing_in_bus_clusters? This should be more explicit.
Also, I removed an old hotfix in cluster_network, maybe @FabianHofmann can confirm that it is indeed okay to remove the hotfix.

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.

Busmap linking distant substations

3 participants