-
Notifications
You must be signed in to change notification settings - Fork 0
Disconnect energized equipment #446
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
Open
Lisrte
wants to merge
9
commits into
main
Choose a base branch
from
disconnect_energized_equipment
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
945c042
Fix duplicated keys
Lisrte 69c82bd
Rename reports keys
Lisrte 558ed54
Use resource bundle
Lisrte e5e9211
Use test resource bundle
Lisrte 85cf763
Use test resource bundle
Lisrte 93add9c
Review fix
Lisrte c5d1df2
Merge branch 'main' into disconnect_energized_equipment
Lisrte a22713b
Fix checkstyle
Lisrte c2c0c5d
Remove all reports_en_US.properties
Lisrte 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
58 changes: 58 additions & 0 deletions
58
dynawo-simulation/src/main/java/com/powsybl/dynawo/models/utils/EnergizedUtils.java
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/** | ||
* Copyright (c) 2025, RTE (http://www.rte-france.com) | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
* SPDX-License-Identifier: MPL-2.0 | ||
*/ | ||
package com.powsybl.dynawo.models.utils; | ||
|
||
import com.powsybl.iidm.network.*; | ||
|
||
/** | ||
* Verifies na equipment terminal(s) are connected and the relates buses are energized and in main connected component | ||
* @author Laurent Issertial {@literal <laurent.issertial at rte-france.com>} | ||
*/ | ||
public final class EnergizedUtils { | ||
|
||
private EnergizedUtils() { | ||
} | ||
|
||
public static boolean isEnergized(Injection<?> equipment) { | ||
return isEnergized(equipment.getTerminal()); | ||
} | ||
|
||
public static boolean isEnergized(Branch<?> equipment) { | ||
return isEnergized(equipment.getTerminal1()) && isEnergized(equipment.getTerminal2()); | ||
} | ||
|
||
public static boolean isEnergized(Branch<?> equipment, TwoSides side) { | ||
return TwoSides.ONE == side ? isEnergized(equipment.getTerminal1()) : isEnergized(equipment.getTerminal2()); | ||
} | ||
|
||
public static boolean isEnergized(HvdcLine equipment) { | ||
return isEnergized(equipment.getConverterStation1().getTerminal()) | ||
&& isEnergized(equipment.getConverterStation1().getTerminal()); | ||
} | ||
|
||
public static boolean isEnergized(HvdcLine equipment, TwoSides side) { | ||
return TwoSides.ONE == side ? isEnergized(equipment.getConverterStation1().getTerminal()) | ||
: isEnergized(equipment.getConverterStation2().getTerminal()); | ||
} | ||
|
||
public static boolean isEnergized(Terminal terminal) { | ||
if (!terminal.isConnected()) { | ||
return false; | ||
} | ||
return isEnergized(terminal.getBusBreakerView().getBus()); | ||
} | ||
|
||
/** | ||
* Verifies a bus is energized and in main connected component | ||
* @param bus the reviewed bus | ||
* @return <code>true</code> if energized, <code>false</code> if not | ||
*/ | ||
public static boolean isEnergized(Bus bus) { | ||
return bus != null && !Double.isNaN(bus.getV()) && bus.isInMainConnectedComponent(); | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
dynawo-simulation/src/test/java/com/powsybl/dynawo/LfResultsUtils.java
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/** | ||
* Copyright (c) 2025, RTE (http://www.rte-france.com) | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
* SPDX-License-Identifier: MPL-2.0 | ||
*/ | ||
package com.powsybl.dynawo; | ||
|
||
import com.powsybl.iidm.network.Network; | ||
import com.powsybl.iidm.network.test.HvdcTestNetwork; | ||
import com.powsybl.iidm.network.test.SvcTestCaseFactory; | ||
|
||
/** | ||
* @author Laurent Issertial {@literal <laurent.issertial at rte-france.com>} | ||
*/ | ||
public final class LfResultsUtils { | ||
|
||
private LfResultsUtils() { | ||
} | ||
|
||
public static Network createSvcTestCaseWithLFResults() { | ||
Network network = SvcTestCaseFactory.create(); | ||
network.getBusBreakerView().getBuses().forEach(b -> b.setV(400).setAngle(0)); | ||
return network; | ||
} | ||
|
||
public static Network createHvdcTestNetworkVscWithLFResults() { | ||
Network network = HvdcTestNetwork.createVsc(); | ||
network.getBusBreakerView().getBus("B1").setV(400).setAngle(0); | ||
network.getVoltageLevel("VL2").getBusView().getBuses().forEach(b -> b.setV(400).setAngle(0)); | ||
return network; | ||
} | ||
} |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.