Skip to content

Commit

Permalink
Clean after sonar analysis.
Browse files Browse the repository at this point in the history
Signed-off-by: Anne Tilloy <[email protected]>
  • Loading branch information
annetill committed Jan 23, 2024
1 parent 01e3fa7 commit 9df1b92
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,6 @@ public Set<LfGenerator> getLostGenerators() {
return lostGenerators;
}

public Set<LfHvdc> getHvdcsWithoutPower() {
return hvdcsWithoutPower;
}

public Set<String> getDisconnectedElementIds() {
return disconnectedElementIds;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,5 @@ public interface LfVscConverterStation extends LfGenerator {

double getLossFactor();

double getInitialTargetP();

void setHvdc(LfHvdc hvdc);
}
Original file line number Diff line number Diff line change
Expand Up @@ -719,8 +719,8 @@ public void setDisabled(boolean disabled) {
for (LfHvdc hvdc : hvdcs) {
if (disabled) {
hvdc.setDisabled(true);
} else if (!disabled && !hvdc.getOtherBus(this).isDisabled()) {
// both enabled
} else if (!hvdc.getOtherBus(this).isDisabled()) {
// if both buses enabled only
hvdc.setDisabled(false);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,11 @@ public LfBus getOtherBus(LfBus bus) {

@Override
public void setDisabled(boolean disabled) {
super.setDisabled(disabled); // for equations
if (!acEmulation) {
if (disabled) {
// no active power in the hvdc line.
// converterStation1.setTargetP(0.0);
// converterStation2.setTargetP(0.0);
} else {
// re-active power transmission to initial target values.
converterStation1.setTargetP(converterStation1.getInitialTargetP());
converterStation2.setTargetP(converterStation2.getInitialTargetP());
}
super.setDisabled(disabled); // for AC emulation equations only.
if (!acEmulation && !disabled) {
// re-active power transmission to initial target values.
converterStation1.setTargetP(converterStation1.getInitialTargetP());
converterStation2.setTargetP(converterStation2.getInitialTargetP());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,8 @@ public class LfVscConverterStationImpl extends AbstractLfGenerator implements Lf

private LfHvdc hvdc; // set only when AC emulation is activated

private double initialTargetP;

public LfVscConverterStationImpl(VscConverterStation station, LfNetwork network, LfNetworkParameters parameters, LfNetworkLoadingReport report) {
super(network, HvdcUtils.getConverterStationTargetP(station) / PerUnit.SB);
this.initialTargetP = HvdcUtils.getConverterStationTargetP(station) / PerUnit.SB;
this.stationRef = Ref.create(station, parameters.isCacheEnabled());
this.lossFactor = station.getLossFactor();

Expand Down Expand Up @@ -65,11 +62,6 @@ public double getTargetP() {
return hvdc == null || !hvdc.isAcEmulation() ? super.getTargetP() : 0;
}

@Override
public double getInitialTargetP() {
return initialTargetP;
}

@Override
public double getLossFactor() {
return lossFactor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,15 +414,13 @@ private ContingencyConnectivityLossImpact findBusesAndBranchesImpactedBecauseOfC
// if one bus of the line is lost.
Set<LfHvdc> hvdcsWithoutFlow = new HashSet<>();
for (LfHvdc hvdcLine : network.getHvdcs()) {
if (busesToLost.contains(hvdcLine.getBus1()) && !busesToLost.contains(hvdcLine.getBus2())) {
if (connectivity.getConnectedComponent(hvdcLine.getBus1()).size() == 1) {
hvdcsWithoutFlow.add(hvdcLine);
}
if (busesToLost.contains(hvdcLine.getBus1()) && !busesToLost.contains(hvdcLine.getBus2())
&& connectivity.getConnectedComponent(hvdcLine.getBus1()).size() == 1) {
hvdcsWithoutFlow.add(hvdcLine);
}
if (busesToLost.contains(hvdcLine.getBus2()) && !busesToLost.contains(hvdcLine.getBus1())) {
if (connectivity.getConnectedComponent(hvdcLine.getBus2()).size() == 1) {
hvdcsWithoutFlow.add(hvdcLine);
}
if (busesToLost.contains(hvdcLine.getBus2()) && !busesToLost.contains(hvdcLine.getBus1())
&& connectivity.getConnectedComponent(hvdcLine.getBus2()).size() == 1) {
hvdcsWithoutFlow.add(hvdcLine);
}
}

Expand Down

0 comments on commit 9df1b92

Please sign in to comment.