Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a LoadFlow during IGM merge tests #107

Merged
merged 3 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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