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

Fix all voltage control outer loops #840

Merged
merged 14 commits into from
Sep 13, 2023
Merged

Fix all voltage control outer loops #840

merged 14 commits into from
Sep 13, 2023

Conversation

annetill
Copy link
Member

@annetill annetill commented Sep 4, 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, just a user that has report an issue on shunt outer loop. I think I have reproduce the issue on a real case from a file I have since many years (D10).

What kind of change does this PR introduce?

I have fixed the incremental shunt outer loop and verify on my use case. The transformer outer loops have been fixed by symmetry only. I am not able to reproduce the bug on real test cases. Unit tests must be added.

What is the current behavior?

What is the new behavior (if this is a feature change)?

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

  • The Breaking Change or Deprecated label has been added
  • The migration guide has been updated in the github wiki (What changes might users need to make in their application due to this PR?)

Other information:

Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
@@ -51,7 +51,7 @@ public void initialize(AcOuterLoopContext context) {
context.setData(contextData);

// All shunt voltage control are disabled for the first equation system resolution.
for (LfShunt shunt : getControllerShunts(context.getNetwork())) {
for (LfShunt shunt : ShuntVoltageControlOuterLoop.getControllerShunts(context.getNetwork())) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe an abstract class would be better.

double diffV = voltageControl.getTargetValue() - voltageControl.getControlledBus().getV();
List<LfShunt> sortedControllers = voltageControl.getMergedControllerElements().stream()
.filter(shunt -> !shunt.isDisabled() && shunt.hasVoltageControlCapability())
Copy link
Member Author

Choose a reason for hiding this comment

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

shunt.hasVoltageControlCapability() is not needed anymore because we get all the merged controller elements.

Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
.setR(1)
.setX(30)
.add();
createLine(network, b1, b2, "l12", 0.00);
Copy link
Member

Choose a reason for hiding this comment

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

This line is not on the network diagram. Is it on purpose?

Copy link
Member Author

Choose a reason for hiding this comment

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

I am going to fix the scheme but I need this line to have one synchronous component (and not two).

annetill and others added 2 commits September 6, 2023 08:38
Fix bbs ids for bus/breaker view.

Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
obrix and others added 3 commits September 6, 2023 11:00
Signed-off-by: Bertrand Rix <bertrand.rix@artelys.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
@annetill annetill changed the title [WIP] Fix transformator and shunt outer loops Fix all voltage control outer loops Sep 6, 2023
annetill and others added 2 commits September 6, 2023 12:26
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
@@ -23,7 +26,7 @@ public String getType() {

@Override
public void initialize(AcOuterLoopContext context) {
for (LfBranch controllerBranch : getControllerBranches(context.getNetwork())) {
for (LfBranch controllerBranch : (List<LfBranch>) context.getNetwork().getAllControllerElements(VoltageControl.Type.TRANSFORMER)) {
Copy link
Member Author

Choose a reason for hiding this comment

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

@geofjamg the unit test is different because of that change. On main branch, we activate the transformer voltage control of all branches that have one and that are not disabled. Even if there is a potential conflict with a generator voltage control (sometimes it works, sometimes KLU issue). Now, with this branch, we keep only the generator. It is what happens at first resolution, before contingency.

annetill and others added 2 commits September 13, 2023 08:48
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
@sonarcloud
Copy link

sonarcloud bot commented Sep 13, 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 1 Code Smell

92.9% 92.9% Coverage
0.0% 0.0% Duplication

protected OuterLoopStatus roundVoltageRatios(AcOuterLoopContext context) {
OuterLoopStatus status = OuterLoopStatus.STABLE;
for (LfBranch controllerBranch : getControllerBranches(context.getNetwork())) {
for (LfBranch controllerBranch : context.getNetwork().<LfBranch>getControllerElements(VoltageControl.Type.TRANSFORMER)) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Sometimes you have the cast and sometimes you don't have.

Copy link
Member

Choose a reason for hiding this comment

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

Yes sometimes the compiler can infer the type, sometimes not

@annetill annetill merged commit b8d0478 into main Sep 13, 2023
6 checks passed
@annetill annetill deleted the fix-outerloop-vc branch September 13, 2023 10:29
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.

4 participants