From d111f7e2a651daf42801a2fe853f0c3dd1a18f01 Mon Sep 17 00:00:00 2001 From: vmouradian Date: Mon, 2 Dec 2024 15:19:09 +0100 Subject: [PATCH] create separated test case Signed-off-by: vmouradian --- .../openloadflow/dc/DcLoadFlowTest.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/dc/DcLoadFlowTest.java b/src/test/java/com/powsybl/openloadflow/dc/DcLoadFlowTest.java index 5d87a2aa03..a573f57929 100644 --- a/src/test/java/com/powsybl/openloadflow/dc/DcLoadFlowTest.java +++ b/src/test/java/com/powsybl/openloadflow/dc/DcLoadFlowTest.java @@ -184,16 +184,24 @@ void phaseShifterTest() { void nonImpedantBranchTest() { Network network = PhaseShifterTestCaseFactory.create(); network.getLine("L2").setX(0).setR(0); - network.getTwoWindingsTransformer("PS1").getPhaseTapChanger().getStep(1).setAlpha(2); parameters.getExtension(OpenLoadFlowParameters.class).setLowImpedanceBranchMode(OpenLoadFlowParameters.LowImpedanceBranchMode.REPLACE_BY_MIN_IMPEDANCE_LINE); loadFlowRunner.run(network, parameters); - assertEquals(83.4683, network.getLine("L2").getTerminal1().getP(), 0.01); - assertEquals(16.5316, network.getLine("L1").getTerminal1().getP(), 0.01); - assertEquals(-83.4683, network.getTwoWindingsTransformer("PS1").getTerminal2().getP(), 0.01); + assertEquals(66.6666, network.getLine("L2").getTerminal1().getP(), 0.01); + assertEquals(33.3333, network.getLine("L1").getTerminal1().getP(), 0.01); parameters.getExtension(OpenLoadFlowParameters.class).setLowImpedanceBranchMode(OpenLoadFlowParameters.LowImpedanceBranchMode.REPLACE_BY_ZERO_IMPEDANCE_LINE); loadFlowRunner.run(network, parameters); - assertEquals(83.4683, network.getLine("L2").getTerminal1().getP(), 0.01); + assertEquals(66.6666, network.getLine("L2").getTerminal1().getP(), 0.01); + assertEquals(33.3333, network.getLine("L1").getTerminal1().getP(), 0.01); + } + + @Test + void nonImpedantBranchAndPhaseShiftingTest() { + Network network = PhaseShifterTestCaseFactory.create(); + network.getLine("L2").setX(0).setR(0); + network.getTwoWindingsTransformer("PS1").getPhaseTapChanger().getStep(1).setAlpha(2); + loadFlowRunner.run(network, parameters); + assertEquals(83.4683, network.getLine("L2").getTerminal1().getP(), 0.01); // Temporary comment : P without fix = 133.87 assertEquals(16.5316, network.getLine("L1").getTerminal1().getP(), 0.01); assertEquals(-83.4683, network.getTwoWindingsTransformer("PS1").getTerminal2().getP(), 0.01); }