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

Support of static var compensator with VoltagePerReactivePowerControl extension #304

Merged
merged 48 commits into from
Jun 29, 2021

Conversation

annetill
Copy link
Member

@annetill annetill commented May 6, 2021

Please check if the PR fulfills these requirements (please use '[x]' to check the checkboxes, or submit the PR and then click the checkboxes)

  • 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)

Does this PR already have an issue describing the problem ? If so, link to this issue using '#XXX' and skip the rest

Yes, issue #97

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

If a unique static var compensator with non-zero slope is connected to a bus, regulating voltage locally, the slope attribute is taken into account. I have to increase the unit testing because the more complexe thing in that PR is to deal with all the configurations of generators connected to that bus: with or without slope, regulating voltage or reactive power.

What is the current behavior? (You can also link to an open issue here)

The slope is ignored.

What is the new behavior (if this is a feature change)?

If a unique static var compensator with non-zero slope is connected to a bus, regulating voltage locally, the slope attribute is taken into account.

Does this PR introduce a breaking change or deprecate an API? If yes, check the following:

  • The Breaking Change or Deprecated label has been added
  • The migration guide has been updated in the github wiki (What changes might users need to make in their application due to this PR?)

Other information:

(if any of the questions/checkboxes don't apply, please delete them entirely)

annetill added 8 commits May 5, 2021 08:28
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Add switch PV to PQ.

Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
@annetill
Copy link
Member Author

@annetill Note for that PR: the bus to which the static var compensator is connected is initialized with the nominal voltage. It could be better to start from the targetV value.

Signed-off-by: Hadrien <hadrien.godard@artelys.com>
…tionTerm

Signed-off-by: Hadrien <hadrien.godard@artelys.com>
Signed-off-by: Hadrien <hadrien.godard@artelys.com>
Signed-off-by: Hadrien <hadrien.godard@artelys.com>
Copy link
Member Author

@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.

Changes requested. I think that you have to do what is done in method createReactivePowerDistributionEquations. You will start with exactly the same lines:

LfBus firstControllerBus = controllerBuses.get(0); // indeed in our case it is aslo the controlled bus.
List<EquationTerm> controllerBusReactiveTerms = createReactiveTerms(firstControllerBus, variableSet, creationParameters);

Then you have to get the slope and the BUS_V term too. Please put of all of that in a dedicated function. In the target vector, you have to use: the ideal targetV, controllerBus.getLoadTargetQ(), controllerBus.getGenerationTargetQ() and try to use DistributionData to store the slope from the equation system to the target evctor. It will be useful later to support several SVCs with slope connected at the same bus.

@@ -364,6 +366,15 @@ private static void createImpedantBranch(LfBranch branch, LfBus bus1, LfBus bus2
}
sq1.addTerm(q1);
branch.setQ1(q1);
// Add term slope * Q for svc
Copy link
Member Author

Choose a reason for hiding this comment

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

Can you introduce an utility method that will be called here and just below? It will make the code more comprehensive.

@annetill annetill mentioned this pull request Jun 1, 2021
3 tasks
Hadrien-Godard and others added 4 commits June 2, 2021 15:03
…f buses with a single SVC with a slope.

Signed-off-by: Hadrien <hadrien.godard@artelys.com>
Signed-off-by: Hadrien <hadrien.godard@artelys.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
@annetill
Copy link
Member Author

annetill commented Jun 3, 2021

@Hadrien-Godard I am going to rebase the branch on master. The work is not finished because our controller bus with slope can switch PV to PQ, but I think we have to avoid switching them back from PQ to PV in a first approach.

Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
@Hadrien-Godard
Copy link
Member

Hadrien-Godard commented Jun 3, 2021

@Hadrien-Godard I am going to rebase the branch on master. The work is not finished because our controller bus with slope can switch PV to PQ, but I think we have to avoid switching them back from PQ to PV in a first approach.

I think we can let them switch PV to PQ in the same manner as classic PV buses.

Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
@annetill annetill changed the title [WIP] Support of static var compensator with VoltagePerReactivePowerControl extension Support of static var compensator with VoltagePerReactivePowerControl extension Jun 3, 2021
@annetill annetill requested a review from flo-dup June 3, 2021 10:19
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
annetill and others added 3 commits June 8, 2021 10:37
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Fix check.

Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
@@ -61,6 +61,8 @@ private static void createVoltageControls(LfNetwork lfNetwork, List<LfBus> lfBus
List<LfGenerator> voltageControlGenerators = controllerBus.getGenerators().stream().filter(LfGenerator::hasVoltageControl).collect(Collectors.toList());
Copy link
Member Author

Choose a reason for hiding this comment

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

Here we just have the generators linked to a controller bus. But, what happens in the case where we have two controller buses with each one SVC with slope ? We don't support that configuration too.

// we don't support several generators controlling voltage with slope
LOGGER.warn("Non supported: several generators of bus {} control voltage with slope. Slope is therefore deactivated on those generators.", controllerBus);
}
voltageControlGenerators.forEach(g -> g.setSlope(0));
Copy link
Member Author

Choose a reason for hiding this comment

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

Why we don't keep one finally ?

annetill and others added 3 commits June 15, 2021 14:42
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>

VoltageControl voltageControl = controlledBus.getVoltageControl().orElse(new VoltageControl(controlledBus, controllerTargetV));
voltageControl.addControllerBus(controllerBus);
voltageControls.forEach(LfNetworkLoaderImpl::checkGeneratorsWithSlope);
Copy link
Member Author

Choose a reason for hiding this comment

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

You can not do that if the parameter is not active, it will be a loss in performances.

flo-dup and others added 6 commits June 21, 2021 10:38
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
@@ -60,6 +63,9 @@ public double getMaxQ(double p) {
if (svc.getRegulationMode() == StaticVarCompensator.RegulationMode.VOLTAGE) {
setVoltageControl(svc.getVoltageSetpoint(), svc.getRegulatingTerminal(), breakers, report);
}
if (svc.getExtension(VoltagePerReactivePowerControl.class) != null) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed, as we have the parameter in LfNetworkParameters, why we don't use it here? If it is false, can we set the slope to zero?

annetill and others added 2 commits June 22, 2021 15:12
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
LfBus controllerBus = controllerBuses.iterator().next();
if (!controllerBus.isVoltageControllerEnabled()) {
// we only support one controlling static var compensator without any other controlling generators
equationSystem.createEquation(controlledBus.getNum(), EquationType.BUS_V_SLOPE).setActive(false);
Copy link
Member

Choose a reason for hiding this comment

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

There is no criteria to switch it on?

annetill and others added 7 commits June 28, 2021 11:38
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

90.3% 90.3% Coverage
0.0% 0.0% Duplication

@flo-dup flo-dup merged commit 9396b5d into master Jun 29, 2021
@flo-dup flo-dup deleted the svc-slope branch June 29, 2021 07:59
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