powsybl / powsybl-core

A framework to build power system oriented software
https://www.powsybl.org
Mozilla Public License 2.0
122 stars 40 forks source link

Operational limit sets #2110

Closed annetill closed 8 months ago

annetill commented 2 years ago

A feature.

For a line or a transformer, we have only one group (permanent limit + temporary limits for two sides) of each limit type (current, active power and apparent power) available in the core model, such as:

<currentLimits1 permanentLimit="580"/>
<currentLimits2 permanentLimit="580">
      <temporaryLimit name="N/A" value="734"/>
      <temporaryLimit name="IT105" acceptableDuration="6300" value="580"/>
      <temporaryLimit name="IT1" acceptableDuration="60"/>
</currentLimits2>

By definition, as we have only one group, it means that it is the active one. By active, we mean the one that has to be considered by the analysis tools (security analysis for example).

In some studies (network development) or operational context (CGMES), we can have a set of operational limits. The season can be important to consider, the day vs the night, and many other factor that can lead to store a set of limits and not one, and let the user chooses the active set.

This leads to a new version of IIDM (1.12).

Note that we must think about additional information in CurrentLimits, but not in that PR:

(if a question doesn't apply, you can delete it)

annetill commented 11 months ago

No merge of Miora's PR, @colinepiloquet starts a new PR but keep the name of Miora for the new files.

flo-dup commented 9 months ago

After some further discussion with @annetill and @geofjamg, we agreed on the following:

EDIT: replace active keyword in group by default keyword

flo-dup commented 9 months ago

@annetill @geofjamg don't hesitate to correct me if I didn't transcribe correctly our discussion

flo-dup commented 9 months ago

Trying to be more precise:

pjeanmarie commented 8 months ago

If there is no API to remove a group do I remove a group when there is no more limits inside? Also do we want an API to cancel default group of limits without having to remove all its limits? (see TODO in test)

olperr1 commented 8 months ago

@pjeanmarie: I think it is best to keep the OperationalLimitsGroup when it is empty, and to add methods removing an OperationalLimitsGroup from its id in lines/transformers/... . For instance, if someone wants to remove the currentLimits and change the apparentPowerLimits of a group, calling removeCurrentLimits(...) then setApparentPowerLimits(...) may have a different behaviour depending on the content of the activePowerLimits (if there are no apparentPowerLimits and no activePowerLimits, the setApparentPowerLimits(...) won't work).

Maybe we could add an isEmpty method in OperationalLimitsGroup to check if the operationalLimitsGroup should be removed (and change the return type of the removeXxxLimits methods to boolean, to indicate whether the resulting group is empty or not).

When removing a whole OperationalLimitsGroup, if it was the default one, defaultLimitsId should be set to null.

And you're right, it is interesting to expose cancelDefaultOperationalLimitsGroup() methods.

pjeanmarie commented 8 months ago

@olperr1 Based on spec given by @flo-dup , this is proposition of change in iidm: Example with Line: