-
Notifications
You must be signed in to change notification settings - Fork 8
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
Conversation
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
src/main/java/com/powsybl/openloadflow/ac/equations/AcEquationSystemCreator.java
Outdated
Show resolved
Hide resolved
...n/java/com/powsybl/openloadflow/ac/outerloop/AbstractTransformerVoltageControlOuterLoop.java
Outdated
Show resolved
Hide resolved
@@ -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())) { |
There was a problem hiding this comment.
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()) |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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).
Fix bbs ids for bus/breaker view. Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
src/main/java/com/powsybl/openloadflow/network/impl/LfBusImpl.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Bertrand Rix <bertrand.rix@artelys.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
…-open-loadflow into fix-outerloop-vc
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
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)) { |
There was a problem hiding this comment.
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.
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Kudos, SonarCloud Quality Gate passed! |
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)) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
Please check if the PR fulfills these requirements
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?
Other information: