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

Display tie lines in NAD while using a voltage level and a depth as inputs #548

Closed
So-Fras opened this issue Sep 11, 2023 · 1 comment · Fixed by #549
Closed

Display tie lines in NAD while using a voltage level and a depth as inputs #548

So-Fras opened this issue Sep 11, 2023 · 1 comment · Fixed by #549
Assignees
Labels
bug Something isn't working NAD

Comments

@So-Fras
Copy link
Member

So-Fras commented Sep 11, 2023

Describe the current behavior

When trying to display a network area diagram including a tie line, there is an exception raised when a filter is used: if both voltage levels at each end of a tie line are not included as inputs, the algorithm in VoltageLevelFilter does not manage to travel across the tie line from one voltage level to the other.

Describe the expected behavior

The algorithm should be able to travel across a tie line in order to display a central voltage level with a chosen depth of neighbouring voltage levels (as it is already the case when there is no tie line).

Describe the steps

// Create a network with tie lines
Network network = EurostagTutorialExample1Factory.createWithTieLine();

// Display part of the network, centered on one end of the tie line
NetworkAreaDiagram.draw(network, Path.of("/path/to/output/outputTest.svg"), "VLHV1", 1);

Environment

powsybl-diagram 3.3.2

Relevant Log Output

com.powsybl.commons.PowsyblException: Cannot add edge, corresponding voltage level is unknown: 'VLHV2'

at com.powsybl.nad.build.iidm.NetworkGraphBuilder.lambda$getVoltageLevelNode$11(NetworkGraphBuilder.java:200)
at java.base/java.util.Optional.orElseThrow(Optional.java:403)
at com.powsybl.nad.build.iidm.NetworkGraphBuilder.getVoltageLevelNode(NetworkGraphBuilder.java:200)
at com.powsybl.nad.build.iidm.NetworkGraphBuilder.addEdge(NetworkGraphBuilder.java:160)
at com.powsybl.nad.build.iidm.NetworkGraphBuilder.addEdge(NetworkGraphBuilder.java:155)
at com.powsybl.nad.build.iidm.NetworkGraphBuilder.visitTieLine(NetworkGraphBuilder.java:126)
at com.powsybl.nad.build.iidm.NetworkGraphBuilder.lambda$visitDanglingLine$9(NetworkGraphBuilder.java:121)
at java.base/java.util.Optional.ifPresent(Optional.java:178)
at com.powsybl.nad.build.iidm.NetworkGraphBuilder.visitDanglingLine(NetworkGraphBuilder.java:121)
at com.powsybl.nad.build.iidm.NetworkGraphBuilder.lambda$addGraphEdges$7(NetworkGraphBuilder.java:78)
at com.powsybl.nad.build.iidm.NetworkGraphBuilder.lambda$buildGraph$2(NetworkGraphBuilder.java:58)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at com.powsybl.nad.build.iidm.NetworkGraphBuilder.buildGraph(NetworkGraphBuilder.java:58)
at com.powsybl.nad.NetworkAreaDiagram.genericDraw(NetworkAreaDiagram.java:82)
at com.powsybl.nad.NetworkAreaDiagram.draw(NetworkAreaDiagram.java:69)
at com.powsybl.nad.NetworkAreaDiagram.draw(NetworkAreaDiagram.java:45)
at com.powsybl.nad.svg.TieLineTest.testTieLineBug ...

Extra Information

No response

@So-Fras So-Fras added bug Something isn't working NAD labels Sep 11, 2023
@So-Fras
Copy link
Member Author

So-Fras commented Sep 12, 2023

In private static class VlVisitor extends DefaultTopologyVisitor { ...}, we forgot to override the visitDanglingLine(...) function:

       @Override
        public void visitDanglingLine(DanglingLine danglingLine) {
            if (danglingLine.isPaired()) {
                danglingLine.getTieLine().ifPresent(tieline -> visitBranch(tieline, tieline.getSide(danglingLine.getTerminal())));
            }
        }

Adding that solves the above problem. We can run the following lines without any errors:

        Network network = EurostagTutorialExample1Factory.createWithTieLine();
        NetworkAreaDiagram.draw(network, Path.of("/path/to/output/outputTest.svg"), "VLHV1", 1);

I think we should add a test to the TieLineTest class to ensure that this case is now covered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working NAD
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants