-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support HVDC disconnection in IIDM network
Signed-off-by: VIDAL Didier (Externe) <[email protected]>
- Loading branch information
1 parent
9df1b92
commit c8c3cd2
Showing
4 changed files
with
94 additions
and
4 deletions.
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
36 changes: 36 additions & 0 deletions
36
src/main/java/com/powsybl/openloadflow/util/LfHvdcUtils.java
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.powsybl.openloadflow.util; | ||
|
||
import com.powsybl.iidm.network.Bus; | ||
import com.powsybl.iidm.network.HvdcConverterStation; | ||
import com.powsybl.openloadflow.network.LfNetwork; | ||
|
||
public final class LfHvdcUtils { | ||
|
||
private LfHvdcUtils() { | ||
} | ||
|
||
public static boolean isHvdcDandlingInIdm(HvdcConverterStation<?> station, LfNetwork network) { | ||
|
||
if (isIsolated(station.getTerminal().getBusBreakerView().getBus(), network)) { | ||
return true; | ||
} else { | ||
return station.getOtherConverterStation().map(otherConverterStation -> { | ||
Bus bus = otherConverterStation.getTerminal().getBusView().getBus(); | ||
return isIsolated(bus, network); | ||
}).orElse(true); // it means there is no HVDC line connected to station | ||
} | ||
} | ||
|
||
private static boolean isIsolated(Bus bus, LfNetwork network) { | ||
if (bus == null) { | ||
return true; | ||
} | ||
if (network != null && network.getBusById(bus.getId()) != null) { | ||
// connectivity for that bus to be determined by LfNetwork | ||
return false; | ||
} | ||
// Isolated if only connected to the station | ||
return bus.getConnectedTerminalCount() == 1; | ||
} | ||
|
||
} |
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