-
Notifications
You must be signed in to change notification settings - Fork 8
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 flow computation of HVDC connected at only one side #965
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
68fa131
Proposal to handle lost of a VSC converter station (ac emulation or n…
annetill 01e3fa7
Fix dc sensi. Bus contingency still missing...
annetill 9df1b92
Clean after sonar analysis.
annetill b5e099e
Merge branch 'main' into rework-hvdc
geofjamg 79db2b4
Fix
geofjamg 9b7b84d
Clean comment.
annetill 10d1976
Refactoring.
annetill 78dcfe7
Support HVDC disconnection in IIDM network
vidaldid-rte 365e5e4
PR review + typos
vidaldid-rte 0a25a81
Merge branch 'main' into hvdc-loss-in-N
vidaldid-rte 99df3ae
fix typo
vidaldid-rte 063e0b7
backport test from PR 957
vidaldid-rte d4f86f5
adapt test to factory (in the factory thehvdc pushes power to the gen…
vidaldid-rte 0c1a72b
Fix N state restoration.
annetill 6cbcd3e
Align isolated bus in IIDM with Networks.isIsolatedBusForHvdc and mod…
vidaldid-rte 8b43547
Merge branch 'main' into hvdc-loss-in-N
vidaldid-rte 78a8497
Add a unit test and fix code smells.
annetill b74239b
Merge branch 'hvdc-loss-in-N' of https://github.com/powsybl/powsybl-o…
annetill dca7925
Add unit test.
annetill 1ad88db
Merge branch 'main' into hvdc-loss-in-N
annetill 1875d34
Move utility method.
annetill d930f03
Fix unit test (1).
annetill e598e51
Clean unit test (2).
annetill d9193e4
Merge branch 'main' into hvdc-loss-in-N
annetill File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
import com.powsybl.commons.PowsyblException; | ||
import com.powsybl.commons.reporter.Reporter; | ||
import com.powsybl.iidm.network.*; | ||
import com.powsybl.openloadflow.graph.GraphConnectivity; | ||
import com.powsybl.openloadflow.network.*; | ||
import com.powsybl.openloadflow.network.impl.extensions.OverloadManagementSystem; | ||
import com.powsybl.openloadflow.network.impl.extensions.SubstationAutomationSystems; | ||
|
@@ -149,6 +150,13 @@ private static void restoreInitialTopology(LfNetwork network, Set<Switch> allSwi | |
bus.getBranches().stream().filter(b -> !b.isConnectedAtBothSides()).forEach(removedBranches::add); | ||
} | ||
removedBranches.forEach(branch -> branch.setDisabled(true)); | ||
for (LfHvdc hvdc : network.getHvdcs()) { | ||
if (isIsolatedBusForHvdc(hvdc.getBus1(), connectivity) || isIsolatedBusForHvdc(hvdc.getBus2(), connectivity)) { | ||
hvdc.setDisabled(true); | ||
hvdc.getConverterStation1().setTargetP(0.0); | ||
hvdc.getConverterStation2().setTargetP(0.0); | ||
} | ||
} | ||
} | ||
|
||
private static void addSwitchesOperatedByAutomationSystem(Network network, LfTopoConfig topoConfig, OverloadManagementSystem system) { | ||
|
@@ -230,6 +238,20 @@ public static Bus getBus(Terminal terminal, boolean breakers) { | |
: terminal.getBusView().getBus(); | ||
} | ||
|
||
public static boolean isIsolatedBusForHvdc(LfBus bus, GraphConnectivity<LfBus, LfBranch> connectivity) { | ||
// used only for hvdc lines. | ||
// this criteria can be improved later depending on use case | ||
return connectivity.getConnectedComponent(bus).size() == 1 && bus.getLoadTargetP() == 0.0 | ||
&& bus.getGenerators().stream().noneMatch(LfGeneratorImpl.class::isInstance); | ||
} | ||
Comment on lines
+241
to
+246
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no SA test covering this |
||
|
||
public static boolean isIsolatedBusForHvdc(LfBus bus, Set<LfBus> disabledBuses) { | ||
// used only for hvdc lines for DC sensitivity analysis where we don't have the connectivity. | ||
// this criteria can be improved later depending on use case | ||
return disabledBuses.contains(bus) && bus.getLoadTargetP() == 0.0 | ||
&& bus.getGenerators().stream().noneMatch(LfGeneratorImpl.class::isInstance); | ||
} | ||
|
||
public static Optional<Terminal> getEquipmentRegulatingTerminal(Network network, String equipmentId) { | ||
Generator generator = network.getGenerator(equipmentId); | ||
if (generator != null) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because of that, we end the calculation with NaN as p for the converter station for LCC only. @jeandemanged I don't like it very much...