Skip to content

Commit

Permalink
Bump to dynawo 1.6.0
Browse files Browse the repository at this point in the history
Update models.json with renaming HvdcVSC models to HvdcVsc
Add VarsMapping to Bus, InfiniteBus, StandardLine, TransformerFixedRatio
Bump to java-dynawo-docker 2.2.0 in integration tests
Add various new parameters to par files

Signed-off-by: lisrte <[email protected]>
  • Loading branch information
flo-dup committed Oct 9, 2024
1 parent 6a894bc commit dd3b2aa
Show file tree
Hide file tree
Showing 34 changed files with 273 additions and 105 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ private static Stream<Arguments> provideEquipmentModelData() {
return Stream.of(
Arguments.of("/dynamicModels/bus.groovy", StandardBus.class, EurostagTutorialExample1Factory.create(), "NGEN", "BBM_NGEN", "SB", "Bus"),
Arguments.of("/dynamicModels/hvdcP.groovy", BaseHvdc.class, HvdcTestNetwork.createVsc(), "L", "BBM_HVDC_L", "HVDC", "HvdcPV"),
Arguments.of("/dynamicModels/hvdcVsc.groovy", BaseHvdc.class, HvdcTestNetwork.createVsc(), "L", "BBM_HVDC_L", "HVDC", "HvdcVSC"),
Arguments.of("/dynamicModels/hvdcVsc.groovy", BaseHvdc.class, HvdcTestNetwork.createVsc(), "L", "BBM_HVDC_L", "HVDC", "HvdcVsc"),
Arguments.of("/dynamicModels/hvdcPDangling.groovy", HvdcDangling.class, HvdcTestNetwork.createVsc(), "L", "BBM_HVDC_L", "HVDC", "HvdcPVDanglingDiagramPQ"),
Arguments.of("/dynamicModels/hvdcVscDangling.groovy", HvdcDangling.class, HvdcTestNetwork.createVsc(), "L", "BBM_HVDC_L", "HVDC", "HvdcVSCDanglingUdc"),
Arguments.of("/dynamicModels/hvdcVscDangling.groovy", HvdcDangling.class, HvdcTestNetwork.createVsc(), "L", "BBM_HVDC_L", "HVDC", "HvdcVscDanglingUdc"),
Arguments.of("/dynamicModels/loadAB.groovy", BaseLoad.class, EurostagTutorialExample1Factory.create(), "LOAD", "LOAD", "LAB", "LoadAlphaBetaRestorative"),
Arguments.of("/dynamicModels/loadABControllable.groovy", BaseLoadControllable.class, EurostagTutorialExample1Factory.create(), "LOAD", "LOAD", "LAB", "LoadAlphaBeta"),
Arguments.of("/dynamicModels/loadTransformer.groovy", LoadOneTransformer.class, EurostagTutorialExample1Factory.create(), "LOAD", "LOAD", "LOT", "LoadOneTransformer"),
Expand Down Expand Up @@ -289,7 +289,7 @@ private static Stream<Arguments> provideWarningsModel() {
"""
+ DSL tests
+ Groovy Dynamic Models Supplier
+ DSL model builder for HvdcVSC
+ DSL model builder for HvdcVsc
'staticId' field value 'L' not found for equipment type(s) VSC HVDC_LINE
Model BBM_HVDC cannot be instantiated
""")
Expand Down
2 changes: 1 addition & 1 deletion dynawo-dsl/src/test/resources/dynamicModels/hvdcVsc.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

package dynamicModels

HvdcVSC {
HvdcVsc {
staticId "L"
dynamicModelId "BBM_HVDC_L"
parameterSetId "HVDC"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ package dynamicModels

import com.powsybl.iidm.network.TwoSides

HvdcVSCDanglingUdc {
HvdcVscDanglingUdc {
staticId "L"
dynamicModelId "BBM_HVDC_L"
parameterSetId "HVDC"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
package warnings


HvdcVSC {
HvdcVsc {
dynamicModelId "BBM_HVDC"
parameterSetId "hvdc"
staticId "L"
Expand Down
5 changes: 5 additions & 0 deletions dynawo-integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/
public abstract class AbstractDynawoTest {

private static final String DOCKER_IMAGE_ID = "powsybl/java-dynawo:2.1.0";
private static final String DOCKER_IMAGE_ID = "powsybl/java-dynawo:2.2.0";

@TempDir
Path localDir;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

import static com.powsybl.commons.report.ReportNode.NO_OP;
import static com.powsybl.commons.report.ReportNode.newRootReportNode;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.*;

/**
Expand Down Expand Up @@ -72,12 +73,12 @@ void testIeee14() {
assertEquals(27, result.getCurves().size());
DoubleTimeSeries ts1 = result.getCurve("_GEN____1_SM_generator_UStatorPu");
assertEquals("_GEN____1_SM_generator_UStatorPu", ts1.getMetadata().getName());
assertEquals(587, ts1.toArray().length);
assertEquals(585, ts1.toArray().length);
assertEquals(14, result.getFinalStateValues().size());
assertEquals(1.046227, result.getFinalStateValues().get("NETWORK__BUS___10_TN_Upu_value"));
List<TimelineEvent> timeLine = result.getTimeLine();
assertEquals(23, timeLine.size());
checkFirstTimeLineEvent(timeLine.get(0), 0, "_GEN____8_SM", "PMIN : activation");
checkTimeLineEvent(timeLine.get(0), 0, "_GEN____8_SM", "PMIN : activation");
}

@Test
Expand Down Expand Up @@ -145,7 +146,7 @@ void testSvarc() {
assertTrue(result.getCurves().isEmpty());
List<TimelineEvent> timeLine = result.getTimeLine();
assertEquals(1, timeLine.size());
checkFirstTimeLineEvent(timeLine.get(0), 0, "G1", "PMIN : activation");
checkTimeLineEvent(timeLine.get(0), 0, "G1", "PMIN : activation");
}

@Test
Expand Down Expand Up @@ -175,7 +176,7 @@ void testHvdc() {
assertTrue(result.getCurves().isEmpty());
List<TimelineEvent> timeLine = result.getTimeLine();
assertEquals(7, timeLine.size());
checkFirstTimeLineEvent(timeLine.get(0), 30.0, "_BUS____5-BUS____6-1_PS", "Tap +1");
checkTimeLineEvent(timeLine.get(0), 30.0, "_BUS____5-BUS____6-1_PS", "Tap +1");
}

@Test
Expand Down Expand Up @@ -237,9 +238,9 @@ void testSimulationError() {
.join();

assertEquals(DynamicSimulationResult.Status.FAILURE, result.getStatus());
assertEquals("time step <= 0.1 s for more than 10 iterations ( DYNSolverCommonFixedTimeStep.cpp:419 )", result.getStatusText());
assertTrue(result.getTimeLine().isEmpty());
assertTrue(result.getCurves().isEmpty());
assertThat(result.getStatusText()).contains("time step <= 0.1 s for more than 10 iterations");
assertThat(result.getTimeLine()).isEmpty();
assertThat(result.getCurves()).isEmpty();
}

@Test
Expand Down Expand Up @@ -267,10 +268,10 @@ void testIeee14DynawoSuppliers() {
assertEquals(0, result.getCurves().size());
List<TimelineEvent> timeLine = result.getTimeLine();
assertEquals(11, timeLine.size());
checkFirstTimeLineEvent(timeLine.get(0), 0, "_GEN____8_SM", "PMIN : activation");
checkTimeLineEvent(timeLine.get(0), 0, "_GEN____8_SM", "PMIN : activation");
}

private void checkFirstTimeLineEvent(TimelineEvent event, double time, String modelName, String message) {
private void checkTimeLineEvent(TimelineEvent event, double time, String modelName, String message) {
assertEquals(time, event.time());
assertEquals(modelName, event.modelName());
assertEquals(message, event.message());
Expand Down Expand Up @@ -299,11 +300,11 @@ void testIEEE14SignalN() {
.join();

assertEquals(DynamicSimulationResult.Status.SUCCESS, result.getStatus());
assertTrue(result.getStatusText().isEmpty());
assertEquals(0, result.getCurves().size());
assertThat(result.getStatusText()).isEmpty();
assertThat(result.getCurves()).isEmpty();
List<TimelineEvent> timeLine = result.getTimeLine();
assertEquals(1, timeLine.size());
checkFirstTimeLineEvent(timeLine.get(0), 10, "_BUS____1-BUS____5-1_AC", "LINE : opening on side 2");
assertThat(timeLine).hasSize(13);
checkTimeLineEvent(timeLine.get(12), 10, "_BUS____1-BUS____5-1_AC", "LINE : opening on side 2");
}

private Supplier<DynamicSimulationResult> setupIEEE14Simulation() {
Expand Down
8 changes: 8 additions & 0 deletions dynawo-integration-tests/src/test/resources/hvdc/models.par
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@
<reference type="DOUBLE" name="load_UPhase0" origData="IIDM" origName="angle_pu"/>
</set>
<set id="4">
<par type="DOUBLE" name="hvdc_Q1Nom" value="400"/>
<par type="DOUBLE" name="hvdc_Q2Nom" value="400"/>
<par type="DOUBLE" name="hvdc_Lambda1Pu" value="0"/>
<par type="DOUBLE" name="hvdc_Lambda2Pu" value="0"/>
<reference type="DOUBLE" name="hvdc_P20Pu" origData="IIDM" origName="p2_pu"/>
<reference type="DOUBLE" name="hvdc_Q20Pu" origData="IIDM" origName="q2_pu"/>
<reference type="DOUBLE" name="hvdc_U20Pu" origData="IIDM" origName="v2_pu"/>
Expand All @@ -88,6 +92,10 @@
<par type="DOUBLE" name="acemulation_PRefSet0Pu" value="0"/>
</set>
<set id="5">
<par type="DOUBLE" name="hvdc_Q1Nom" value="400"/>
<par type="DOUBLE" name="hvdc_Q2Nom" value="400"/>
<par type="DOUBLE" name="hvdc_Lambda1Pu" value="0"/>
<par type="DOUBLE" name="hvdc_Lambda2Pu" value="0"/>
<reference type="DOUBLE" name="hvdc_P20Pu" origData="IIDM" origName="p2_pu"/>
<reference type="DOUBLE" name="hvdc_Q20Pu" origData="IIDM" origName="q2_pu"/>
<reference type="DOUBLE" name="hvdc_U20Pu" origData="IIDM" origName="v2_pu"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,55 +174,55 @@
"limitName" : "UInfUmin",
"limit" : 66.92999999999999,
"limitReduction" : 1.0,
"value" : 66.04302591364225
"value" : 66.04302591577434
}, {
"subjectId" : "_BUS____4_VL",
"subjectName" : "BUS 4_VL",
"limitType" : "LOW_VOLTAGE",
"limitName" : "UInfUmin",
"limit" : 66.92999999999999,
"limitReduction" : 1.0,
"value" : 65.72762039108571
"value" : 65.72762039320641
}, {
"subjectId" : "_BUS____5_VL",
"subjectName" : "BUS 5_VL",
"limitType" : "LOW_VOLTAGE",
"limitName" : "UInfUmin",
"limit" : 66.92999999999999,
"limitReduction" : 1.0,
"value" : 65.52250008634476
"value" : 65.52250008834531
}, {
"subjectId" : "_BUS___14_VL",
"subjectName" : "BUS 14_VL",
"limitType" : "LOW_VOLTAGE",
"limitName" : "UInfUmin",
"limit" : 13.386000000000001,
"limitReduction" : 1.0,
"value" : 13.348620218077935
"value" : 13.348620218406515
}, {
"subjectId" : "_BUS____2_VL",
"subjectName" : "BUS 2_VL",
"limitType" : "LOW_VOLTAGE",
"limitName" : "UInfUmin",
"limit" : 66.92999999999999,
"limitReduction" : 1.0,
"value" : 66.79275331121715
"value" : 66.79275331228723
}, {
"subjectId" : "_BUS___10_VL",
"subjectName" : "BUS 10_VL",
"limitType" : "LOW_VOLTAGE",
"limitName" : "UInfUmin",
"limit" : 13.386000000000001,
"limitReduction" : 1.0,
"value" : 13.3776580871495
"value" : 13.377658087264606
}, {
"subjectId" : "_BUS____9_VL",
"subjectName" : "BUS 9_VL",
"limitType" : "LOW_VOLTAGE",
"limitName" : "UInfUmin",
"limit" : 13.386000000000001,
"limitReduction" : 1.0,
"value" : 13.38439596457008
"value" : 13.384395964628164
} ],
"actionsTaken" : [ ]
},
Expand Down Expand Up @@ -299,15 +299,15 @@
"limitName" : "UInfUmin",
"limit" : 66.92999999999999,
"limitReduction" : 1.0,
"value" : 66.39712313695317
"value" : 66.39712316522031
}, {
"subjectId" : "_BUS____4-BUS____5-1_AC",
"subjectName" : "BUS 4-BUS 5-1",
"limitType" : "CURRENT",
"limitName" : "PATL",
"limit" : 836.74,
"limitReduction" : 1.0,
"value" : 843.5741007221512,
"value" : 843.5741006594511,
"side" : "ONE"
}, {
"subjectId" : "_BUS____3-BUS____4-1_AC",
Expand All @@ -316,7 +316,7 @@
"limitName" : "PATL",
"limit" : 836.74,
"limitReduction" : 1.0,
"value" : 839.9381833149292,
"value" : 839.9381832777893,
"side" : "ONE"
} ],
"actionsTaken" : [ ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,37 +29,37 @@
"limitName" : "UInfUmin",
"limit" : 220.0,
"limitReduction" : 1.0,
"value" : 217.0313224616946
"value" : 217.0313224616953
}, {
"subjectId" : "S1VL2_BBS1",
"subjectName" : "S1VL2_BBS1",
"limitType" : "LOW_VOLTAGE",
"limitName" : "UInfUmin",
"limit" : 390.0,
"limitReduction" : 1.0,
"value" : 386.2578552204803
"value" : 386.2578552204816
}, {
"subjectId" : "S1VL2_BBS2",
"subjectName" : "S1VL2_BBS2",
"limitType" : "LOW_VOLTAGE",
"limitName" : "UInfUmin",
"limit" : 390.0,
"limitReduction" : 1.0,
"value" : 386.2578552204803
"value" : 386.2578552204816
}, {
"subjectId" : "S1VL1",
"limitType" : "LOW_VOLTAGE",
"limitName" : "UInfUmin",
"limit" : 220.0,
"limitReduction" : 1.0,
"value" : 217.0313224616946
"value" : 217.0313224616953
}, {
"subjectId" : "S1VL2",
"limitType" : "LOW_VOLTAGE",
"limitName" : "UInfUmin",
"limit" : 390.0,
"limitReduction" : 1.0,
"value" : 386.2578552204803
"value" : 386.2578552204816
} ],
"actionsTaken" : [ ]
},
Expand Down Expand Up @@ -117,37 +117,37 @@
"limitName" : "UInfUmin",
"limit" : 220.0,
"limitReduction" : 1.0,
"value" : 217.8628453608945
"value" : 217.86284536089713
}, {
"subjectId" : "S1VL2_BBS1",
"subjectName" : "S1VL2_BBS1",
"limitType" : "LOW_VOLTAGE",
"limitName" : "UInfUmin",
"limit" : 390.0,
"limitReduction" : 1.0,
"value" : 387.7355973484713
"value" : 387.735597348476
}, {
"subjectId" : "S1VL2_BBS2",
"subjectName" : "S1VL2_BBS2",
"limitType" : "LOW_VOLTAGE",
"limitName" : "UInfUmin",
"limit" : 390.0,
"limitReduction" : 1.0,
"value" : 387.7355973484713
"value" : 387.735597348476
}, {
"subjectId" : "S1VL1",
"limitType" : "LOW_VOLTAGE",
"limitName" : "UInfUmin",
"limit" : 220.0,
"limitReduction" : 1.0,
"value" : 217.8628453608945
"value" : 217.86284536089713
}, {
"subjectId" : "S1VL2",
"limitType" : "LOW_VOLTAGE",
"limitName" : "UInfUmin",
"limit" : 390.0,
"limitReduction" : 1.0,
"value" : 387.7355973484713
"value" : 387.735597348476
} ],
"actionsTaken" : [ ]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,16 @@
[t=10.0] LINE : opening both sides on equipment '_BUS___13-BUS___14-1_AC'
+ Contingency '_BUS____1-BUS____2-1_AC'
[t=10.0] LINE : opening both sides on equipment '_BUS____1-BUS____2-1_AC'
[t=10.0] Generator : maximum reactive power limit reached on equipment '_GEN____2_SM'
[t=20.0] Generator : maximum reactive power limit reached on equipment '_GEN____3_SM'
[t=20.0] Generator : maximum reactive power limit reached on equipment '_GEN____6_SM'
[t=25.0] Generator : maximum reactive power limit reached on equipment '_GEN____8_SM'
+ Contingency '_BUS____1-BUS____5-1_AC'
[t=10.0] LINE : opening both sides on equipment '_BUS____1-BUS____5-1_AC'
[t=10.0] Generator : maximum reactive power limit reached on equipment '_GEN____2_SM'
+ Contingency '_BUS____2-BUS____3-1_AC'
[t=10.0] LINE : opening both sides on equipment '_BUS____2-BUS____3-1_AC'
[t=10.0] Generator : maximum reactive power limit reached on equipment '_GEN____3_SM'
+ Contingency '_BUS____2-BUS____4-1_AC'
[t=10.0] LINE : opening both sides on equipment '_BUS____2-BUS____4-1_AC'
+ Contingency '_BUS____2-BUS____5-1_AC'
Expand All @@ -20,6 +26,7 @@
[t=10.0] LINE : opening both sides on equipment '_BUS____3-BUS____4-1_AC'
+ Contingency '_BUS____4-BUS____5-1_AC'
[t=10.0] LINE : opening both sides on equipment '_BUS____4-BUS____5-1_AC'
[t=10.0] Generator : maximum reactive power limit reached on equipment '_GEN____2_SM'
+ Contingency '_BUS____6-BUS___11-1_AC'
[t=10.0] LINE : opening both sides on equipment '_BUS____6-BUS___11-1_AC'
+ Contingency '_BUS____6-BUS___12-1_AC'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
+ testLf root report
+ Dynaflow loadflow on network 'ieee14cdf-solved'
[t=0.0] Generator : minimum reactive power limit reached on equipment 'B6-G'
[t=10.0] Generator : minimum reactive power limit reached on equipment 'B8-G'
[t=90.0] Overload 60 : opening line on equipment 'L6-13-1'
[t=90.0] LINE : opening both sides on equipment 'L6-13-1'
[t=90.0] Overload 60 : opening line on equipment 'L6-13-1'
Loading

0 comments on commit dd3b2aa

Please sign in to comment.