Skip to content

Commit

Permalink
create separated test case
Browse files Browse the repository at this point in the history
Signed-off-by: vmouradian <valentin.mouradian@artelys.com>
  • Loading branch information
vmouradian committed Dec 2, 2024
1 parent 88a3876 commit 2b19c0d
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/test/java/com/powsybl/openloadflow/dc/DcLoadFlowTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -184,17 +184,25 @@ 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(16.5316, network.getLine("L1").getTerminal1().getP(), 0.01);
assertEquals(83.4683, network.getLine("L2").getTerminal1().getP(), 0.01); // Temporary comment : P without fix = 133.87
assertEquals(-83.4683, network.getTwoWindingsTransformer("PS1").getTerminal2().getP(), 0.01);
}

Expand Down

0 comments on commit 2b19c0d

Please sign in to comment.