Skip to content

Commit

Permalink
Add a LoadFlow run in IGM merge tests and bump to core 5.3.2 (#107)
Browse files Browse the repository at this point in the history
Signed-off-by: Olivier Perrin <olivier.perrin@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
  • Loading branch information
olperr1 authored Jul 18, 2023
1 parent 5eee8bd commit b46df00
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
17 changes: 12 additions & 5 deletions emf/src/test/java/com/powsybl/emf/IGMmergeTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.powsybl.iidm.network.LineCharacteristics;
import com.powsybl.iidm.network.Network;
import com.powsybl.iidm.network.TieLine;
import com.powsybl.loadflow.LoadFlow;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -84,6 +85,8 @@ void igmsDestructiveMerge() throws IOException {
igmBE.merge(igmNL);
validNetworks.put("Merged", igmBE);

LoadFlow.run(igmBE);

Path destructiveMergeDir = Files.createDirectories(tmpDir.resolve("destructiveMerge"));
exportNetwork(igmBE, destructiveMergeDir, "BE_NL", validNetworks, Set.of("EQ", "TP", "SSH", "SV"));

Expand Down Expand Up @@ -134,6 +137,8 @@ void igmsMergeWithMergingView() throws IOException {
igmNL.getVoltageLevels().forEach(v -> voltageLevelIds.add(v.getId()));
validNetworks.put("Merged", mergingView);

LoadFlow.run(mergingView);

Path mergingViewMergeDir = Files.createDirectories(tmpDir.resolve("mergingViewMerge"));
// export to CGMES only state variable of the merged network, the rest is exported separately for each igms
exportNetwork(mergingView, mergingViewMergeDir, "BE_NL", validNetworks, Set.of("SV"));
Expand All @@ -150,8 +155,8 @@ void igmsMergeWithMergingView() throws IOException {
validate(serializedMergedNetwork, branchIds, generatorsId, voltageLevelIds);

// compare
resetDanglineLinesP0Q0(serializedMergedNetwork);
resetDanglineLinesP0Q0(mergingView);
resetDanglingLinesP0Q0(serializedMergedNetwork);
resetDanglingLinesP0Q0(mergingView);
compareNetwork(serializedMergedNetwork, mergingView);
}

Expand All @@ -168,6 +173,8 @@ void cgmToCgmes() throws IOException {
networkBENL.getGenerators().forEach(g -> generatorsId.add(g.getId()));
networkBENL.getVoltageLevels().forEach(v -> voltageLevelIds.add(v.getId()));

LoadFlow.run(networkBENL);

Path mergedResourcesDir = Files.createDirectories(tmpDir.resolve("mergedResourcesExport"));
exportNetwork(networkBENL, mergedResourcesDir, "BE_NL", Map.of("BENL", networkBENL), Set.of("EQ", "TP", "SSH", "SV"));

Expand Down Expand Up @@ -210,12 +217,12 @@ void compareDestructiveMergeAndMergingView() {

compareNetwork(igmBE2, mergingView);

resetDanglineLinesP0Q0(cgm);
resetDanglineLinesP0Q0(igmBE2);
resetDanglingLinesP0Q0(cgm);
resetDanglingLinesP0Q0(igmBE2);
compareNetwork(cgm, igmBE2);
}

private static void resetDanglineLinesP0Q0(Network network) {
private static void resetDanglingLinesP0Q0(Network network) {
// FIXME(Luma) CGMES Importer: consider keeping p0, q0 also for assembled (CGM) imports
// Adaptations to be able to compare assembled and merged networks
// If a dangling line is paired (is part of a tie line)
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

<properties>
<java.version>11</java.version>
<powsyblcore.version>5.3.0</powsyblcore.version>
<powsyblcore.version>5.3.2</powsyblcore.version>
<powsyblopenloadflow.version>1.2.0</powsyblopenloadflow.version>
<sonar.coverage.jacoco.xmlReportPaths>
../distribution-entsoe/target/site/jacoco-aggregate/jacoco.xml,
Expand Down

0 comments on commit b46df00

Please sign in to comment.