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

Improve logging, reporting and LF results for components without generators #919

Merged
merged 11 commits into from
May 14, 2024

Conversation

jeandemanged
Copy link
Member

@jeandemanged jeandemanged commented Dec 2, 2023

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Does this PR already have an issue describing the problem?

No

What kind of change does this PR introduce?

Feature

What is the current behavior?

Synchronous Components (islands) without any generator connected are causing many ERROR logs to be raised, and many report entries created which are just noise.
Hundreds of errors are logged & reported on real case large networks when OLF configured to solve all components which is quite inconvenient, and not really an error.

What is the new behavior (if this is a feature change)?
Network post-loading validation now:

  • checks for islands without any generator,
  • and for AC models, checks additionally for islands with generators but without voltage control enabled.
    Only relevant logs & reports are now produced.

For islands without any generator, only one log & one report entry is produced reporting the total number of islands where no calculation will be made.

With new LoadFlowResult API (see powsybl/powsybl-core#2767) and #918 we now are able to report new NO_CALCULATION status for "dead" islands without any generator.

⚠️ Important Notes:

  • Functional change: DC Load Flow with this change will not solve islands without generators anymore. It was solving them before - in my opinion this is not a regular use case.
  • AC Load Flow: islands with generators but no voltage regulation are not considered dead, a FAILED status is reported in the case of generators present but no voltage regulation - no change of functionality here.

Does this PR introduce a breaking change or deprecate an API?

  • No

If yes, please check if the following requirements are fulfilled

n/a

What changes might users need to make in their application due to this PR? (migration steps)

n/a

Other information:

n/a

@jeandemanged jeandemanged changed the title Set NO_CALCULATION status for dead components in LoadFlowResult-s [WIP] Set NO_CALCULATION status for dead components in LoadFlowResult-s Dec 2, 2023
Copy link

sonarqubecloud bot commented Dec 2, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

90.9% 90.9% Coverage
0.0% 0.0% Duplication

@geofjamg geofjamg changed the base branch from main to load_flow_results_v1.4 December 4, 2023 15:49
Base automatically changed from load_flow_results_v1.4 to main December 5, 2023 08:21
Signed-off-by: Damien Jeandemange <damien.jeandemange@artelys.com>
Signed-off-by: Damien Jeandemange <damien.jeandemange@artelys.com>
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions

87.5% Coverage on New Code (required ≥ 90%)

See analysis details on SonarCloud

# Conflicts:
#	src/main/java/com/powsybl/openloadflow/network/LfNetwork.java
Signed-off-by: Damien Jeandemange <damien.jeandemange@artelys.com>
Signed-off-by: Damien Jeandemange <damien.jeandemange@artelys.com>
Signed-off-by: Damien Jeandemange <damien.jeandemange@artelys.com>
@jeandemanged jeandemanged changed the title [WIP] Set NO_CALCULATION status for dead components in LoadFlowResult-s Improve logging, reporting and LF results for components without generators Apr 25, 2024
Copy link
Member

@caioluke caioluke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor typo

Signed-off-by: Damien Jeandemange <damien.jeandemange@artelys.com>
Signed-off-by: Damien Jeandemange <damien.jeandemange@artelys.com>
@@ -580,6 +597,21 @@ public void fix(boolean minImpedance, double lowImpedanceThreshold) {
}

private void validateBuses(LoadFlowModel loadFlowModel, ReportNode reportNode) {
// DC or AC, if no generator, network is dead
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we might want to add an option to allow computing islands without generators in DC

Copy link

Copy link
Member

@geofjamg geofjamg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jeandemanged ok for me to merge it as it is but:

  • maybe in the future we might have some users feeback to calculate DC components even without any generator. In that case we will add a parameter to allow it.
  • for our needs we will probably soon enrich components calculation criteria with additional checks like if slack distribution is on generator we need at least generator participating, if slack distribution is on loads we need at least one load etc.

@jeandemanged jeandemanged merged commit 058dcff into main May 14, 2024
6 checks passed
@jeandemanged jeandemanged deleted the dead_components branch May 14, 2024 14:17
Comment on lines +267 to +274
public static ReportNode createLfNetworkReportNode(ReportNode reportNode, ReportNode lfNetworkReportNode, int networkNumCc, int networkNumSc) {
ReportNode newReportNode = reportNode.newReportNode()
.withMessageTemplate("lfNetwork", "Network CC${networkNumCc} SC${networkNumSc}")
.withUntypedValue(NETWORK_NUM_CC, networkNumCc)
.withUntypedValue(NETWORK_NUM_SC, networkNumSc)
.add();
newReportNode.include(lfNetworkReportNode);
return newReportNode;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will need to be revisited at next powsybl-core bump because of powsybl/powsybl-core#3007

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is done in #1034.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants