Skip to content

Commit

Permalink
#216 Fix shunt management for SA
Browse files Browse the repository at this point in the history
  • Loading branch information
Le Courtois Florent committed Dec 9, 2021
1 parent 7c8b28e commit f2594f6
Show file tree
Hide file tree
Showing 7 changed files with 482 additions and 448 deletions.
4 changes: 4 additions & 0 deletions sources/Outputs/src/DydEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ DydEvent::write() const {
dynamicModels->addModel(buildSwitchOffSignalDisconnection(element.id, def_.basename));
addSwitchOffSignalDisconnectionConnect(dynamicModels, element.id, "hvdc_switchOffSignal2");
break;
case Type::SHUNT_COMPENSATOR:
dynamicModels->addModel(buildSwitchOffSignalDisconnection(element.id, def_.basename));
addSwitchOffSignalDisconnectionConnect(dynamicModels, element.id, "shunt_switchOffSignal2");
break;
default:
dynamicModels->addModel(buildNetworkStateDisconnection(element.id, def_.basename));
addNetworkStateDisconnectionConnect(dynamicModels, element.id);
Expand Down
1 change: 1 addition & 0 deletions sources/Outputs/src/ParEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ ParEvent::write() {
case Type::LOAD:
case Type::GENERATOR:
case Type::HVDC_LINE:
case Type::SHUNT_COMPENSATOR:
parametersSets->addParametersSet(buildEventSetPointBooleanDisconnection(element.id, def_.timeOfEvent));
break;
default:
Expand Down

Large diffs are not rendered by default.

13 changes: 12 additions & 1 deletion tests/outputs/TestDydEvent.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
//
// Copyright (c) 2021, 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
//

#include "DydEvent.h"
#include "Tests.h"

Expand Down Expand Up @@ -28,7 +38,8 @@ TEST(TestDydEvent, write) {
contingency.elements.emplace_back("TestGenerator", ElementType::GENERATOR); // signal: "generator_switchOffSignal2"
contingency.elements.emplace_back("TestLoad", ElementType::LOAD); // signal: "switchOff2"
contingency.elements.emplace_back("TestHvdcLine", ElementType::HVDC_LINE); // signal: "hvdc_switchOffSignal2"
contingency.elements.emplace_back("TestShuntCompensator", ElementType::SHUNT_COMPENSATOR); // buildNetworkStateDisconnection (general case)
contingency.elements.emplace_back("TestShuntCompensator", ElementType::SHUNT_COMPENSATOR); // signal: "shunt_switchOffSignal2"
contingency.elements.emplace_back("TestLine", ElementType::LINE); // general case

outputPath.append(filename);
dfl::outputs::DydEvent dyd(dfl::outputs::DydEvent::DydEventDefinition(basename, outputPath.generic_string(), contingency));
Expand Down
13 changes: 12 additions & 1 deletion tests/outputs/TestParEvent.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
//
// Copyright (c) 2021, 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
//

#include "Contingencies.h"
#include "ParEvent.h"
#include "Tests.h"
Expand Down Expand Up @@ -27,7 +37,8 @@ TEST(TestParEvent, write) {
// We need the three of them to check the three cases that can be generated
contingency.elements.emplace_back("TestBranch", ElementType::BRANCH); // buildBranchDisconnection (branch case)
contingency.elements.emplace_back("TestGenerator", ElementType::GENERATOR); // buildEventSetPointBooleanDisconnection
contingency.elements.emplace_back("TestShuntCompensator", ElementType::SHUNT_COMPENSATOR); // buildEventSetPointRealDisconnection (general case)
contingency.elements.emplace_back("TestShuntCompensator", ElementType::SHUNT_COMPENSATOR); // buildEventSetPointBooleanDisconnection
contingency.elements.emplace_back("TestLine", ElementType::LINE); // buildEventSetPointRealDisconnection (general case)

outputPath.append(filename);
dfl::outputs::ParEvent par(dfl::outputs::ParEvent::ParEventDefinition(basename, outputPath.generic_string(), contingency, std::chrono::seconds(80)));
Expand Down
6 changes: 4 additions & 2 deletions tests/outputs/reference/TestDydEvent/TestDydEvent.dyd
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
<dyn:blackBoxModel id="Disconnect_TestBranch" lib="EventQuadripoleDisconnection" parFile="TestDydEvent.par" parId="Disconnect_TestBranch"/>
<dyn:blackBoxModel id="Disconnect_TestGenerator" lib="EventSetPointBoolean" parFile="TestDydEvent.par" parId="Disconnect_TestGenerator"/>
<dyn:blackBoxModel id="Disconnect_TestHvdcLine" lib="EventSetPointBoolean" parFile="TestDydEvent.par" parId="Disconnect_TestHvdcLine"/>
<dyn:blackBoxModel id="Disconnect_TestLine" lib="EventQuadripoleDisconnection" parFile="TestDydEvent.par" parId="Disconnect_TestLine"/>
<dyn:blackBoxModel id="Disconnect_TestLoad" lib="EventSetPointBoolean" parFile="TestDydEvent.par" parId="Disconnect_TestLoad"/>
<dyn:blackBoxModel id="Disconnect_TestShuntCompensator" lib="EventSetPointReal" parFile="TestDydEvent.par" parId="Disconnect_TestShuntCompensator"/>
<dyn:blackBoxModel id="Disconnect_TestShuntCompensator" lib="EventSetPointBoolean" parFile="TestDydEvent.par" parId="Disconnect_TestShuntCompensator"/>
<dyn:macroConnect connector="MC_EventQuadripoleDisconnection" id1="Disconnect_TestBranch" id2="NETWORK" name2="TestBranch"/>
<dyn:macroConnect connector="MC_EventQuadripoleDisconnection" id1="Disconnect_TestLine" id2="NETWORK" name2="TestLine"/>
<dyn:connect id1="Disconnect_TestGenerator" var1="event_state1" id2="TestGenerator" var2="generator_switchOffSignal2"/>
<dyn:connect id1="Disconnect_TestLoad" var1="event_state1" id2="TestLoad" var2="switchOff2"/>
<dyn:connect id1="Disconnect_TestHvdcLine" var1="event_state1" id2="TestHvdcLine" var2="hvdc_switchOffSignal2"/>
<dyn:connect id1="Disconnect_TestShuntCompensator" var1="event_state1" id2="NETWORK" var2="TestShuntCompensator_state"/>
<dyn:connect id1="Disconnect_TestShuntCompensator" var1="event_state1" id2="TestShuntCompensator" var2="shunt_switchOffSignal2"/>
</dyn:dynamicModelsArchitecture>
7 changes: 6 additions & 1 deletion tests/outputs/reference/TestParEvent/TestParEvent.par
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@
<par name="event_stateEvent1" type="BOOL" value="true"/>
<par name="event_tEvent" type="DOUBLE" value="80"/>
</set>
<set id="Disconnect_TestLine">
<par name="event_disconnectExtremity" type="BOOL" value="true"/>
<par name="event_disconnectOrigin" type="BOOL" value="true"/>
<par name="event_tEvent" type="DOUBLE" value="80"/>
</set>
<set id="Disconnect_TestShuntCompensator">
<par name="event_stateEvent1" type="DOUBLE" value="1"/>
<par name="event_stateEvent1" type="BOOL" value="true"/>
<par name="event_tEvent" type="DOUBLE" value="80"/>
</set>
</parametersSet>

0 comments on commit f2594f6

Please sign in to comment.