Skip to content

Commit

Permalink
#428 Addition of unit test on outputIIDM (work in progress)
Browse files Browse the repository at this point in the history
Signed-off-by: Dimitri Baron <[email protected]>
  • Loading branch information
barondim committed Nov 18, 2024
1 parent 1984bc8 commit e449c8f
Show file tree
Hide file tree
Showing 5 changed files with 694 additions and 0 deletions.
18 changes: 18 additions & 0 deletions sources/Launcher/test/TestRobustnessAnalysisLauncher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,18 @@ class MyLauncher : public RobustnessAnalysisLauncher {
ASSERT_TRUE(exists("res/logs/log_MyScenario.log"));
}

void launch2() {
inputs_.readInputs(workingDirectory_, "fic_JOB.xml");
boost::shared_ptr<job::JobEntry> job = inputs_.cloneJobEntry();
SimulationParameters params;
params.activateExportIIDM_ = true;
result_.setScenarioId("MyScenario3");
boost::shared_ptr<DYN::Simulation> simu = createAndInitSimulation("res", job, params, result_, inputs_);
simulate(simu, result_);
writeResults();
ASSERT_TRUE(exists("res/outputs2/outputIIDM/outputIIDM_MyScenario3.xml"));
}

void testInputFile(const std::string& inputFile) {
ASSERT_EQ(inputFile_, inputFile);
}
Expand Down Expand Up @@ -174,6 +186,12 @@ TEST(TestLauncher, TestRobustnessAnalysisLauncher) {
launcher.testOutputFileFullPath(createAbsolutePath("MyOutputFile.zip", createAbsolutePath("res", current_path())));
launcher.testMultipleJobs();
launcher.launch();

MyLauncher launcher2;
launcher2.setInputFile("MyInputFile.zip");
launcher2.setDirectory("res");
launcher2.init();
launcher2.launch2();
}


Expand Down
119 changes: 119 additions & 0 deletions sources/Launcher/test/res/fic_DYD.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2024, RTE (http://www.rte-france.com)
See AUTHORS.txt
All rights reserved.
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, you can obtain one at http://mozilla.org/MPL/2.0/.
SPDX-License-Identifier: MPL-2.0
This file is part of Dynawo, an hybrid C++/Modelica open source time domain
simulation tool for power systems.
-->
<dyn:dynamicModelsArchitecture xmlns:dyn="http://www.rte-france.com/dynawo">
<dyn:blackBoxModel id="_LOAD___2_EC" lib="LoadAlphaBeta" parFile="fic_PAR.xml" parId="1" staticId="_LOAD___2_EC">
<dyn:staticRef var="load_PPu" staticVar="p"/>
<dyn:staticRef var="load_QPu" staticVar="q"/>
<dyn:staticRef var="load_state" staticVar="state"/>
</dyn:blackBoxModel>
<dyn:blackBoxModel id="_LOAD___3_EC" lib="LoadAlphaBeta" parFile="fic_PAR.xml" parId="1" staticId="_LOAD___3_EC">
<dyn:macroStaticRef id="LOAD"/>
</dyn:blackBoxModel>
<dyn:blackBoxModel id="_LOAD___4_EC" lib="LoadAlphaBeta" parFile="fic_PAR.xml" parId="1" staticId="_LOAD___4_EC">
<dyn:macroStaticRef id="LOAD"/>
</dyn:blackBoxModel>
<dyn:blackBoxModel id="_LOAD___5_EC" lib="LoadAlphaBeta" parFile="fic_PAR.xml" parId="1" staticId="_LOAD___5_EC">
<dyn:macroStaticRef id="LOAD"/>
</dyn:blackBoxModel>
<dyn:blackBoxModel id="_LOAD___6_EC" lib="LoadAlphaBeta" parFile="fic_PAR.xml" parId="1" staticId="_LOAD___6_EC">
<dyn:macroStaticRef id="LOAD"/>
</dyn:blackBoxModel>
<dyn:blackBoxModel id="_LOAD___9_EC" lib="LoadAlphaBeta" parFile="fic_PAR.xml" parId="1" staticId="_LOAD___9_EC">
<dyn:macroStaticRef id="LOAD"/>
</dyn:blackBoxModel>
<dyn:blackBoxModel id="_LOAD__10_EC" lib="LoadAlphaBeta" parFile="fic_PAR.xml" parId="1" staticId="_LOAD__10_EC">
<dyn:macroStaticRef id="LOAD"/>
</dyn:blackBoxModel>
<dyn:blackBoxModel id="_LOAD__11_EC" lib="LoadAlphaBeta" parFile="fic_PAR.xml" parId="1" staticId="_LOAD__11_EC">
<dyn:macroStaticRef id="LOAD"/>
</dyn:blackBoxModel>
<dyn:blackBoxModel id="_LOAD__12_EC" lib="LoadAlphaBeta" parFile="fic_PAR.xml" parId="1" staticId="_LOAD__12_EC">
<dyn:macroStaticRef id="LOAD"/>
</dyn:blackBoxModel>
<dyn:blackBoxModel id="_LOAD__13_EC" lib="LoadAlphaBeta" parFile="fic_PAR.xml" parId="1" staticId="_LOAD__13_EC">
<dyn:macroStaticRef id="LOAD"/>
</dyn:blackBoxModel>
<dyn:blackBoxModel id="_LOAD__14_EC" lib="LoadAlphaBeta" parFile="fic_PAR.xml" parId="1" staticId="_LOAD__14_EC">
<dyn:macroStaticRef id="LOAD"/>
</dyn:blackBoxModel>
<dyn:blackBoxModel id="GEN____1_SM" lib="GeneratorSynchronousFourWindingsProportionalRegulations" parFile="fic_PAR.xml" parId="2" staticId="_GEN____1_SM">
<dyn:staticRef var="generator_PGenPu" staticVar="p"/>
<dyn:staticRef var="generator_QGenPu" staticVar="q"/>
<dyn:staticRef var="generator_state" staticVar="state"/>
</dyn:blackBoxModel>
<dyn:blackBoxModel id="GEN____2_SM" lib="GeneratorSynchronousFourWindingsProportionalRegulations" parFile="fic_PAR.xml" parId="3" staticId="_GEN____2_SM">
<dyn:macroStaticRef id="GEN"/>
</dyn:blackBoxModel>
<dyn:blackBoxModel id="GEN____3_SM" lib="GeneratorSynchronousFourWindingsProportionalRegulations" parFile="fic_PAR.xml" parId="4" staticId="_GEN____3_SM">
<dyn:macroStaticRef id="GEN"/>
</dyn:blackBoxModel>
<dyn:blackBoxModel id="GEN____6_SM" lib="GeneratorSynchronousThreeWindingsProportionalRegulations" parFile="fic_PAR.xml" parId="5" staticId="_GEN____6_SM">
<dyn:macroStaticRef id="GEN"/>
</dyn:blackBoxModel>
<dyn:blackBoxModel id="GEN____8_SM" lib="GeneratorSynchronousThreeWindingsProportionalRegulations" parFile="fic_PAR.xml" parId="6" staticId="_GEN____8_SM">
<dyn:macroStaticRef id="GEN"/>
</dyn:blackBoxModel>
<dyn:blackBoxModel id="OMEGA_REF" lib="DYNModelOmegaRef" parFile="fic_PAR.xml" parId="7"/>
<dyn:connect id1="OMEGA_REF" var1="omega_grp_0" id2="GEN____1_SM" var2="generator_omegaPu"/>
<dyn:connect id1="OMEGA_REF" var1="omegaRef_grp_0" id2="GEN____1_SM" var2="generator_omegaRefPu"/>
<dyn:connect id1="OMEGA_REF" var1="numcc_node_0" id2="NETWORK" var2="@_GEN____1_SM@@NODE@_numcc"/>
<dyn:connect id1="OMEGA_REF" var1="running_grp_0" id2="GEN____1_SM" var2="generator_running"/>
<dyn:connect id1="OMEGA_REF" var1="omega_grp_1" id2="GEN____2_SM" var2="generator_omegaPu"/>
<dyn:connect id1="OMEGA_REF" var1="omegaRef_grp_1" id2="GEN____2_SM" var2="generator_omegaRefPu"/>
<dyn:connect id1="OMEGA_REF" var1="numcc_node_1" id2="NETWORK" var2="@_GEN____2_SM@@NODE@_numcc"/>
<dyn:connect id1="OMEGA_REF" var1="running_grp_1" id2="GEN____2_SM" var2="generator_running"/>
<dyn:connect id1="OMEGA_REF" var1="omega_grp_2" id2="GEN____3_SM" var2="generator_omegaPu"/>
<dyn:connect id1="OMEGA_REF" var1="omegaRef_grp_2" id2="GEN____3_SM" var2="generator_omegaRefPu"/>
<dyn:connect id1="OMEGA_REF" var1="numcc_node_2" id2="NETWORK" var2="@_GEN____3_SM@@NODE@_numcc"/>
<dyn:connect id1="OMEGA_REF" var1="running_grp_2" id2="GEN____3_SM" var2="generator_running"/>
<dyn:connect id1="OMEGA_REF" var1="omega_grp_3" id2="GEN____6_SM" var2="generator_omegaPu"/>
<dyn:connect id1="OMEGA_REF" var1="omegaRef_grp_3" id2="GEN____6_SM" var2="generator_omegaRefPu"/>
<dyn:connect id1="OMEGA_REF" var1="numcc_node_3" id2="NETWORK" var2="@_GEN____6_SM@@NODE@_numcc"/>
<dyn:connect id1="OMEGA_REF" var1="running_grp_3" id2="GEN____6_SM" var2="generator_running"/>
<dyn:connect id1="OMEGA_REF" var1="omega_grp_4" id2="GEN____8_SM" var2="generator_omegaPu"/>
<dyn:connect id1="OMEGA_REF" var1="omegaRef_grp_4" id2="GEN____8_SM" var2="generator_omegaRefPu"/>
<dyn:connect id1="OMEGA_REF" var1="numcc_node_4" id2="NETWORK" var2="@_GEN____8_SM@@NODE@_numcc"/>
<dyn:connect id1="OMEGA_REF" var1="running_grp_4" id2="GEN____8_SM" var2="generator_running"/>
<dyn:connect id1="_LOAD__10_EC" var1="load_terminal" id2="NETWORK" var2="_BUS___10_TN_ACPIN"/>
<dyn:connect id1="_LOAD__11_EC" var1="load_terminal" id2="NETWORK" var2="_BUS___11_TN_ACPIN"/>
<dyn:connect id1="_LOAD__12_EC" var1="load_terminal" id2="NETWORK" var2="_BUS___12_TN_ACPIN"/>
<dyn:connect id1="_LOAD__13_EC" var1="load_terminal" id2="NETWORK" var2="_BUS___13_TN_ACPIN"/>
<dyn:connect id1="_LOAD__14_EC" var1="load_terminal" id2="NETWORK" var2="_BUS___14_TN_ACPIN"/>
<dyn:connect id1="_LOAD___2_EC" var1="load_terminal" id2="NETWORK" var2="_BUS____2_TN_ACPIN"/>
<dyn:connect id1="_LOAD___3_EC" var1="load_terminal" id2="NETWORK" var2="_BUS____3_TN_ACPIN"/>
<dyn:connect id1="_LOAD___4_EC" var1="load_terminal" id2="NETWORK" var2="_BUS____4_TN_ACPIN"/>
<dyn:connect id1="_LOAD___5_EC" var1="load_terminal" id2="NETWORK" var2="_BUS____5_TN_ACPIN"/>
<dyn:connect id1="_LOAD___6_EC" var1="load_terminal" id2="NETWORK" var2="_BUS____6_TN_ACPIN"/>
<dyn:connect id1="_LOAD___9_EC" var1="load_terminal" id2="NETWORK" var2="_BUS____9_TN_ACPIN"/>
<dyn:connect id1="GEN____1_SM" var1="generator_terminal" id2="NETWORK" var2="@_GEN____1_SM@@NODE@_ACPIN"/>
<dyn:connect id1="GEN____1_SM" var1="generator_switchOffSignal1" id2="NETWORK" var2="@_GEN____1_SM@@NODE@_switchOff"/>
<dyn:connect id1="GEN____2_SM" var1="generator_terminal" id2="NETWORK" var2="@_GEN____2_SM@@NODE@_ACPIN"/>
<dyn:connect id1="GEN____2_SM" var1="generator_switchOffSignal1" id2="NETWORK" var2="@_GEN____2_SM@@NODE@_switchOff"/>
<dyn:connect id1="GEN____3_SM" var1="generator_terminal" id2="NETWORK" var2="@_GEN____3_SM@@NODE@_ACPIN"/>
<dyn:connect id1="GEN____3_SM" var1="generator_switchOffSignal1" id2="NETWORK" var2="@_GEN____3_SM@@NODE@_switchOff"/>
<dyn:connect id1="GEN____6_SM" var1="generator_terminal" id2="NETWORK" var2="@_GEN____6_SM@@NODE@_ACPIN"/>
<dyn:connect id1="GEN____6_SM" var1="generator_switchOffSignal1" id2="NETWORK" var2="@_GEN____6_SM@@NODE@_switchOff"/>
<dyn:connect id1="GEN____8_SM" var1="generator_terminal" id2="NETWORK" var2="@_GEN____8_SM@@NODE@_ACPIN"/>
<dyn:connect id1="GEN____8_SM" var1="generator_switchOffSignal1" id2="NETWORK" var2="@_GEN____8_SM@@NODE@_switchOff"/>
<dyn:macroStaticReference id="GEN">
<dyn:staticRef var="generator_PGenPu" staticVar="p"/>
<dyn:staticRef var="generator_QGenPu" staticVar="q"/>
<dyn:staticRef var="generator_state" staticVar="state"/>
</dyn:macroStaticReference>
<dyn:macroStaticReference id="LOAD">
<dyn:staticRef var="load_PPu" staticVar="p"/>
<dyn:staticRef var="load_QPu" staticVar="q"/>
<dyn:staticRef var="load_state" staticVar="state"/>
</dyn:macroStaticReference>
</dyn:dynamicModelsArchitecture>
Loading

0 comments on commit e449c8f

Please sign in to comment.