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

Report network angle reference bus and slack bus(es) after network loading #1029

Merged
merged 3 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions src/main/java/com/powsybl/openloadflow/network/LfNetwork.java
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,8 @@ public static <T> List<LfNetwork> load(T network, LfNetworkLoader<T> networkLoad
case VALID -> {
lfNetwork.reportSize(networkReport);
lfNetwork.reportBalance(networkReport);
lfNetwork.updateSlackBusesAndReferenceBus();
annetill marked this conversation as resolved.
Show resolved Hide resolved
Reports.reportAngleReferenceBusAndSlackBuses(networkReport, lfNetwork.getReferenceBus().getId(), lfNetwork.getSlackBuses().stream().map(LfBus::getId).toList());
lfNetwork.setReportNode(Reports.createLfNetworkReportNode(reportNode, lfNetwork.getReportNode(), lfNetwork.getNumCC(), lfNetwork.getNumCC()));
}
case INVALID_NO_GENERATOR_VOLTAGE_CONTROL -> {
Expand Down
14 changes: 14 additions & 0 deletions src/main/java/com/powsybl/openloadflow/util/Reports.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.powsybl.commons.report.TypedValue;
import com.powsybl.openloadflow.OpenLoadFlowReportConstants;

import java.util.List;
import java.util.Map;

/**
Expand Down Expand Up @@ -461,4 +462,17 @@ public static void reportNewtonRaphsonBusesOutOfRealisticVoltageRange(ReportNode
.withSeverity(TypedValue.ERROR_SEVERITY)
.add();
}

public static void reportAngleReferenceBusAndSlackBuses(ReportNode reportNode, String referenceBus, List<String> slackBuses) {
reportNode.newReportNode()
.withMessageTemplate("angleReferenceBusSelection", "Angle Reference Bus: ${referenceBus}")
annetill marked this conversation as resolved.
Show resolved Hide resolved
.withUntypedValue("referenceBus", referenceBus)
.withSeverity(TypedValue.INFO_SEVERITY)
.add();
slackBuses.forEach(slackBus -> reportNode.newReportNode()
.withMessageTemplate("slackBusSelection", "Slack Bus: ${slackBus}")
.withUntypedValue("slackBus", slackBus)
.withSeverity(TypedValue.INFO_SEVERITY)
.add());
}
}
2 changes: 2 additions & 0 deletions src/test/resources/detailedNrReportSecurityAnalysis.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
+ Network info
Network has 2 buses and 2 branches
Network balance: active generation=603.77 MW, active load=600.0 MW, reactive generation=0.0 MVar, reactive load=200.0 MVar
Angle Reference Bus: VL1_0
Slack Bus: VL1_0
+ Pre-contingency simulation
+ Newton Raphson on Network CC0 SC0
No outer loops have been launched
Expand Down
4 changes: 4 additions & 0 deletions src/test/resources/esgTutoReport.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
+ Network info
Network has 4 buses and 4 branches
Network balance: active generation=607.0 MW, active load=600.0 MW, reactive generation=0.0 MVar, reactive load=200.0 MVar
Angle Reference Bus: VLHV1_0
Slack Bus: VLHV1_0
+ Outer loop DistributedSlack
+ Outer loop iteration 1
Slack bus active power (-1.4404045651219555 MW) distributed in 1 distribution iteration(s)
Expand All @@ -18,6 +20,8 @@
+ Network info
Network has 4 buses and 4 branches
Network balance: active generation=607.0 MW, active load=600.0 MW, reactive generation=0.0 MVar, reactive load=200.0 MVar
Angle Reference Bus: VLLOAD_0
Slack Bus: VLLOAD_0
Outer loop VoltageMonitoring
Outer loop ReactiveLimits
AC load flow completed successfully (solverStatus=CONVERGED, outerloopStatus=STABLE)
2 changes: 2 additions & 0 deletions src/test/resources/esgTutoReportDetailedNrReportLf.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
+ Network info
Network has 4 buses and 4 branches
Network balance: active generation=607.0 MW, active load=600.0 MW, reactive generation=0.0 MVar, reactive load=200.0 MVar
Angle Reference Bus: VLHV1_0
Slack Bus: VLHV1_0
+ Newton Raphson on Network CC0 SC0
No outer loops have been launched
+ Initial mismatch
Expand Down
2 changes: 2 additions & 0 deletions src/test/resources/esgTutoReportDetailedNrReportSensi.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
+ Network info
Network has 4 buses and 4 branches
Network balance: active generation=607.0 MW, active load=600.0 MW, reactive generation=0.0 MVar, reactive load=200.0 MVar
Angle Reference Bus: VLHV1_0
Slack Bus: VLHV1_0
+ Newton Raphson on Network CC0 SC0
No outer loops have been launched
+ Initial mismatch
Expand Down
2 changes: 2 additions & 0 deletions src/test/resources/multipleConnectedComponentsAcReport.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
+ Network info
Network has 3 buses and 4 branches
Network balance: active generation=3.0 MW, active load=2.0 MW, reactive generation=0.0 MVar, reactive load=0.0 MVar
Angle Reference Bus: b1_vl_0
Slack Bus: b1_vl_0
Outer loop DistributedSlack
Outer loop VoltageMonitoring
Outer loop ReactiveLimits
Expand Down
4 changes: 4 additions & 0 deletions src/test/resources/multipleConnectedComponentsDcReport.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@
+ Network info
Network has 3 buses and 4 branches
Network balance: active generation=3.0 MW, active load=2.0 MW, reactive generation=0.0 MVar, reactive load=0.0 MVar
Angle Reference Bus: b1_vl_0
Slack Bus: b1_vl_0
DC load flow completed (status=true)
+ Network CC1 SC1
+ Network info
Network has 3 buses and 4 branches
Network balance: active generation=2.0 MW, active load=4.0 MW, reactive generation=0.0 MVar, reactive load=0.0 MVar
Angle Reference Bus: b5_vl_0
Slack Bus: b5_vl_0
DC load flow completed (status=true)
No calculation will be done on 1 network(s) that have no generators
2 changes: 2 additions & 0 deletions src/test/resources/saReport.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
+ Network info
Network has 4 buses and 4 branches
Network balance: active generation=607.0 MW, active load=600.0 MW, reactive generation=0.0 MVar, reactive load=200.0 MVar
Angle Reference Bus: VLHV1_0
Slack Bus: VLHV1_0
+ Pre-contingency simulation
+ Outer loop DistributedSlack
+ Outer loop iteration 1
Expand Down
2 changes: 2 additions & 0 deletions src/test/resources/shuntVoltageControlOuterLoopReport.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
+ Network info
Network has 3 buses and 2 branches
Network balance: active generation=101.36639999999998 MW, active load=101.0 MW, reactive generation=0.0 MVar, reactive load=150.0 MVar
Angle Reference Bus: vl2_0
Slack Bus: vl2_0
+ Newton Raphson on Network CC0 SC0
No outer loops have been launched
+ Initial mismatch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
+ Network info
Network has 3 buses and 2 branches
Network balance: active generation=25.0 MW, active load=16.2 MW, reactive generation=0.0 MVar, reactive load=7.5 MVar
Angle Reference Bus: VL_2_0
Slack Bus: VL_2_0
+ Newton Raphson on Network CC0 SC0
No outer loops have been launched
+ Initial mismatch
Expand Down