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

Avoid slack distribution to fictitious loads #1028

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

caioluke
Copy link
Member

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)

What kind of change does this PR introduce?

Feature.

What is the current behavior?

Currently, LfLoads do not have the method isFictitious like LfGenerators do. Therefore, when distributing slack on loads, we do not take into account if its fictitious or not.

What is the new behavior (if this is a feature change)?
Avoid slack distribution to fictitious loads.

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

  • Yes
  • No

@caioluke caioluke requested a review from annetill May 10, 2024 10:26
caioluke and others added 7 commits June 3, 2024 17:27
# Conflicts:
#	src/test/java/com/powsybl/openloadflow/ac/DistributedSlackOnLoadTest.java
Signed-off-by: Caio Luke <[email protected]>
Signed-off-by: Caio Luke <[email protected]>
Signed-off-by: Caio Luke <[email protected]>
Copy link

sonarcloud bot commented Jun 10, 2024

@annetill
Copy link
Member

Applying a contingency:

for (var e : lostLoads.entrySet()) {
    LfLoad load = e.getKey();
    LfLostLoad lostLoad = e.getValue();
    PowerShift shift = lostLoad.getPowerShift();
    load.setTargetP(load.getTargetP() - getUpdatedLoadP0(load, balanceType, shift.getActive(), shift.getVariableActive()));
    load.setTargetQ(load.getTargetQ() - shift.getReactive());
    load.setAbsVariableTargetP(load.getAbsVariableTargetP() - Math.abs(shift.getVariableActive()));
    lostLoad.getOriginalIds().forEach(loadId -> load.setOriginalLoadDisabled(loadId, true));
}

Here, the idea is to remove the effect of a load on a bus. If the load is fictitious, be careful:

  • Is the shift ok for a fictitious load, knowing that the variable part is used for slack distribution.
  • The updated load P0 that reflects the slack bus distribution on pre-contingency state must adapted?
  • The abs variable targetP must be adapted?
    If you prefer, you can do a unit test on a LfNetwork and applying a contingency and check the values. See LfNetworkTest.

Same analysis must be done for actions.

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.

None yet

2 participants