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

Handle slack distribution failure behavior in DC Load Flow #1146

Merged
merged 17 commits into from
Dec 12, 2024

Conversation

SylvestreSakti
Copy link
Contributor

@SylvestreSakti SylvestreSakti commented Dec 6, 2024

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?

The parameter slackDistributionFailureBehavior is now taken into account in DC load flow mode which wasn't the case.

What is the current behavior?

No use of the parameter slackDistributionFailureBehavior for DC load flow

What is the new behavior (if this is a feature change)?
Using the parameter slackDistributionFailureBehavior for DC load flow

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

  • Yes
  • No

Signed-off-by: Damien Jeandemange <damien.jeandemange@artelys.com>
@jeandemanged jeandemanged force-pushed the dc_slack_distribution_failure_behavior_fail branch from 14665d2 to 36dc40a Compare December 11, 2024 16:53
@jeandemanged jeandemanged changed the base branch from main to fix-active-power-distribution-reports December 11, 2024 16:53
@jeandemanged jeandemanged force-pushed the dc_slack_distribution_failure_behavior_fail branch from 6bb3947 to 36d804d Compare December 11, 2024 16:55
jeandemanged and others added 11 commits December 11, 2024 18:51
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>
…lowResult

Signed-off-by: PRABAKARAN Sylvestre <sylvestre.prabakaran@rte-france.com>
Signed-off-by: PRABAKARAN Sylvestre <sylvestre.prabakaran@rte-france.com>
Signed-off-by: PRABAKARAN Sylvestre <sylvestre.prabakaran@rte-france.com>
Signed-off-by: PRABAKARAN Sylvestre <sylvestre.prabakaran@rte-france.com>
Signed-off-by: PRABAKARAN Sylvestre <sylvestre.prabakaran@rte-france.com>
Signed-off-by: PRABAKARAN Sylvestre <sylvestre.prabakaran@rte-france.com>
Signed-off-by: PRABAKARAN Sylvestre <sylvestre.prabakaran@rte-france.com>
Signed-off-by: Damien Jeandemange <damien.jeandemange@artelys.com>
@jeandemanged jeandemanged force-pushed the dc_slack_distribution_failure_behavior_fail branch from 36d804d to 30b29e8 Compare December 11, 2024 18:18
Signed-off-by: Damien Jeandemange <damien.jeandemange@artelys.com>
Base automatically changed from fix-active-power-distribution-reports to main December 12, 2024 12:13
…avior_fail

# Conflicts:
#	src/main/java/com/powsybl/openloadflow/ac/outerloop/DistributedSlackOuterLoop.java
#	src/main/java/com/powsybl/openloadflow/network/util/ActivePowerDistribution.java
@jeandemanged jeandemanged force-pushed the dc_slack_distribution_failure_behavior_fail branch from 9dec4c9 to 5331ad0 Compare December 12, 2024 12:32
@jeandemanged jeandemanged changed the title [WIP] Handling of slack distribution failure behavior in DC mode Handle slack distribution failure behavior in DC Load Flow Dec 12, 2024
distributedActivePower = distributeSlack(network, network.getBuses(), parameters.getBalanceType(), parameters.getNetworkParameters().isUseActiveLimits());
LoadFlowParameters.BalanceType balanceType = parameters.getBalanceType();
boolean useActiveLimits = parameters.getNetworkParameters().isUseActiveLimits();
ActivePowerDistribution activePowerDistribution = ActivePowerDistribution.create(balanceType, false, useActiveLimits);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can't we use the distributeSlack() method to avoid duplication ? The output of distributeSlack() is not used anywhere else (in WoodburyEngine the method is called without using its output) so it can be changed to return the result variable

Copy link
Member

Choose a reason for hiding this comment

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

I inlined it to avoid a double-call to getActivePowerMismatch, indeed we should perhaps move distributeSlack() to Woodbury, and create an issue about usage of slack distribution failure behavior in Woodbury engine

}

@Test
void testSlackDistributionDisabledResults() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can be done with a @ParameterizedTest ?

Copy link
Member

Choose a reason for hiding this comment

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

done

Signed-off-by: Damien Jeandemange <damien.jeandemange@artelys.com>
@vidaldid-rte vidaldid-rte merged commit 714b35e into main Dec 12, 2024
8 checks passed
@vidaldid-rte vidaldid-rte deleted the dc_slack_distribution_failure_behavior_fail branch December 12, 2024 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants