powsybl / powsybl-diagram

SVG diagrams generation: single-line substation diagrams and network graph diagrams
Mozilla Public License 2.0
76 stars 13 forks source link

Display switch on feeder in Bus/Breaker view #538

Open So-Fras opened 1 year ago

So-Fras commented 1 year ago

Describe the current behavior

When we create a simple voltage level in Bus/Breaker view, with the code below:

        Network network2 = Network.create("test", "test");
        Substation substation = createSubstation(network2, "S1", "S1", Country.FR);

        VoltageLevel vl1 = createVoltageLevel(substation, "VL1", "VL1", TopologyKind.BUS_BREAKER, 400);

        vl1.getBusBreakerView().newBus()
                .setId("B11")
                .add();
        vl1.newLoad()
                .setId("LD1")
                .setConnectableBus("B11")
                .setBus("B11")
                .setP0(1.0)
                .setQ0(1.0)
                .add();

        vl1.getBusBreakerView().newBus()
                .setId("B12")
                .add();
        vl1.getBusBreakerView().newSwitch()
                .setId("BR1")
                .setBus1("B12")
                .setBus2("B11")
                .setOpen(false)
                .add();
        vl1.getBusBreakerView().newBus()
                .setId("B13")
                .add();
        vl1.getBusBreakerView().newSwitch()
                .setId("BR2")
                .setBus1("B12")
                .setBus2("B13")
                .setOpen(false)
                .add();
        vl1.newGenerator()
                .setId("G1")
                .setConnectableBus("B13")
                .setBus("B13")
                .setMaxP(100.0)
                .setMinP(50.0)
                .setTargetP(100.0)
                .setTargetV(400.0)
                .setVoltageRegulatorOn(true)
                .add();

We get the following svg output:

image

Describe the expected behavior

Instead, one may want to get the following output (looking more like a Node/Breaker view):

image

The switches would be displayed on feeders instead of being displayed as bridges between bus bars.

Describe the motivation

This would enhances the diagram readability.

geofjamg commented 1 year ago

I disagree with this issue, it does not make any sense to try to display a bus/breaker model as a node/breaker model. If one needs this kind of display it has to use a node/breaker model. In a bus/breaker model, switches are bus coupler only, nothing related to feeder switch, there is a terminal status for that.

jonenst commented 1 year ago

Should the sld svg generator be updated to always display equipments with bus="null" but connectableBus="XXX" with an open breaker to the XXX bar ? Or we do we want explicit data in the network (extension ?) to model this ?

The following network (written by hand by me, may have mistakes) (load1 and gen1 are connected, but load2 and gen2 are disconnected)

<?xml version="1.0" encoding="UTF-8"?>
<iidm:network xmlns:iidm="http://www.powsybl.org/schema/iidm/1_9" xmlns:slt="http://www.powsybl.org/schema/iidm/ext/slack_terminal/1_5" id="ieee9cdf" caseDate="2009-04-26T00:00:00.000Z" forecastDistance="0" sourceFormat="IEEE-CDF" minimumValidationLevel="STEADY_STATE_HYPOTHESIS">
    <iidm:substation id="S">
        <iidm:voltageLevel id="VL1" nominalV="100.0" topologyKind="BUS_BREAKER">
            <iidm:busBreakerTopology>
                <iidm:bus id="B1" name="B1"/>
            </iidm:busBreakerTopology>
            <iidm:load id="L1" p0="100.0" q0="35.0" connectableBus="B1" bus="B1"/>
            <iidm:generator id="G1" energySource="OTHER" minP="10.0" maxP="110.0" targetP="100.0" targetV="100.0" targetQ="35.0" voltageRegulatorOn="true" connectableBus="B1" bus="B1"/>
        </iidm:voltageLevel>
        <iidm:voltageLevel id="VL2" nominalV="100.0" topologyKind="BUS_BREAKER">
            <iidm:busBreakerTopology>
                <iidm:bus id="B2" name="B2"/>
            </iidm:busBreakerTopology>
            <iidm:load id="L2" p0="100.0" q0="35.0" connectableBus="B2"/>
            <iidm:generator id="G2" energySource="OTHER" minP="10.0" maxP="110.0" targetP="100.0" targetV="100.0" targetQ="35.0" voltageRegulatorOn="true" connectableBus="B2"/>
        </iidm:voltageLevel>
        <iidm:twoWindingsTransformer id="T" r="0.0" x="5.76" g="0.0" b="0.0" ratedU1="100.0" ratedU2="100.0" bus1="B1" connectableBus1="B1" voltageLevelId1="VL1" bus2="B2" connectableBus2="B2" voltageLevelId2="VL2">
            <iidm:ratioTapChanger lowTapPosition="0" tapPosition="0" loadTapChangingCapabilities="true" regulating="false">
                <iidm:step r="0.0" x="0.0" g="0.0" b="0.0" rho="1.0"/>
            </iidm:ratioTapChanger>
        </iidm:twoWindingsTransformer>
    </iidm:substation>
</iidm:network>

produces (after running openloadflow) Capture d’écran de 2023-07-26 10-34-25 Is this expected ? the only way to see that the equipement is not connect to the bus is that the active and reactive power is "-" ? Not sure maybe I did something wrong ?

jonenst commented 1 year ago

Or is the bus/breaker topology not supposed to be used for this usecase ?

So-Fras commented 1 year ago

In powsybl-diagram latest version (v5.3.2), a fix was introduced to display disconnected components. A disconnected load or a disconnected line terminal now appear with a dashed line: image

jonenst commented 1 year ago

Capture d’écran de 2023-07-26 13-39-55

ok I see it with 4.0.0-SNAPSHOT with the "highlight" checkbox in the dev tools viewer. Is it enough ?

So-Fras commented 1 year ago

Yes and now you can visualize that G2 and L2 are both disconnected.

jonenst commented 1 year ago

At least we need to add documentation on the expected semantics of buses and switches in the busbreaker definition.

And what if your objective is to display a diagram that looks like the busbreaker one in this image https://www.powsybl.org/pages/documentation/grid/model/img/index/voltage-level.svg (from our docs https://www.powsybl.org/pages/documentation/grid/model/#voltage-level ). that's what I meant with "is it enough?"