Baltic-RCC / EMF

Repository for Open Source EMF implementation
Mozilla Public License 2.0
8 stars 3 forks source link

RequiredSvVoltage #127

Closed VeikoAunapuu closed 4 days ago

Haigutus commented 1 month ago

Possible fix


    # Fix missing injection voltages
    # Injections <- Terminal -> Topological Nodel <- Voltage
    injections = solved_data.type_tableview('EquivalentInjection').reset_index()
    injections = injections.merge(solved_data.type_tableview('Terminal').reset_index(), left_on="ID", right_on="Terminal.ConductingEquipment", suffixes=("_Injection", "_Terminal"))
    injections = injections.merge(solved_data.type_tableview('SvVoltage'), left_on="Terminal.TopologicalNode", right_on="SvVoltage.TopologicalNode")
    injections = injections.merge(solved_data.type_tableview('SvPowerFlow'), left_on="ID_Terminal", right_on="SvPowerFlow.Terminal")
    injections[['ID_Injection', 'EquivalentInjection.p', 'EquivalentInjection.q', 'ACDCTerminal.connected', 'SvVoltage.angle', 'SvVoltage.v', 'SvPowerFlow.p', 'SvPowerFlow.q']]
mr0321 commented 1 month ago

if #125 is solved then pypowsybl ver 1.6.0 can solve this issue (maybe need to check duplicate values). Update: still an issue over there: for one boundary node between two igms it gives two separate sets values (probably calculated from each igm side).

mr0321 commented 1 month ago

In newer version it iterates over the dangling lines to get the voltage values

private static void writeVoltagesForBoundaryNodes(Network network, String cimNamespace, XMLStreamWriter writer, CgmesExportContext context) throws XMLStreamException {
        for (DanglingLine dl : network.getDanglingLines(DanglingLineFilter.ALL)) {
            Bus b = dl.getTerminal().getBusView().getBus();
            String topologicalNode = dl.getProperty(Conversion.CGMES_PREFIX_ALIAS_PROPERTIES + CgmesNames.TOPOLOGICAL_NODE_BOUNDARY);
            if (topologicalNode != null) {
                if (dl.hasProperty("v") && dl.hasProperty("angle")) {
                    writeVoltage(topologicalNode, Double.parseDouble(dl.getProperty("v", "NaN")), Double.parseDouble(dl.getProperty("angle", "NaN")), cimNamespace, writer, context);
                } else if (b != null) {
                    writeVoltage(topologicalNode, dl.getBoundary().getV(), dl.getBoundary().getAngle(), cimNamespace, writer, context);
                } else {
                    writeVoltage(topologicalNode, 0.0, 0.0, cimNamespace, writer, context);
                }
            }
        }
    }

in powsybl-core/cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/export/StateVariablesExport.java

Haigutus commented 4 days ago

Quick Fix, drop one of the boundary SV results in post processing.

TODO - @mr0321 please reports this issue to Powsybl project

mr0321 commented 3 days ago

It seems that this is an intentional behaviour: If two dangling lines with the same Xnode are in the same geographical region in a CGMES file, they are not merged #2389