-
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
Refactor discrete voltage control #413
Conversation
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
# Conflicts: # src/main/java/com/powsybl/openloadflow/ac/equations/AcEquationSystem.java # src/main/java/com/powsybl/openloadflow/network/AbstractElement.java # src/main/java/com/powsybl/openloadflow/network/AbstractLfNetworkListener.java # src/main/java/com/powsybl/openloadflow/network/LfNetworkListener.java
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
# Conflicts: # src/main/java/com/powsybl/openloadflow/ac/TransformerVoltageControlOuterLoop.java # src/main/java/com/powsybl/openloadflow/ac/equations/AcEquationSystem.java # src/main/java/com/powsybl/openloadflow/ac/equations/AcEquationSystemUpdater.java # src/main/java/com/powsybl/openloadflow/ac/equations/AcEquationType.java # src/main/java/com/powsybl/openloadflow/network/impl/AbstractLfBus.java # src/test/java/com/powsybl/openloadflow/equations/EquationSystemTest.java
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
LfBranch controllerBranch = controllerBranches.get(i); | ||
|
||
// activate all rho1 equations if voltage control is off | ||
equationSystem.getEquation(controllerBranch.getNum(), AcEquationType.BRANCH_TARGET_RHO1) |
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.
Just to be sure that I understand well: here, later, I will have to take into account the local status of the branch controller, especially if the transformer is at its limits? But for now, we only use the status of the controlled bus.
In my previous tests, I have met a contingency that makes me lost one of the controller branches. This is supported by that PR ?
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
@@ -755,4 +755,66 @@ void testSAmodeACAllBranchMonitoredFlowTransfer() { | |||
assertEquals(1.66, brl14l13.getP1(), 1e-2); | |||
assertEquals(0.66, brl14l13.getFlowTransfer(), 1e-2); | |||
} | |||
|
|||
@Test | |||
void testSAWithRemoteSharedControl() { |
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 is not working, look at the logs.
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 fixed it. We now have to unit test post contingency reactive power using monitors.
@Test | ||
void testSAWithTransformerRemoteSharedControl() { | ||
// FIXME | ||
Network network = VoltageControlNetworkFactory.createWithTransformerSharedRemoteControl(); |
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 not sure that it is working because in post contingency, we have no transformer voltage control at all. It is totally removed.
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
// post-contingency tests | ||
PostContingencyResult postContingencyResult = result.getPostContingencyResults().stream().filter(r -> r.getContingency().getId().equals("T2wT")).findFirst().get(); | ||
assertEquals("T2wT", postContingencyResult.getContingency().getId()); | ||
assertEquals(0.0, postContingencyResult.getBranchResult("T2wT2").getQ2(), 1e-2); // FIXME |
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 have tried to solve it before #316
# Conflicts: # src/main/java/com/powsybl/openloadflow/ac/equations/AcEquationSystem.java # src/main/java/com/powsybl/openloadflow/ac/equations/AcEquationSystemUpdater.java # src/main/java/com/powsybl/openloadflow/network/VoltageControl.java
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
} | ||
|
||
@Test | ||
void testSAWithShuntRemoteSharedControl() { |
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 here I don't understand the post contingency value at transformer tr3. Furthermore, if simul shunt is at false, I have a KLU issue...
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 don't have the KLU issue on my side
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
@annetill there is a lot remaining issues with transformer voltage control in SA, but maybe we could just merge this PR as it is (which is far better that main branch) and improve with new PRs? (The initial goal of this PR was just to avoid removing equations) |
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
} | ||
|
||
@Test | ||
void testSaWithTransformerRemoteSharedControl() { |
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 we should remove the "remote" word as it does not make sense for transformer voltage control?
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.
Why? It is a remote control...
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.
ok
LoadFlowParameters lfParameters = new LoadFlowParameters() | ||
.setTransformerVoltageControlOn(true); | ||
|
||
List<Contingency> contingencies = allBranches(network); |
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.
When we change this line to only simulate T2wT2 contingency, we don't have same result, which probably means we don't restore state correctly after contingencies
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.
We should keep this as an issue that will be resolved in a dedicate PR.
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.
Fixed in this PR, see last commit.
SonarCloud Quality Gate failed. |
Signed-off-by: Geoffroy Jamgotchian geoffroy.jamgotchian@gmail.com
Please check if the PR fulfills these requirements (please use
'[x]'
to check the checkboxes, or submit the PR and then click the checkboxes)Does this PR already have an issue describing the problem ? If so, link to this issue using
'#XXX'
and skip the restNo
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Refactoring
What is the current behavior? (You can also link to an open issue here)
To change a discrete voltage control mode, we need to remove and re-create equations
What is the new behavior (if this is a feature change)?
We only need to active/deactivate some equations
Does this PR introduce a breaking change or deprecate an API? If yes, check the following:
Other information:
(if any of the questions/checkboxes don't apply, please delete them entirely)