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

Fix secondary voltage control when branch disconnected at one side #747

Merged
merged 2 commits into from
Mar 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,12 @@ private static EquationTerm<AcEquationType, AcEquationType> getQ(LfShunt shunt)

MutableDouble sq = new MutableDouble();
for (LfBranch branch : controllerBus.getBranches()) {
if (branch.getBus1() == controllerBus) {
// we can skip branches disconnected at the other side
if (branch.getBus1() == controllerBus && branch.getBus2() != null) {
sq.add(getQ1(branch).calculateSensi(sensitivities, controlledBusSensiColumn));
} else if (branch.getBus2() == controllerBus) {
} else if (branch.getBus2() == controllerBus && branch.getBus1() != null) {
sq.add(getQ2(branch).calculateSensi(sensitivities, controlledBusSensiColumn));
}
// disconnected at the other side, we can skip
}

controllerBus.getShunt().ifPresent(shunt -> sq.add(getQ(shunt).calculateSensi(sensitivities, controlledBusSensiColumn)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,26 @@ void multiNoReactiveLimitsZonesTest() {
assertVoltageEquals(142, b4);
assertVoltageEquals(14.537, b10);
}

@Test
void testOpenBranchIssue() {
// open branch L6-13-1 on side 2 so that a neighbor branch of B6-G is disconnected to the other side
network.getLine("L6-13-1").getTerminal2().disconnect();

parameters.setUseReactiveLimits(false);
parametersExt.setSecondaryVoltageControl(true);

PilotPoint pilotPoint = new PilotPoint(List.of("B10"), 14.4);
network.newExtension(SecondaryVoltageControlAdder.class)
.addControlZone(new ControlZone("z1", pilotPoint, List.of(new ControlUnit("B6-G"),
new ControlUnit("B8-G"))))
.add();

var result = loadFlowRunner.run(network, parameters);
assertEquals(LoadFlowResult.ComponentResult.Status.CONVERGED, result.getComponentResults().get(0).getStatus());
assertEquals(4, result.getComponentResults().get(0).getIterationCount());
assertVoltageEquals(14.4, b10);
assertVoltageEquals(13, b6);
assertVoltageEquals(21.97, b8);
}
}