-
Notifications
You must be signed in to change notification settings - Fork 7
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
fictive load on isolated bus keeps hvdc isolated #1120
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,6 @@ | |
|
||
import com.powsybl.iidm.network.*; | ||
import com.powsybl.iidm.network.util.HvdcUtils; | ||
import com.powsybl.openloadflow.network.LfNetworkParameters; | ||
|
||
import java.util.Objects; | ||
import java.util.Optional; | ||
|
@@ -45,27 +44,31 @@ public static boolean isVsc(Identifiable<?> identifiable) { | |
&& ((HvdcConverterStation<?>) identifiable).getHvdcType() == HvdcConverterStation.HvdcType.VSC; | ||
} | ||
|
||
public static boolean isHvdcDanglingInIidm(HvdcConverterStation<?> station, LfNetworkParameters parameters) { | ||
public static boolean isHvdcDanglingInIidm(HvdcConverterStation<?> station) { | ||
|
||
if (isIsolated(station.getTerminal(), parameters)) { | ||
if (isIsolated(station.getTerminal())) { | ||
return true; | ||
} else { | ||
return station.getOtherConverterStation().map(otherConverterStation -> { | ||
Terminal otherTerminal = otherConverterStation.getTerminal(); | ||
return isIsolated(otherTerminal, parameters); | ||
return isIsolated(otherTerminal); | ||
}).orElse(true); // it means there is no HVDC line connected to station | ||
} | ||
} | ||
|
||
private static boolean isIsolated(Terminal terminal, LfNetworkParameters parameters) { | ||
Bus bus = parameters.isBreakers() ? terminal.getBusBreakerView().getBus() : terminal.getBusView().getBus(); | ||
private static boolean isIsolated(Terminal terminal) { | ||
Bus bus = terminal.getBusView().getBus(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would rather agree on this change, but has it been motivated by something failing? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No. Just the fact that when I wrote it first I didn't fully understand the difference betwwen BusView and BusBreakerVew There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So maybe we should revert this change and think about it in another one. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh la la... So it can breaks something in a topology I have seen where HVDC disconnection matters. I'll show you next time we meet. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So in that case, you just need to add a unit test that shows the issue. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. That was a bit trickier that I thought - and the bug is more seldom that I though because:
|
||
if (bus == null) { | ||
return true; | ||
} | ||
|
||
// The criteria should as close as possible to Networks.isIsolatedBusForHvdc - only connected to the station | ||
// The criteria should as close as possible to Networks.isIsolatedBusForHvdc - only connected to the station or a fictitious load | ||
return bus.getConnectedTerminalStream() | ||
.map(Terminal::getConnectable) | ||
.noneMatch(c -> !(c instanceof HvdcConverterStation<?> || c instanceof BusbarSection)); | ||
.noneMatch(c -> !(c instanceof HvdcConverterStation<?> || c instanceof BusbarSection || isFictitiousLoad(c))); | ||
} | ||
|
||
private static boolean isFictitiousLoad(Connectable<?> c) { | ||
return c instanceof Load load && LfLoadImpl.isLoadFictitious(load); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure there is no performance impact to compute this on the fly ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The laternative I see would be
Seems complex and gain is not obvious
Might cause bugs
Here it is computed;
at each restore, for each HVDC station
at contingency propagation for each HVDC
and you pay an iteration price if the bus has several loads.
This being said I'll run some mesures of this cost on a large network.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has ZERO performance impact the way it is used today for this new usage.
The method was never called in a sensitivity analysis of a large network with 100 contingencies.
The reason is that restoreInitialTopology that will trigger the call for each HVDC link is called in very rare and targeted occasions - when some switches are moved. So I suggest to keep it simple stupid at this time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed it seems to be only called at Lf Network loading so only one time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And only if an HVDC's station bus is disabled....