powsybl / powsybl-open-rao

A toolbox based on powsybl framework dedicated to power systems coordinated capacity calculation and security analysis projects
Mozilla Public License 2.0
17 stars 6 forks source link

Fix OnFlowConstraintInCountry with contingency interpretation in RAO #1004

Closed pet-mit closed 6 months ago

pet-mit commented 6 months ago

Please check if the PR fulfills these requirements

What kind of change does this PR introduce?

Bug fix

What is the current behavior?

PR https://github.com/powsybl/powsybl-open-rao/pull/987 introduced a new way of filtering on contingency before applying an RA that is available after a constraint in a given country. The new behavior made the usage rule be validated against constraints on CNECs linked to that contingency.
However, no check was made as to what state the RA is being applied in. Thus, if applying in one state while having a flow result containting CNECs from other states, the RA can be applied after a contingency it was not meant for.

What is the new behavior (if this is a feature change)? Now the RA is only available if the state of application corresponds to its contingency.