Support disconnection of DC elements in the load flow - #1471
Conversation
Signed-off-by: b.perreyon <baptiste.perreyon@supergrid-institute.com>
Signed-off-by: b.perreyon <baptiste.perreyon@supergrid-institute.com>
Signed-off-by: b.perreyon <baptiste.perreyon@supergrid-institute.com>
Signed-off-by: b.perreyon <baptiste.perreyon@supergrid-institute.com>
Signed-off-by: b.perreyon <baptiste.perreyon@supergrid-institute.com>
Signed-off-by: b.perreyon <baptiste.perreyon@supergrid-institute.com>
SGI-Landry
left a comment
There was a problem hiding this comment.
Thanks for this activity @bperr !
There are a few minor comments here and there. I think however that we should discuss tests in AcDcLoadFlowWithDisconnectionTest.
| DC buses at the other side.<br> | ||
| Please note that converters with a second optional AC terminal are not supported by Open Load Flow. | ||
|
|
||
| If a terminal of the converter is disconnected, the converter is not included in the load flow, and none of the equations below is added. |
There was a problem hiding this comment.
This will probably require a bit more details, e.g. whether an equation imposing I=0 is added, or what happens with losses and on the AC side.
| } | ||
|
|
||
| @Test | ||
| void testDcBusWithDisconnectedDcGroundIsNotGrounded() { |
There was a problem hiding this comment.
I am a bit puzzled by these tests. What behavior are we testing here? Are you testing the interface or the implementation details? This is not clear to me, can we please discuss it?
| } | ||
|
|
||
| /** | ||
| * Verify the DC node voltage is coherent with the nominal voltage |
There was a problem hiding this comment.
| * Verify the DC node voltage is coherent with the nominal voltage | |
| * Verify the DC node voltage is consistent with the nominal voltage |
But is this really needed? I would expect that you should know what values to expect precisely from your test cases, rather than test that the value is finite and "small enough".
| import static org.junit.jupiter.api.Assertions.*; | ||
|
|
||
| /** | ||
| * @author Baptiste Perreyon {@literal <bapstiste.perreyon at supergrid-institute.com>} |
There was a problem hiding this comment.
| * @author Baptiste Perreyon {@literal <bapstiste.perreyon at supergrid-institute.com>} | |
| * @author Baptiste Perreyon {@literal <baptiste.perreyon at supergrid-institute.com>} |
| * @author Baptiste Perreyon {@literal <bapstiste.perreyon at supergrid-institute.com>} | ||
| */ | ||
| @ExtendWith(ServiceParameterResolver.class) | ||
| class AcDcLoadFlowWithDisconnectionTest { |
There was a problem hiding this comment.
This can be simplified and made more robust. Can we please write down what behaviors to expect in a if condition then expectation way, and create just these tests, over observable behaviors? This should rely on analytical cases when this is numerical, with comparisons to expected values.
| * @param acDcConverters A list of AC-DC converters to check. | ||
| * @throws PowsyblException If at least one AC-DC converter is not indirectly connected to a DC ground | ||
| */ | ||
| public static void checkAllConvertersAreIndirectlyConnectedToADcGround(List<AcDcConverter<?>> acDcConverters) { |
There was a problem hiding this comment.
Would it make sense to leave it package-private? I think these static methods are only used in LfNetworkLoaderImpl anyway.
| // lcc converter not implemented yet | ||
| } else { | ||
| // Remove previous load flow results (we don't want the user to believe this are results from the new load flow) | ||
| acDcConverter.unsetSolvedValues(); |
There was a problem hiding this comment.
Very good point. However, a converter whose DC terminals are both disconnected belongs to no DcBus so it is never added to the acDcConverterSet in the first place.
Same issue with DcLines disconnected at both ends.
There was a problem hiding this comment.
Done after the load flow in Networks.resetState as all other equipments
| * | ||
| * @author Baptiste Perreyon {@literal <baptiste.perreyon at supergrid-institute.com>} | ||
| */ | ||
| final class DcNetworkValidationHelpers { |
There was a problem hiding this comment.
Good call to factor out these static functions. I am wondering if it is possible to simplify this code a bit. Maybe extract the topology visitor, and replace the predicate on converters by a boolean stating whether the test is needed or not?
Signed-off-by: b.perreyon <baptiste.perreyon@supergrid-institute.com>
Signed-off-by: b.perreyon <baptiste.perreyon@supergrid-institute.com>
Signed-off-by: b.perreyon <baptiste.perreyon@supergrid-institute.com>
Signed-off-by: b.perreyon <baptiste.perreyon@supergrid-institute.com>
Signed-off-by: b.perreyon <baptiste.perreyon@supergrid-institute.com>
|


Please check if the PR fulfills these requirements
Does this PR already have an issue describing the problem?
No
What kind of change does this PR introduce?
Feature
What is the current behavior?
The AC-DC load flow did not consider wheher DC terminals of elements were connected or disconnected.
What is the new behavior (if this is a feature change)?
Disconnnected elements are properly taken into account during load flow
Does this PR introduce a breaking change or deprecate an API?
If yes, please check if the following requirements are fulfilled
What changes might users need to make in their application due to this PR? (migration steps)
Other information: