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

Powsybl6 [WIP] #345

Open
wants to merge 3 commits into
base: breadth_first_topology_traverser
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
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public double getMaxP() {
@Override
public Battery setMaxP(double maxP) {
ValidationUtil.checkMaxP(this, maxP);
ValidationUtil.checkActivePowerLimits(this, getMinP(), maxP, getTargetP());
ValidationUtil.checkActivePowerLimits(this, getMinP(), maxP);
double oldValue = getResource().getAttributes().getMaxP();
if (maxP != oldValue) {
updateResource(res -> res.getAttributes().setMaxP(maxP));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,20 @@ public DanglingLine getDanglingLine(String voltageLevelId) {

@Override
public void remove() {
remove(false);
}

@Override
public void remove(boolean updateDanglingLines) {
var resource = getResource();

index.notifyBeforeRemoval(this);

if (updateDanglingLines) {
updateDanglingLine(getDanglingLine1());
updateDanglingLine(getDanglingLine2());
}

getDanglingLine1().removeTieLine();
getDanglingLine2().removeTieLine();
index.removeTieLine(resource.getId());
Expand Down Expand Up @@ -399,4 +409,22 @@ static int getOverloadDuration(Branch.Overload o1, Branch.Overload o2) {
int duration2 = o2 != null ? o2.getTemporaryLimit().getAcceptableDuration() : Integer.MAX_VALUE;
return Math.min(duration1, duration2);
}

private static void updateDanglingLine(DanglingLine danglingLine) {
// Only update if we have values
if (!Double.isNaN(danglingLine.getBoundary().getP())) {
danglingLine.setP0(-danglingLine.getBoundary().getP());
if (danglingLine.getGeneration() != null) {
// We do not reset regulation if we only have computed a dc load flow
danglingLine.getGeneration().setTargetP(0.0);
}
}
if (!Double.isNaN(danglingLine.getBoundary().getQ())) {
danglingLine.setQ0(-danglingLine.getBoundary().getQ());
if (danglingLine.getGeneration() != null) {
// If q values are available a complete ac load flow has been computed, we reset regulation
danglingLine.getGeneration().setTargetQ(0.0).setVoltageRegulationOn(false).setTargetV(Double.NaN);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,11 @@ public void multipleDanglingLinesInMergedNetwork() {
// FIXME
}

@Override
public void testMergeSameId() {
// FIXME
}

@Override
public void test() {
// FIXME
}

@Override
public void xnodeNonCompatible() {
// FIXME
}

@Override
public void mergeThenCloneVariantBug() {
// FIXME
Expand Down