-
Notifications
You must be signed in to change notification settings - Fork 11
Fix generationTargetQ freezing and invalidating for LfBus #1334
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
base: main
Are you sure you want to change the base?
Conversation
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>
…ageControlEnabled in higher level methods setVoltageControlEnabled and freezeGenerationTargetQ Signed-off-by: PRABAKARAN Sylvestre <sylvestre.prabakaran@rte-france.com>
src/main/java/com/powsybl/openloadflow/network/impl/AbstractLfBus.java
Outdated
Show resolved
Hide resolved
src/main/java/com/powsybl/openloadflow/network/impl/AbstractLfBus.java
Outdated
Show resolved
Hide resolved
Signed-off-by: PRABAKARAN Sylvestre <sylvestre.prabakaran@rte-france.com>
Signed-off-by: PRABAKARAN Sylvestre <sylvestre.prabakaran@rte-france.com>
|
vidaldid-rte
left a comment
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 seems to fix the current bug and make the API more robust. I did not see any other difference introduced with previous behaviour.
The API (although names may be modified) reflects well the three states of the bus regarding Q computation, the transitions, and the need to invalidate the cache that si common to frozen state (Q determined by the diagram), and unregulating state where Q is controlled by the generator's reactive target).



Please check if the PR fulfills these requirements
Does this PR already have an issue describing the problem?
No
What kind of change does this PR introduce?
#1240 introduced a new formalism for bus targetQ updating. This new formalism was not correctly applied for secondary voltage control, triggering an exception when restoring a bus state that has been modified with secondary voltage control outer loop.
com.powsybl.commons.PowsyblException: Generation targetQ cannot be frozen if generatorVoltageControl is enabledThis fix led to a refactoring to avoid such errors
What is the current behavior?
The exception is thrown
What is the new behavior (if this is a feature change)?
When activating voltage control, targetQ is correctly invalidated by the secondary voltage control outer loop, there is no exception.
Moreover, to avoid this kind of mistake, the methods
invalidateGenerationTargetQ()andsetGenerationVoltageControlEnabled(bool)are now private. Outside the classAbstractLfBus, we can use :setGeneratorVoltageControlEnabledAndRecomputeTargetQ(bool): activates or deactivates generationVoltageControl and invalidates targetQ (if targetQ was frozen, it turns unfrozen)freezeGenerationTargetQAndDisableGeneratorVoltageControl(double): deactivates generatorVoltageControl and freezes targetQ (used to switch a bus from PV to PQ)Two test cases are introduced :
1 - The exception throwing case due to Secondary Voltage Control Outer loop
2 - An uncovered corner case : Security Analysis with a contingency on a generator that switched PV -> PQ in the base case
Does this PR introduce a breaking change or deprecate an API?