Skip to content

Commit

Permalink
UCTE importer: ignore coupler with same bus at both ends (#2291)
Browse files Browse the repository at this point in the history
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
  • Loading branch information
annetill authored and miovd committed Sep 19, 2022
1 parent 0b0f852 commit 54d0e1c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,10 @@ private static void createCouplerFromLowImpedanceLine(Network network, UcteLine
if (ucteVoltageLevel1 != ucteVoltageLevel2) {
throw new UcteException("Nodes coupled with a low impedance line are expected to be in the same voltage level");
}
if (nodeCode1.equals(nodeCode2)) {
LOGGER.error("Coupler '{}' has same bus at both ends: ignored", ucteLine.getId());
return;
}
VoltageLevel voltageLevel = network.getVoltageLevel(ucteVoltageLevel1.getName());
Switch couplerSwitch = voltageLevel.getBusBreakerView().newSwitch()
.setEnsureIdUnicity(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,5 +255,12 @@ public void checkPhaseShifterRegulationMode() {
assertEquals(0.0, network.getTwoWindingsTransformer("ZABCD221 ZEFGH221 1").getPhaseTapChanger().getTargetDeadband(), 10E-3);
assertEquals(network.getTwoWindingsTransformer("ZABCD221 ZEFGH221 1").getTerminal1(), network.getTwoWindingsTransformer("ZABCD221 ZEFGH221 1").getPhaseTapChanger().getRegulationTerminal());
}

@Test
public void ignoreCoupler() {
ResourceDataSource dataSource = new ResourceDataSource("ignoreCoupler", new ResourceSet("/", "ignoreCoupler.uct"));
Network network = new UcteImporter().importData(dataSource, new NetworkFactoryImpl(), null);
assertNull(network.getSwitch("BBBBBB11 BBBBBB11 1"));
}
}

15 changes: 15 additions & 0 deletions ucte/ucte-converter/src/test/resources/ignoreCoupler.uct
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
##C 2007.05.01
Generated by powsybl, 2019.09.23 17:47
Case date: 2019.09.24 19:30
##N
##ZBE
BBBBBB11 0 0 3.96708 0.00000 0.00000 0.00000
##ZXX
XXXXXX11 XNODE 1 1 0 3.96708 0.00000 0.00000 0.00000
XXXXXX12 1 0 3.96708 0.00000 0.00000 0.00000
##L
BBBBBB11 XXXXXX11 1 9 0.0000 0.2000 0.000000 5051 ABCDE
BBBBBB11 XXXXXX12 1 1 0.0000 0.2000 0.000000 1000 FGHIJ
BBBBBB11 BBBBBB11 1 7 0.0000 0.0000 0.000000 2000 BABAA
##T
##R

0 comments on commit 54d0e1c

Please sign in to comment.