Support DC switch resistance in load flow - #1423
Conversation
Signed-off-by: Sylvestre Prabakaran <sylvestre.prabakaran@rte-france.com>
Signed-off-by: Sylvestre Prabakaran <sylvestre.prabakaran@rte-france.com>
Signed-off-by: Sylvestre Prabakaran <sylvestre.prabakaran@rte-france.com>
|
@bperr can you please review this activity? CI fails but this is normal, as long as tests run locally. |
| /** | ||
| * @author Landry Huet {@literal <landry.huet at supergrid-institute.com>} | ||
| */ | ||
| public class LfDcSwitchImpl extends AbstractLfDcLine { |
There was a problem hiding this comment.
Should AbstractLfDcLine be renamed to AbstractLfDcBranch ? It may now represent something else than a DC line
There was a problem hiding this comment.
It is a good idea. It has consequences in many files, however. In many places we then need to rename 'DcLine' to 'DcBranch'.
|
|
||
| @Override | ||
| public void updateFlows(double i1, double i2, double p1, double p2) { | ||
| // TODO: DcSwitch has no DcTerminal yet in the IIDM model - revisit when terminals are added. |
There was a problem hiding this comment.
This mean that the result of the load flow cannot be propagated to the iidm Network object. Is there no workaround for this ?
There was a problem hiding this comment.
You can still see the voltages at each node where the DcSwitches are connected. You do lose the data on the current. Fixing this requires however another activity in PowSyBl Core and it raises more questions. I will create a GitHub issue for this.
| @@ -611,11 +613,25 @@ private static void createBranches(List<LfBus> lfBuses, LfNetwork lfNetwork, LfT | |||
|
|
|||
| private static void createDcLines(LfNetwork lfNetwork, LoadingContext loadingContext, LfNetworkParameters parameters) { | |||
There was a problem hiding this comment.
Similarly, this may be renamed to createDcBranches
There was a problem hiding this comment.
Like many other methods and variables.
|
|
||
| List<LfDcBus> lfDcBuses = new ArrayList<>(); | ||
| createDcBuses(dcBuses, parameters, lfNetwork, lfDcBuses, loadingContext); | ||
| network.getDcSwitches().forEach(loadingContext.dcSwitchSet::add); |
There was a problem hiding this comment.
I understand that the DcTopologyVisitor interface does not allow to fill dcSwitchSet as for DC lines and ground so this is a workaround.
However I think your current implementation is incorrect as it adds all DC switches of the network, rather than the ones of the DC component. If your network has two DC components, the switches will be added twice.
You can either add a filter here using numDcc, or group DC Switches by (numCC, numDCC) (as done for AC switches)
| @@ -0,0 +1,66 @@ | |||
| /** | |||
| * Copyright (c) 2025, SuperGrid Institute (http://www.supergrid-institute.com) | |||
| @@ -0,0 +1,102 @@ | |||
| /** | |||
| * Copyright (c) 2025, SuperGrid Institute (http://www.supergrid-institute.com) | |||
| .setOpen(false) | ||
| .setR(rSwitch) | ||
| .add(); | ||
| addStandardConverters(network); |
There was a problem hiding this comment.
Since #1406 you have helper functions in AbstractLoadFlowNetworkFactory.java to create elements faster.
There was a problem hiding this comment.
Let's discuss this. I don't see how this is less verbose.
Signed-off-by: Landry Huet <landry.huet@supergrid-institute.com>
Signed-off-by: Landry Huet <landry.huet@supergrid-institute.com>
Signed-off-by: Landry Huet <landry.huet@supergrid-institute.com>
Signed-off-by: Landry Huet <landry.huet@supergrid-institute.com>
Signed-off-by: Landry Huet <landry.huet@supergrid-institute.com>
Signed-off-by: Landry Huet <landry.huet@supergrid-institute.com>
Signed-off-by: Landry Huet <landry.huet@supergrid-institute.com>
Signed-off-by: Landry Huet <landry.huet@supergrid-institute.com>
… switches. Signed-off-by: Landry Huet <landry.huet@supergrid-institute.com>
Signed-off-by: Landry Huet <landry.huet@supergrid-institute.com>
|
Hi@SGI-Landry , cc @SylvestreSakti |
fe5033c to
aa9ff93
Compare
Hello @jeandemanged I have just updated the branch. I have discovered a bug in the Core part of this activity, with a consequence in the load flow computation (see powsybl/powsybl-core#3953). Please let's not merge the activity in the release train, but rather wait until the issue in Core is fixed. |
|
Hello @SGI-Landry ,
My call would be for one of the above options (not writing, or writing as properties). If this cannot be done for this release train, I think it would make sense to do a small PR to have OLF throwing an exception on networks with DC Switch with non-zero resistance. Let us know |
Thanks for your answer, and thanks @SylvestreSakti for putting the exception. The issue is more than just recording the results. Continuing the discussion on powsybl/powsybl-core#3953 |
Please check if the PR fulfills these requirements
Does this PR already have an issue describing the problem?
Fixes #1371
Does this PR introduce a breaking change or deprecate an API?