Skip to content

Commit

Permalink
Test to demonstrate contingency propagation issue
Browse files Browse the repository at this point in the history
Signed-off-by: Sylvain Leclerc <sylvain.leclerc@rte-france.com>
  • Loading branch information
sylvlecl committed Jul 12, 2021
1 parent 3c2fef7 commit 42a1146
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,14 @@ public static Network create() {
.setId("BBS2")
.setNode(1)
.add();
vl1.getNodeBreakerView().newDisconnector()
.setId("D")
.setNode1(0)
.setNode2(6)
.add();
vl1.getNodeBreakerView().newBreaker()
.setId("C")
.setNode1(0)
.setNode1(6)
.setNode2(1)
.add();
vl1.getNodeBreakerView().newBreaker()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,18 @@

import com.powsybl.commons.PowsyblException;
import com.powsybl.computation.local.LocalComputationManager;
import com.powsybl.contingency.Contingency;
import com.powsybl.contingency.ContingencyContext;
import com.powsybl.contingency.DanglingLineContingency;
import com.powsybl.contingency.LineContingency;
import com.powsybl.contingency.*;
import com.powsybl.iidm.network.*;
import com.powsybl.iidm.network.test.EurostagTutorialExample1Factory;
import com.powsybl.iidm.network.test.PhaseShifterTestCaseFactory;
import com.powsybl.loadflow.LoadFlowParameters;
import com.powsybl.openloadflow.network.DanglingLineFactory;
import com.powsybl.openloadflow.network.FourBusNetworkFactory;
import com.powsybl.openloadflow.network.HvdcNetworkFactory;
import com.powsybl.openloadflow.network.NodeBreakerNetworkFactory;
import com.powsybl.openloadflow.sensi.*;
import com.powsybl.openloadflow.util.LoadFlowAssert;
import com.powsybl.openloadflow.util.PropagatedContingency;
import com.powsybl.sensitivity.SensitivityAnalysisParameters;
import com.powsybl.sensitivity.SensitivityAnalysisResult;
import com.powsybl.sensitivity.SensitivityFactor;
Expand Down Expand Up @@ -775,4 +774,15 @@ void testDanglingLineSensi() {
result = sensiProvider.run(network, Collections.emptyList(), Collections.emptyList(), sensiParameters, factors);
assertEquals(0d, result.getValue(null, "l1", "dl1").getValue(), LoadFlowAssert.DELTA_POWER);
}

@Test
void testContingencyOnOpenLine() {
Network network = NodeBreakerNetworkFactory.create();
List<Contingency> contingencies = List.of(
new Contingency("c1", new BranchContingency("L1"))
);

//throws
PropagatedContingency.createListForSensitivityAnalysis(network, contingencies);
}
}

0 comments on commit 42a1146

Please sign in to comment.