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

[WIP] Handle fictitious bus injections #1114

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
4 changes: 4 additions & 0 deletions src/main/java/com/powsybl/openloadflow/network/LfBus.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ enum QLimitType {

double getTargetQ();

double getFictitiousInjectionTargetP();

double getFictitiousInjectionTargetQ();

double getLoadTargetP();

double getLoadTargetQ();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,12 @@ public void setReference(boolean reference) {

@Override
public double getTargetP() {
return getGenerationTargetP() - getLoadTargetP();
return getGenerationTargetP() - getLoadTargetP() - getFictitiousInjectionTargetP();
}

@Override
public double getTargetQ() {
return getGenerationTargetQ() - getLoadTargetQ();
return getGenerationTargetQ() - getLoadTargetQ() - getFictitiousInjectionTargetQ();
}

@Override
Expand Down Expand Up @@ -832,4 +832,14 @@ public Optional<LfArea> getArea() {
public void setArea(LfArea area) {
this.area = area;
}

@Override
public double getFictitiousInjectionTargetP() {
return 0;
}

@Override
public double getFictitiousInjectionTargetQ() {
return 0;
}
}
16 changes: 16 additions & 0 deletions src/main/java/com/powsybl/openloadflow/network/impl/LfBusImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ public class LfBusImpl extends AbstractLfBus {

private final List<String> bbsIds;

private final double fictitiousInjectionTargetP;

private final double fictitiousInjectionTargetQ;

protected LfBusImpl(Bus bus, LfNetwork network, double v, double angle, LfNetworkParameters parameters,
boolean participating) {
super(network, v, angle, parameters.isDistributedOnConformLoad());
Expand All @@ -52,6 +56,8 @@ protected LfBusImpl(Bus bus, LfNetwork network, double v, double angle, LfNetwor
this.participating = participating;
this.breakers = parameters.isBreakers();
country = bus.getVoltageLevel().getSubstation().flatMap(Substation::getCountry).orElse(null);
fictitiousInjectionTargetP = bus.getFictitiousP0();
fictitiousInjectionTargetQ = bus.getFictitiousQ0();
if (bus.getVoltageLevel().getTopologyKind() == TopologyKind.NODE_BREAKER) {
bbsIds = bus.getConnectedTerminalStream()
.map(Terminal::getConnectable)
Expand Down Expand Up @@ -190,4 +196,14 @@ public double getTargetQ() {
}
return super.getTargetQ();
}

@Override
public double getFictitiousInjectionTargetP() {
return fictitiousInjectionTargetP;
}

@Override
public double getFictitiousInjectionTargetQ() {
return fictitiousInjectionTargetQ;
}
}