Skip to content
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2022, RTE (http://www.rte-france.com)
/*
* Copyright (c) 2022-2025, RTE (http://www.rte-france.com)
* 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/.
Expand All @@ -8,6 +8,7 @@
package com.powsybl.openloadflow.ac.outerloop;

import com.powsybl.commons.report.ReportNode;
import com.powsybl.openloadflow.ac.AcLoadFlowContext;
import com.powsybl.openloadflow.ac.AcOuterLoopContext;
import com.powsybl.openloadflow.lf.outerloop.OuterLoopResult;
import com.powsybl.openloadflow.lf.outerloop.OuterLoopStatus;
Expand Down Expand Up @@ -140,4 +141,11 @@ public OuterLoopResult check(AcOuterLoopContext context, ReportNode reportNode)

return new OuterLoopResult(this, status);
}

@Override
public boolean isNeeded(AcLoadFlowContext context) {
return context.getNetwork().<LfBus>getControllerElements(VoltageControl.Type.GENERATOR).stream()
.filter(LfBus::isGeneratorVoltageControlled)
.anyMatch(bus -> getControlledBusVoltageLimits(bus).isPresent());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ void busesOutOfRealisticVoltageRangeTest() throws IOException {
+ Outer loop DistributedSlack
+ Outer loop iteration 1
Slack bus active power (-1.440405 MW) distributed in 1 distribution iteration(s)
Outer loop VoltageMonitoring
Outer loop ReactiveLimits
+ 4 buses have a voltage magnitude out of the configured realistic range [0.99, 1.01] p.u.
Bus VLGEN_0 has an unrealistic voltage magnitude: 1.020833 p.u.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2021, RTE (http://www.rte-france.com)
/*
* Copyright (c) 2021-2025, RTE (http://www.rte-france.com)
* 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/.
Expand Down Expand Up @@ -750,15 +750,13 @@ void testMaxSectionShift() throws IOException {
Angle reference bus: b2_vl_0
Slack bus: b2_vl_0
Outer loop DistributedSlack
Outer loop VoltageMonitoring
Outer loop ReactiveLimits
+ Outer loop IncrementalShuntVoltageControl
+ Outer loop iteration 1
2 shunts changed section
+ Outer loop iteration 2
2 shunts changed section
Outer loop DistributedSlack
Outer loop VoltageMonitoring
Outer loop ReactiveLimits
Outer loop IncrementalShuntVoltageControl
AC load flow completed successfully (solverStatus=CONVERGED, outerloopStatus=STABLE)
Expand Down Expand Up @@ -792,7 +790,6 @@ AC load flow completed successfully (solverStatus=CONVERGED, outerloopStatus=STA
Angle reference bus: b2_vl_0
Slack bus: b2_vl_0
Outer loop DistributedSlack
Outer loop VoltageMonitoring
Outer loop ReactiveLimits
+ Outer loop IncrementalShuntVoltageControl
+ Outer loop iteration 1
Expand All @@ -804,7 +801,6 @@ AC load flow completed successfully (solverStatus=CONVERGED, outerloopStatus=STA
+ Outer loop iteration 4
2 shunts changed section
Outer loop DistributedSlack
Outer loop VoltageMonitoring
Outer loop ReactiveLimits
Outer loop IncrementalShuntVoltageControl
AC load flow completed successfully (solverStatus=CONVERGED, outerloopStatus=STABLE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ void testGeneratorRemoteReactivePowerControlOutsideReactiveLimits() throws IOExc
Network balance: active generation=3 MW, active load=5 MW, reactive generation=0 MVar, reactive load=0 MVar
Angle reference bus: b1_vl_0
Slack bus: b1_vl_0
Outer loop VoltageMonitoring
+ Outer loop ReactiveLimits
+ Outer loop iteration 1
+ 1 bus(es) with remote reactive power controller switched PQ
Expand All @@ -167,7 +166,6 @@ void testGeneratorRemoteReactivePowerControlOutsideReactiveLimits() throws IOExc
1 transformers reached their tap maximum position
+ Outer loop iteration 3
1 reactive power-controlled branches are outside of their target deadbands
Outer loop VoltageMonitoring
Outer loop ReactiveLimits
+ Outer loop IncrementalTransformerReactivePowerControl
+ Outer loop iteration 3
Expand Down Expand Up @@ -230,12 +228,10 @@ void testGeneratorRemoteReactivePowerControlBelowReactiveLimits() throws IOExcep
Network balance: active generation=3 MW, active load=5 MW, reactive generation=0 MVar, reactive load=0 MVar
Angle reference bus: b1_vl_0
Slack bus: b1_vl_0
Outer loop VoltageMonitoring
+ Outer loop ReactiveLimits
+ Outer loop iteration 1
+ 1 bus(es) with remote reactive power controller switched PQ
Remote reactive power controller bus 'b4_vl_0' -> PQ, q=-3.49137 < minQ=-3
Outer loop VoltageMonitoring
Outer loop ReactiveLimits
AC load flow completed successfully (solverStatus=CONVERGED, outerloopStatus=STABLE)
""";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,8 @@ Area a2 interchange mismatch (-39.924115 MW) distributed in 1 distribution itera
+ Outer loop iteration 2
Area a1 slack distribution share (0.293861 MW) distributed in 1 distribution iteration(s)
Area a2 slack distribution share (0.331121 MW) distributed in 1 distribution iteration(s)
Outer loop VoltageMonitoring
Outer loop ReactiveLimits
Outer loop AreaInterchangeControl
Outer loop VoltageMonitoring
Outer loop ReactiveLimits
AC load flow completed successfully (solverStatus=CONVERGED, outerloopStatus=STABLE)
""";
Expand Down Expand Up @@ -358,10 +356,8 @@ void remainingSlackDistributionShares() throws IOException {
+ Outer loop iteration 1
Area a1 slack distribution share (-0.395604 MW) distributed in 1 distribution iteration(s)
Area a2 slack distribution share (-0.004396 MW) distributed in 1 distribution iteration(s)
Outer loop VoltageMonitoring
Outer loop ReactiveLimits
Outer loop AreaInterchangeControl
Outer loop VoltageMonitoring
Outer loop ReactiveLimits
AC load flow completed successfully (solverStatus=CONVERGED, outerloopStatus=STABLE)
""";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,8 @@ void testFictiveInjection() throws IOException {
+ Outer loop DistributedSlack
+ Outer loop iteration 1
Slack bus active power (-30 MW) distributed in 1 distribution iteration(s)
Outer loop VoltageMonitoring
Outer loop ReactiveLimits
Outer loop DistributedSlack
Outer loop VoltageMonitoring
Outer loop ReactiveLimits
AC load flow completed successfully (solverStatus=CONVERGED, outerloopStatus=STABLE)
""";
Expand Down Expand Up @@ -99,10 +97,8 @@ void testNoFictiveInjection() throws IOException {
+ Outer loop DistributedSlack
+ Outer loop iteration 1
Slack bus active power (-60 MW) distributed in 1 distribution iteration(s)
Outer loop VoltageMonitoring
Outer loop ReactiveLimits
Outer loop DistributedSlack
Outer loop VoltageMonitoring
Outer loop ReactiveLimits
AC load flow completed successfully (solverStatus=CONVERGED, outerloopStatus=STABLE)
""";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,18 +235,15 @@ void testLowVoltageQMin(boolean robustMode) throws IOException {
+ Outer loop DistributedSlack
+ Outer loop iteration 1
Slack bus active power (22.147061 MW) distributed in 1 distribution iteration(s)
Outer loop VoltageMonitoring
+ Outer loop ReactiveLimits
+ Outer loop iteration 2
+ 1 buses switched PV -> PQ (1 buses remain PV)
Switch bus 'vl1_0' PV -> PQ, q=-2553.557359 < minQ=-800
+ Outer loop DistributedSlack
+ Outer loop iteration 3
Slack bus active power (-21.141636 MW) distributed in 1 distribution iteration(s)
Outer loop VoltageMonitoring
Outer loop ReactiveLimits
Outer loop DistributedSlack
Outer loop VoltageMonitoring
Outer loop ReactiveLimits
AC load flow completed successfully (solverStatus=CONVERGED, outerloopStatus=STABLE)
""";
Expand Down Expand Up @@ -287,18 +284,15 @@ void testLowVoltageVMin(boolean robustMode) throws IOException {
+ Outer loop DistributedSlack
+ Outer loop iteration 1
Slack bus active power (22.147061 MW) distributed in 1 distribution iteration(s)
Outer loop VoltageMonitoring
+ Outer loop ReactiveLimits
+ Outer loop iteration 2
+ 1 buses switched PV -> PQ (1 buses remain PV)
Switch bus 'vl1_0' PV -> PQ, q set to 10 = targetQ - because V < 16kV when remote voltage target is maintained
+ Outer loop DistributedSlack
+ Outer loop iteration 3
Slack bus active power (-22.091658 MW) distributed in 1 distribution iteration(s)
Outer loop VoltageMonitoring
Outer loop ReactiveLimits
Outer loop DistributedSlack
Outer loop VoltageMonitoring
Outer loop ReactiveLimits
AC load flow completed successfully (solverStatus=CONVERGED, outerloopStatus=STABLE)
""";
Expand Down Expand Up @@ -341,18 +335,15 @@ void testHighVoltageVMax(boolean robustMode) throws IOException {
+ Outer loop DistributedSlack
+ Outer loop iteration 1
Slack bus active power (18.066373 MW) distributed in 1 distribution iteration(s)
Outer loop VoltageMonitoring
+ Outer loop ReactiveLimits
+ Outer loop iteration 2
+ 1 buses switched PV -> PQ (1 buses remain PV)
Switch bus 'vl1_0' PV -> PQ, q set to 10 = targetQ - because V > 24kV when remote voltage target is maintained
+ Outer loop DistributedSlack
+ Outer loop iteration 3
Slack bus active power (-18.01229 MW) distributed in 1 distribution iteration(s)
Outer loop VoltageMonitoring
Outer loop ReactiveLimits
Outer loop DistributedSlack
Outer loop VoltageMonitoring
Outer loop ReactiveLimits
AC load flow completed successfully (solverStatus=CONVERGED, outerloopStatus=STABLE)
""";
Expand Down Expand Up @@ -394,18 +385,15 @@ void testHighVoltageQMax(boolean robustMode) throws IOException {
+ Outer loop DistributedSlack
+ Outer loop iteration 1
Slack bus active power (18.066373 MW) distributed in 1 distribution iteration(s)
Outer loop VoltageMonitoring
+ Outer loop ReactiveLimits
+ Outer loop iteration 2
+ 1 buses switched PV -> PQ (1 buses remain PV)
Switch bus 'vl1_0' PV -> PQ, q=5180.292508 > maxQ=800
+ Outer loop DistributedSlack
+ Outer loop iteration 3
Slack bus active power (-17.327551 MW) distributed in 1 distribution iteration(s)
Outer loop VoltageMonitoring
Outer loop ReactiveLimits
Outer loop DistributedSlack
Outer loop VoltageMonitoring
Outer loop ReactiveLimits
AC load flow completed successfully (solverStatus=CONVERGED, outerloopStatus=STABLE)
""";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ void testUnblockGeneratorFromLimit() throws IOException {
Slack bus: VL1_0
Outer loop DistributedSlack
Outer loop SecondaryVoltageControl
Outer loop VoltageMonitoring
+ Outer loop ReactiveLimits
+ Outer loop iteration 3
+ 3 buses switched PV -> PQ (2 buses remain PV)
Expand All @@ -242,7 +241,6 @@ void testUnblockGeneratorFromLimit() throws IOException {
+ Outer loop iteration 6
Failed to distribute slack bus active power mismatch, 3.011164 MW remains
Outer loop SecondaryVoltageControl
Outer loop VoltageMonitoring
+ Outer loop ReactiveLimits
+ Outer loop iteration 8
+ 2 buses switched PV -> PQ (1 buses remain PV)
Expand All @@ -252,7 +250,6 @@ void testUnblockGeneratorFromLimit() throws IOException {
+ Outer loop iteration 9
Failed to distribute slack bus active power mismatch, 3.016519 MW remains
Outer loop SecondaryVoltageControl
Outer loop VoltageMonitoring
Outer loop ReactiveLimits
AC load flow completed successfully (solverStatus=CONVERGED, outerloopStatus=STABLE)
""";
Expand Down Expand Up @@ -305,7 +302,6 @@ void testCannotUnblockGeneratorFromLimit() throws IOException {
Slack bus: VL1_0
Outer loop DistributedSlack
Outer loop SecondaryVoltageControl
Outer loop VoltageMonitoring
+ Outer loop ReactiveLimits
+ Outer loop iteration 3
+ 3 buses switched PV -> PQ (2 buses remain PV)
Expand All @@ -322,14 +318,12 @@ void testCannotUnblockGeneratorFromLimit() throws IOException {
+ Outer loop iteration 5
Slack bus active power (3.013536 MW) distributed in 1 distribution iteration(s)
Outer loop SecondaryVoltageControl
Outer loop VoltageMonitoring
+ Outer loop ReactiveLimits
+ Outer loop iteration 6
+ 0 buses switched PQ -> PV (1 buses blocked PQ due to the max number of switches)
Bus 'VL6_0' blocked PQ as it has reached its max number of PQ -> PV switch (1)
Outer loop DistributedSlack
Outer loop SecondaryVoltageControl
Outer loop VoltageMonitoring
+ Outer loop ReactiveLimits
+ Outer loop iteration 6
+ 0 buses switched PQ -> PV (1 buses blocked PQ due to the max number of switches)
Expand Down
6 changes: 2 additions & 4 deletions src/test/java/com/powsybl/openloadflow/ac/SwitchPqPvTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2019, RTE (http://www.rte-france.com)
/*
* Copyright (c) 2019-2025, RTE (http://www.rte-france.com)
* 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/.
Expand Down Expand Up @@ -226,13 +226,11 @@ void testMultipleSwitch() throws IOException {
Network balance: active generation=300 MW, active load=300 MW, reactive generation=0 MVar, reactive load=200 MVar
Angle reference bus: vl4_0
Slack bus: vl4_0
Outer loop VoltageMonitoring
+ Outer loop ReactiveLimits
+ Outer loop iteration 1
+ 2 buses switched PV -> PQ (1 buses remain PV)
Switch bus 'vl1_0' PV -> PQ, q=-200.872086 < minQ=-179
Switch bus 'vl2_0' PV -> PQ, q=712.632433 > maxQ=700
Outer loop VoltageMonitoring
Outer loop ReactiveLimits
AC load flow completed successfully (solverStatus=CONVERGED, outerloopStatus=STABLE)
""";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,6 @@ DC load flow completed (solverSuccess=true, outerloopStatus=STABLE)
Bus V: 1.04 pu, 0 rad
Bus injection: 71.632631 MW, 27.046074 MVar
Outer loop DistributedSlack
Outer loop VoltageMonitoring
Outer loop ReactiveLimits
AC load flow completed successfully (solverStatus=CONVERGED, outerloopStatus=STABLE)
""";
Expand Down
Loading