Skip to content
Draft
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
6 changes: 3 additions & 3 deletions docs/loadflow/loadflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Grid modeling

Open Load Flow computes power flows from IIDM grid model in bus/view topology. From the view, a very simple network, composed
of only buses and branches is created. In the graph vision, we rely on a $\Pi$ model for branches (lines, transformers, dangling lines, etc.):
of only buses and branches is created. In the graph vision, we rely on a $\Pi$ model for branches (lines, transformers, boundary lines, etc.):

- $R$ and $X$ are respectively the real part (resistance) and the imaginary part (reactance) of the complex impedance ;
- $G_1$ and $G_2$ are the real parts (conductance) on respectively side 1 and side 2 of the branch ;
Expand Down Expand Up @@ -263,9 +263,9 @@ In such cases the involved areas are not considered in the Area Interchange Cont

In iIDM each area defines the boundary points to be considered in the interchange. iIDM supports two ways of modeling area boundaries:
- either via an equipment terminal,
- or via a DanglingLine boundary.
- or via a BoundaryLine boundary.

In the DanglingLine case, the flow at the boundary side is considered as it should be, for both unpaired DanglingLines and DanglingLines paired in a TieLine.
In the BoundaryLine case, the flow at the boundary side is considered as it should be, for both unpaired BoundaryLines and BoundaryLines paired in a TieLine.

### Slack bus mismatch attribution
Depending on the location of the slack bus(es), the role of distributing the active power mismatch will be attributed based on the following logic:
Expand Down
4 changes: 2 additions & 2 deletions docs/sensitivity/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ Here is a table to summarize supported use cases:
## Input function types

### Branch sensitivity functions :
BRANCH_ACTIVE_POWER_#, BRANCH_REACTIVE_POWER_# or BRANCH_CURRENT_# are associated to branch objects (lines, transformers, dangling lines, tie lines). The # index corresponding to the side of the studied branch.
BRANCH_ACTIVE_POWER_#, BRANCH_REACTIVE_POWER_# or BRANCH_CURRENT_# are associated to branch objects (lines, transformers, boundary lines, tie lines). The # index corresponding to the side of the studied branch.
- If it is a line, a tie line, or a two windings transformer : The side is 1 or 2.
- If it is a three windings transformer : The side is 1, 2 or 3 corresponding to the studied leg of the transformer.
- If it is a dangling line : The side is 1 (network side) or 2 (boundary side). Note that if the dangling line is paired, only side 1 (network side) can be specified, and the sensitivity function is computed at the corresponding tie line side.
- If it is a boundary line : The side is 1 (network side) or 2 (boundary side). Note that if the boundary line is paired, only side 1 (network side) can be specified, and the sensitivity function is computed at the corresponding tie line side.

### Bus sensitivity functions :
BUS_VOLTAGE or BUS_REACTIVE_POWER are associated to the bus of the given network element.
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<slf4jtoys.version>1.6.3</slf4jtoys.version>
<asciitable.version>0.3.2</asciitable.version>

<powsybl-core.version>7.1.1</powsybl-core.version>
<powsybl-core.version>7.2.0-SNAPSHOT</powsybl-core.version>

<!-- This is required for later correct replacement of argline -->
<argLine/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ enum BranchType {
TRANSFO_3_LEG_1,
TRANSFO_3_LEG_2,
TRANSFO_3_LEG_3,
DANGLING_LINE,
BOUNDARY_LINE,
SWITCH,
TIE_LINE
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public static ContingencyTripping createContingencyTripping(Network network, Ide
TWO_WINDINGS_TRANSFORMER,
TIE_LINE:
return ContingencyTripping.createBranchTripping(network, (Branch<?>) identifiable);
case DANGLING_LINE,
case BOUNDARY_LINE,
GENERATOR,
LOAD,
SHUNT_COMPENSATOR,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ public double getP() {
}
if (branch instanceof LfTieLineBranch lfTieLineBranch) {
if (side == TwoSides.ONE) {
DanglingLine danglingLine1 = lfTieLineBranch.getHalf1();
double nominalV1 = danglingLine1.getTerminal().getVoltageLevel().getNominalV();
BoundaryLine boundaryLine1 = lfTieLineBranch.getHalf1();
double nominalV1 = boundaryLine1.getTerminal().getVoltageLevel().getNominalV();
return new SV(lfTieLineBranch.getP1().eval() * PerUnit.SB, lfTieLineBranch.getQ1().eval() * PerUnit.SB, lfTieLineBranch.getV1() * nominalV1, Math.toDegrees(lfTieLineBranch.getAngle1()), side)
.otherSideP(danglingLine1, false) / PerUnit.SB;
.otherSideP(boundaryLine1, false) / PerUnit.SB;
} else if (side == TwoSides.TWO) {
DanglingLine danglingLine = lfTieLineBranch.getHalf2();
double nominalV2 = danglingLine.getTerminal().getVoltageLevel().getNominalV();
BoundaryLine boundaryLine = lfTieLineBranch.getHalf2();
double nominalV2 = boundaryLine.getTerminal().getVoltageLevel().getNominalV();
return new SV(lfTieLineBranch.getP2().eval() * PerUnit.SB, lfTieLineBranch.getQ2().eval() * PerUnit.SB, lfTieLineBranch.getV2() * nominalV2, Math.toDegrees(lfTieLineBranch.getAngle2()), side)
.otherSideP(danglingLine, false) / PerUnit.SB;
.otherSideP(boundaryLine, false) / PerUnit.SB;
}
}
return switch (side) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/
package com.powsybl.openloadflow.network.impl;

import com.powsybl.iidm.network.DanglingLine;
import com.powsybl.iidm.network.BoundaryLine;
import com.powsybl.iidm.network.LimitType;
import com.powsybl.iidm.network.LoadingLimits;
import com.powsybl.iidm.network.TwoSides;
Expand All @@ -23,46 +23,46 @@
/**
* @author Geoffroy Jamgotchian {@literal <geoffroy.jamgotchian at rte-france.com>}
*/
public class LfDanglingLineBranch extends AbstractImpedantLfBranch {
public class LfBoundaryLineBranch extends AbstractImpedantLfBranch {

private final Ref<DanglingLine> danglingLineRef;
private final Ref<BoundaryLine> boundaryLineRef;

protected LfDanglingLineBranch(LfNetwork network, LfBus bus1, LfBus bus2, PiModel piModel, DanglingLine danglingLine,
protected LfBoundaryLineBranch(LfNetwork network, LfBus bus1, LfBus bus2, PiModel piModel, BoundaryLine boundaryLine,
LfNetworkParameters parameters) {
super(network, bus1, bus2, piModel, parameters);
this.danglingLineRef = Ref.create(danglingLine, parameters.isCacheEnabled());
this.boundaryLineRef = Ref.create(boundaryLine, parameters.isCacheEnabled());
}

public static LfDanglingLineBranch create(DanglingLine danglingLine, LfNetwork network, LfBus bus1, LfBus bus2,
public static LfBoundaryLineBranch create(BoundaryLine boundaryLine, LfNetwork network, LfBus bus1, LfBus bus2,
LfNetworkParameters parameters) {
Objects.requireNonNull(danglingLine);
Objects.requireNonNull(boundaryLine);
Objects.requireNonNull(bus1);
Objects.requireNonNull(bus2);
Objects.requireNonNull(parameters);
double zb = PerUnit.zb(danglingLine.getTerminal().getVoltageLevel().getNominalV());
// iIDM DanglingLine shunt admittance is network side only which is always side 1 (boundary is side 2).
double zb = PerUnit.zb(boundaryLine.getTerminal().getVoltageLevel().getNominalV());
// iIDM BoundaryLine shunt admittance is network side only which is always side 1 (boundary is side 2).
PiModel piModel = new SimplePiModel()
.setR(danglingLine.getR() / zb)
.setX(danglingLine.getX() / zb)
.setG1(danglingLine.getG() * zb)
.setR(boundaryLine.getR() / zb)
.setX(boundaryLine.getX() / zb)
.setG1(boundaryLine.getG() * zb)
.setG2(0)
.setB1(danglingLine.getB() * zb)
.setB1(boundaryLine.getB() * zb)
.setB2(0);
return new LfDanglingLineBranch(network, bus1, bus2, piModel, danglingLine, parameters);
return new LfBoundaryLineBranch(network, bus1, bus2, piModel, boundaryLine, parameters);
}

private DanglingLine getDanglingLine() {
return danglingLineRef.get();
private BoundaryLine getBoundaryLine() {
return boundaryLineRef.get();
}

@Override
public String getId() {
return getDanglingLine().getId();
return getBoundaryLine().getId();
}

@Override
public BranchType getBranchType() {
return BranchType.DANGLING_LINE;
return BranchType.BOUNDARY_LINE;
}

@Override
Expand All @@ -76,19 +76,19 @@ public List<BranchResult> createBranchResult(double preContingencyBranchP1, doub
LoadFlowModel loadFlowModel) {
// in a security analysis, we don't have any way to monitor the flows at boundary side. So in the branch result,
// we follow the convention side 1 for network side and side 2 for boundary side.
double currentScale = PerUnit.ib(getDanglingLine().getTerminal().getVoltageLevel().getNominalV());
double currentScale = PerUnit.ib(getBoundaryLine().getTerminal().getVoltageLevel().getNominalV());
return List.of(buildBranchResult(loadFlowModel, zeroImpedanceFlows, currentScale, currentScale, Double.NaN, Double.NaN));
}

@Override
public List<LfLimit> getLimits1(final LimitType type, LimitReductionManager limitReductionManager) {
switch (type) {
case ACTIVE_POWER:
return getLimits1(type, () -> getDanglingLine().getActivePowerLimits(), limitReductionManager);
return getLimits1(type, () -> getBoundaryLine().getActivePowerLimits(), limitReductionManager);
case APPARENT_POWER:
return getLimits1(type, () -> getDanglingLine().getApparentPowerLimits(), limitReductionManager);
return getLimits1(type, () -> getBoundaryLine().getApparentPowerLimits(), limitReductionManager);
case CURRENT:
return getLimits1(type, () -> getDanglingLine().getCurrentLimits(), limitReductionManager);
return getLimits1(type, () -> getBoundaryLine().getCurrentLimits(), limitReductionManager);
case VOLTAGE:
default:
throw new UnsupportedOperationException(String.format("Getting %s limits is not supported.", type.name()));
Expand All @@ -108,7 +108,7 @@ public void updateState(LfNetworkStateUpdateParameters parameters, LfNetworkUpda
@Override
public void updateFlows(double p1, double q1, double p2, double q2) {
// Network side is always on side 1.
getDanglingLine().getTerminal().setP(p1 * PerUnit.SB)
getBoundaryLine().getTerminal().setP(p1 * PerUnit.SB)
.setQ(q1 * PerUnit.SB);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/
package com.powsybl.openloadflow.network.impl;

import com.powsybl.iidm.network.DanglingLine;
import com.powsybl.iidm.network.BoundaryLine;
import com.powsybl.openloadflow.network.LfNetwork;
import com.powsybl.openloadflow.network.LfNetworkParameters;
import com.powsybl.openloadflow.network.LfNetworkStateUpdateParameters;
Expand All @@ -18,45 +18,45 @@
/**
* @author Geoffroy Jamgotchian {@literal <geoffroy.jamgotchian at rte-france.com>}
*/
public class LfDanglingLineBus extends AbstractLfBus {
public class LfBoundaryLineBus extends AbstractLfBus {

private final Ref<DanglingLine> danglingLineRef;
private final Ref<BoundaryLine> boundaryLineRef;

private final double nominalV;

public LfDanglingLineBus(LfNetwork network, DanglingLine danglingLine, LfNetworkParameters parameters, LfNetworkLoadingReport report) {
super(network, Networks.getPropertyV(danglingLine), Math.toRadians(Networks.getPropertyAngle(danglingLine)), parameters);
this.distributedOnConformLoad = false; // AbstractLfBus sets by default distributedOnConformLoad = true, we set it to false for LfDanglingLineBus
this.danglingLineRef = Ref.create(danglingLine, parameters.isCacheEnabled());
nominalV = danglingLine.getTerminal().getVoltageLevel().getNominalV();
getOrCreateLfLoad(null, parameters).add(danglingLine);
DanglingLine.Generation generation = danglingLine.getGeneration();
public LfBoundaryLineBus(LfNetwork network, BoundaryLine boundaryLine, LfNetworkParameters parameters, LfNetworkLoadingReport report) {
super(network, Networks.getPropertyV(boundaryLine), Math.toRadians(Networks.getPropertyAngle(boundaryLine)), parameters);
this.distributedOnConformLoad = false; // AbstractLfBus sets by default distributedOnConformLoad = true, we set it to false for LfBoundaryLineBus
this.boundaryLineRef = Ref.create(boundaryLine, parameters.isCacheEnabled());
nominalV = boundaryLine.getTerminal().getVoltageLevel().getNominalV();
getOrCreateLfLoad(null, parameters).add(boundaryLine);
BoundaryLine.Generation generation = boundaryLine.getGeneration();
if (generation != null) {
add(LfDanglingLineGenerator.create(danglingLine, network, getId(), parameters, report));
add(LfBoundaryLineGenerator.create(boundaryLine, network, getId(), parameters, report));
}
}

private DanglingLine getDanglingLine() {
return danglingLineRef.get();
private BoundaryLine getBoundaryLine() {
return boundaryLineRef.get();
}

public static String getId(DanglingLine danglingLine) {
return danglingLine.getId() + "_BUS";
public static String getId(BoundaryLine boundaryLine) {
return boundaryLine.getId() + "_BUS";
}

@Override
public List<String> getOriginalIds() {
return List.of(getDanglingLine().getId());
return List.of(getBoundaryLine().getId());
}

@Override
public String getId() {
return getId(getDanglingLine());
return getId(getBoundaryLine());
}

@Override
public String getVoltageLevelId() {
return getDanglingLine().getTerminal().getVoltageLevel().getId();
return getBoundaryLine().getTerminal().getVoltageLevel().getId();
}

@Override
Expand All @@ -71,9 +71,9 @@ public double getNominalV() {

@Override
public void updateState(LfNetworkStateUpdateParameters parameters) {
var danglingLine = getDanglingLine();
Networks.setPropertyV(danglingLine, v);
Networks.setPropertyAngle(danglingLine, Math.toDegrees(angle));
var boundaryLine = getBoundaryLine();
Networks.setPropertyV(boundaryLine, v);
Networks.setPropertyAngle(boundaryLine, Math.toDegrees(angle));

super.updateState(parameters);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/
package com.powsybl.openloadflow.network.impl;

import com.powsybl.iidm.network.DanglingLine;
import com.powsybl.iidm.network.BoundaryLine;
import com.powsybl.iidm.network.ReactiveLimits;
import com.powsybl.openloadflow.network.LfNetwork;
import com.powsybl.openloadflow.network.LfNetworkParameters;
Expand All @@ -21,48 +21,48 @@
/**
* @author Geoffroy Jamgotchian {@literal <geoffroy.jamgotchian at rte-france.com>}
*/
public final class LfDanglingLineGenerator extends AbstractLfGenerator {
public final class LfBoundaryLineGenerator extends AbstractLfGenerator {

private final Ref<DanglingLine> danglingLineRef;
private final Ref<BoundaryLine> boundaryLineRef;

private LfDanglingLineGenerator(DanglingLine danglingLine, LfNetwork network, String controlledLfBusId, LfNetworkParameters parameters,
private LfBoundaryLineGenerator(BoundaryLine boundaryLine, LfNetwork network, String controlledLfBusId, LfNetworkParameters parameters,
LfNetworkLoadingReport report) {
super(network, danglingLine.getGeneration().getTargetP() / PerUnit.SB, parameters);
this.danglingLineRef = Ref.create(danglingLine, parameters.isCacheEnabled());
super(network, boundaryLine.getGeneration().getTargetP() / PerUnit.SB, parameters);
this.boundaryLineRef = Ref.create(boundaryLine, parameters.isCacheEnabled());

// local control only
if (danglingLine.getGeneration().isVoltageRegulationOn() && checkVoltageControlConsistency(parameters, report)) {
// The controlled bus cannot be reached from the DanglingLine parameters (there is no terminal in DanglingLine.Generation)
if (checkTargetV(getId(), danglingLine.getGeneration().getTargetV() / danglingLine.getTerminal().getVoltageLevel().getNominalV(),
danglingLine.getTerminal().getVoltageLevel().getNominalV(), parameters, report)) {
if (boundaryLine.getGeneration().isVoltageRegulationOn() && checkVoltageControlConsistency(parameters, report)) {
// The controlled bus cannot be reached from the BoundaryLine parameters (there is no terminal in BoundaryLine.Generation)
if (checkTargetV(getId(), boundaryLine.getGeneration().getTargetV() / boundaryLine.getTerminal().getVoltageLevel().getNominalV(),
boundaryLine.getTerminal().getVoltageLevel().getNominalV(), parameters, report)) {
this.controlledBusId = Objects.requireNonNull(controlledLfBusId);
this.targetV = danglingLine.getGeneration().getTargetV() / danglingLine.getTerminal().getVoltageLevel().getNominalV();
this.targetV = boundaryLine.getGeneration().getTargetV() / boundaryLine.getTerminal().getVoltageLevel().getNominalV();
this.generatorControlType = GeneratorControlType.VOLTAGE;
}
}
}

public static LfDanglingLineGenerator create(DanglingLine danglingLine, LfNetwork network, String controlledLfBusId, LfNetworkParameters parameters,
public static LfBoundaryLineGenerator create(BoundaryLine boundaryLine, LfNetwork network, String controlledLfBusId, LfNetworkParameters parameters,
LfNetworkLoadingReport report) {
Objects.requireNonNull(danglingLine);
Objects.requireNonNull(boundaryLine);
Objects.requireNonNull(network);
Objects.requireNonNull(parameters);
Objects.requireNonNull(report);
return new LfDanglingLineGenerator(danglingLine, network, controlledLfBusId, parameters, report);
return new LfBoundaryLineGenerator(boundaryLine, network, controlledLfBusId, parameters, report);
}

private DanglingLine getDanglingLine() {
return danglingLineRef.get();
private BoundaryLine getBoundaryLine() {
return boundaryLineRef.get();
}

@Override
public String getId() {
return getDanglingLine().getId() + "_GEN";
return getBoundaryLine().getId() + "_GEN";
}

@Override
public String getOriginalId() {
return getDanglingLine().getId();
return getBoundaryLine().getId();
}

@Override
Expand All @@ -72,22 +72,22 @@ public OptionalDouble getRemoteControlReactiveKey() {

@Override
public double getTargetQ() {
return Networks.zeroIfNan(getDanglingLine().getGeneration().getTargetQ()) / PerUnit.SB;
return Networks.zeroIfNan(getBoundaryLine().getGeneration().getTargetQ()) / PerUnit.SB;
}

@Override
public double getMinP() {
return getDanglingLine().getGeneration().getMinP() / PerUnit.SB;
return getBoundaryLine().getGeneration().getMinP() / PerUnit.SB;
}

@Override
public double getMaxP() {
return getDanglingLine().getGeneration().getMaxP() / PerUnit.SB;
return getBoundaryLine().getGeneration().getMaxP() / PerUnit.SB;
}

@Override
protected Optional<ReactiveLimits> getReactiveLimits() {
return Optional.ofNullable(getDanglingLine().getGeneration().getReactiveLimits());
return Optional.ofNullable(getBoundaryLine().getGeneration().getReactiveLimits());
}

@Override
Expand Down
Loading
Loading