Skip to content
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

Improve transformer voltage control AFTER_GNERATOR_VOLTAGE_CONTROL #1032

Merged
merged 42 commits into from
Jul 2, 2024

Conversation

vidaldid-rte
Copy link
Collaborator

@vidaldid-rte vidaldid-rte commented May 17, 2024

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce?
In order to provide a ratio tap change simulation that better matches our Network we introduce the following evolutions to the AfterVoltageControlOuterLoop:

  • Taps are not discretized before all taps are within their operating range. Instead, if a continuous ratio is outside of operating range, it is discretized at its limit and a loadflow is run again to update the continous ratios.
  • A new parameter ("transformerVoltageControlUseInitialTapPosition") minimize the tap changes in the following way:
    • If the voltage of a bus of parallel tranformers is within range, the taps of the parallel transformers are not changed, even if they are not the closest tap to the continuous ratio.
    • If the tap need to be changed but parallel transformers have different ratios initially, the difference is kept at discretization.
    • This simulates the behavior of independent automates for parallel transformers. Additionally it can preserve some ration misalignment that could be done on purpose to consume some reactive power (due to a reactive current loop created by parallel transformers with misaligned ratios)
    • If the mode is enabled, transformer that have no group controlling tension above them that is PV at computation time are excluded from tap computation.
  • The parameter "generatorVoltageControlMinNominalVoltage" (introduced in Fix transformer voltage control outer loop AFTER GENERATOR #1038 ) is used to define the nominal voltage below which generators are set to PQ while continuous ratio are computed.
  • Additionnally, generators that are just behind a step-up transformer that is above the limit continue to control voltage. This enable to support network models where generators are separated from the transformer connecting them to the network.

The default value of the new parameter (transformerVoltageControlUseInitialTapPosition) keep a behavior close to the previous behavior of TransformerVoltageControlOuterLoop.

What is the current behavior?

What is the new behavior (if this is a feature change)?
With current default of new parameters, almost same as before.
If transformerVoltageControlStable is set to true, simulation much closer to actual behaviour of our network.

Does this PR introduce a breaking change or deprecate an API?

  • Yes
  • No

What changes might users need to make in their application due to this PR? (migration steps)

…overage of new code

Signed-off-by: VIDAL Didier (Externe) <didier.vidal_externe@rte-france.com>
@vidaldid-rte vidaldid-rte changed the title [WIP] Improve taptuning in TransformerVoltageControlOuterLoop [WIP] Improve tap tuning in TransformerVoltageControlOuterLoop May 17, 2024
Signed-off-by: VIDAL Didier (Externe) <didier.vidal_externe@rte-france.com>
Signed-off-by: VIDAL Didier (Externe) <didier.vidal_externe@rte-france.com>
Signed-off-by: VIDAL Didier (Externe) <didier.vidal_externe@rte-france.com>
Signed-off-by: VIDAL Didier (Externe) <didier.vidal_externe@rte-france.com>
Signed-off-by: VIDAL Didier (Externe) <didier.vidal_externe@rte-france.com>
Signed-off-by: VIDAL Didier (Externe) <didier.vidal_externe@rte-france.com>
Signed-off-by: VIDAL Didier (Externe) <didier.vidal_externe@rte-france.com>
Signed-off-by: VIDAL Didier (Externe) <didier.vidal_externe@rte-france.com>
…hooting

Signed-off-by: VIDAL Didier (Externe) <didier.vidal_externe@rte-france.com>
Signed-off-by: VIDAL Didier (Externe) <didier.vidal_externe@rte-france.com>
Signed-off-by: VIDAL Didier (Externe) <didier.vidal_externe@rte-france.com>
Signed-off-by: VIDAL Didier (Externe) <didier.vidal_externe@rte-france.com>
Signed-off-by: VIDAL Didier (Externe) <didier.vidal_externe@rte-france.com>
@vidaldid-rte vidaldid-rte changed the title [WIP] Improve tap tuning in TransformerVoltageControlOuterLoop Improve tap tuning in TransformerVoltageControlOuterLoop May 17, 2024
Copy link
Member

@jeandemanged jeandemanged left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a first rough diagonal review ... will look into it more in detail later on

vidaldid-rte and others added 4 commits May 31, 2024 16:30
Signed-off-by: VIDAL Didier (Externe) <didier.vidal_externe@rte-france.com>
Signed-off-by: VIDAL Didier (Externe) <didier.vidal_externe@rte-france.com>
Signed-off-by: VIDAL Didier (Externe) <didier.vidal_externe@rte-france.com>
Copy link
Member

@annetill annetill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To start to talk!

private double getMaxControlledNominalVoltage() {
return maxControlledNominalVoltage;
}
private GroupVoltageControlManager groupVoltageControlManager;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand that grouping transformer is not an option.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed to GeneratorVoltageControlManager. Some French jumped in the initial name.

}
}

private boolean isBusBehindVeryHighVoltageTransfo(LfBus bus, double limit) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need this method? If the controlled bus is higher that the nominal voltage limit, is it not enough? Because this part is really specific and maybe works only for our network.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Must be void

/**
* @author Didier Vidal {@literal <didier.vidal-ext at rte-france.com>}
*/
public class GroupVoltageControlManager {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why you need a dedicated class for that, and with Group inside the name: I don't see the link with group here. And all of this is not optional so for me it should be in TransformerVoltageControlOuterLoop.

@annetill
Copy link
Member

I think this PR should be separated in two PRs:

  • If I understand well your code, the new parameter "stable" is only used by TransformerRatioManager. So if I understand well, it is just a parameter that proposes a different management of parallel transformers. If yes, this should be in a dedicated PR.
  • The rest of the code impacts the main behavior and should be in a dedicated PR. And as I mention in my review, I don't understand why we introduce the class GroupVoltageControlManager.

vidaldid-rte and others added 4 commits June 12, 2024 10:56
…r name and enable json serde

Signed-off-by: VIDAL Didier (Externe) <didier.vidal_externe@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
this.minNominalVoltageLimit = limitOverride < 0 ? calculateMaxControlledNominalVoltage(network) : limitOverride;
}

private static double calculateMaxControlledNominalVoltage(LfNetwork network) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have a consistent name with the minNominalVoltageLimit and decide if it is a min or a max.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done
-> computeDefaultMinNominalVoltageLimit

* Disables the voltage control of generators if controlled bus nominal voltage is under the limit.
*/
public void disableGeneratorVoltageControlsUnderMaxControlledNominalVoltage(LfNetwork network) {
for (LfBus bus : network.getControlledBuses(VoltageControl.Type.GENERATOR)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clear the disabledControllerBuses before ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. I hesitated between a clear and an IllegalStateException if list not empty...
Opted for a clear with a comment in code that this use case of multiple calls was not the initial design intention and was not tested.

}
}

private boolean isBusBehindVeryHighVoltageTransfo(LfBus bus, double limit) {
Copy link
Member

@geofjamg geofjamg Jun 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

=> isBusBehindStepupTransformer?
Indeed we can improve the check by

  • checking that the branch is a transformer steping up the voltage
  • multiple transformers starting from stator bus ?

}
}

private final Map<String, Pair<Double, SharedControl>> sharedControlByBranchId = new HashMap<>();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using this Pair (not really readable) why not moving the r1 to SharedControl ? Just for using a record ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because as far as I understand a shared control is shared between the branches of a shared control, so the object is shared too.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, right. So maybe we should have another class to embed the SharedControl and its r1 value

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pair is often considered as a poor design choice and should try to avoid it in OLF

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was a record initially. Doesn't change much. What we need is a multikey.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed I removed it because the good naming was not so easy.

annetill and others added 7 commits June 20, 2024 18:35
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Didier Vidal <didier.vidal_externe@rte-france.com>
Signed-off-by: Didier Vidal <didier.vidal_externe@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Didier Vidal <didier.vidal_externe@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Didier Vidal <didier.vidal_externe@rte-france.com>
vidaldid-rte and others added 5 commits June 28, 2024 15:12
Signed-off-by: Didier Vidal <didier.vidal_externe@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Didier Vidal <didier.vidal_externe@rte-france.com>
Copy link

sonarqubecloud bot commented Jul 2, 2024

@annetill annetill changed the title Improve tap tuning in TransformerVoltageControlOuterLoop Improve transformer voltage control AFTER_GNERATOR_VOLTAGE_CONTROL Jul 2, 2024
@jeandemanged jeandemanged dismissed their stale review July 2, 2024 09:24

dismiss

@annetill annetill merged commit b4c0e21 into main Jul 2, 2024
7 checks passed
@annetill annetill deleted the tap_update_algo branch July 2, 2024 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants