Skip to content

Commit

Permalink
Revert
Browse files Browse the repository at this point in the history
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
  • Loading branch information
geofjamg committed Nov 17, 2024
1 parent 6fa1020 commit 1557c2c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import com.powsybl.openloadflow.graph.GraphConnectivityFactory;
import com.powsybl.openloadflow.network.*;
import com.powsybl.openloadflow.network.impl.LfNetworkLoaderImpl;
import com.powsybl.openloadflow.network.util.UniformValueVoltageInitializer;
import org.apache.commons.lang3.mutable.MutableInt;
import org.jgrapht.Graph;
import org.jgrapht.graph.Pseudograph;
Expand Down Expand Up @@ -76,7 +77,7 @@ public static Set<String> findElementsToDiscardFromVoltageControl(Network networ
.create();
try (var j = new AcJacobianMatrix(equationSystem, matrixFactory, lfNetwork)) {
var result = new RemoteVoltageTargetChecker(lfNetwork, equationSystem, j)
.check(new RemoteVoltageTargetCheckerParameters(acParameters.getMatrixFactory(), acParameters.getVoltageInitializer()));
.check(new RemoteVoltageTargetCheckerParameters(acParameters.getMatrixFactory()));
for (var incompatibleTarget : result.getIncompatibleTargets()) {
LfBus controlledBus1 = incompatibleTarget.controlledBus1();
LfBus controlledBus2 = incompatibleTarget.controlledBus2();
Expand Down Expand Up @@ -171,7 +172,7 @@ private EquationTerm<AcEquationType, AcEquationType> getCalculatedV(LfBus contro
private void checkUnrealisticTargets(RemoteVoltageTargetCheckerParameters parameters,
List<LfBus> generatorControlledBuses,
RemoteVoltageTargetCheckResult result) {
AcSolverUtil.initStateVector(network, equationSystem, parameters.getVoltageInitializer());
AcSolverUtil.initStateVector(network, equationSystem, new UniformValueVoltageInitializer());

// calculate target voltage to calculated voltage sensibilities
var busNumToSensiColumn = LfBus.buildIndex(new ArrayList<>(generatorControlledBuses));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,14 @@ public class RemoteVoltageTargetCheckerParameters {

private MatrixFactory matrixFactory;

private VoltageInitializer voltageInitializer;

private int controlledBusNeighborsExplorationDepth = CONTROLLED_BUS_NEIGHBORS_EXPLORATION_DEPTH_DEFAULT_VALUE;

private double targetVoltagePlausibilityIndicatorThreshold = TARGET_VOLTAGE_PLAUSIBILITY_THRESHOLD_DEFAULT_VALUE;

private double controllerBusAcceptableVoltageDrop = CONTROLLER_BUS_ACCEPTABLE_VOLTAGE_SHIFT_DEFAULT_VALUE; // shift from 1 pu

public RemoteVoltageTargetCheckerParameters(MatrixFactory matrixFactory, VoltageInitializer voltageInitializer) {
public RemoteVoltageTargetCheckerParameters(MatrixFactory matrixFactory) {
this.matrixFactory = Objects.requireNonNull(matrixFactory);
this.voltageInitializer = Objects.requireNonNull(voltageInitializer);
}

public MatrixFactory getMatrixFactory() {
Expand All @@ -46,14 +43,6 @@ public void setMatrixFactory(MatrixFactory matrixFactory) {
this.matrixFactory = Objects.requireNonNull(matrixFactory);
}

public VoltageInitializer getVoltageInitializer() {
return voltageInitializer;
}

public void setVoltageInitializer(VoltageInitializer voltageInitializer) {
this.voltageInitializer = Objects.requireNonNull(voltageInitializer);
}

public int getControlledBusNeighborsExplorationDepth() {
return controlledBusNeighborsExplorationDepth;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,7 @@ public void initialize(AcOuterLoopContext context) {
new RemoteVoltageTargetChecker(context.getNetwork(),
loadFlowContext.getEquationSystem(),
loadFlowContext.getJacobianMatrix())
.fix(new RemoteVoltageTargetCheckerParameters(loadFlowContext.getParameters().getMatrixFactory(),
loadFlowContext.getParameters().getVoltageInitializer()));
.fix(new RemoteVoltageTargetCheckerParameters(loadFlowContext.getParameters().getMatrixFactory()));
}
context.setData(new ContextData());
}
Expand Down

0 comments on commit 1557c2c

Please sign in to comment.