Skip to content

CGMES SSH Network.update silently ignores the tap position of a PhaseTapChangerSymmetrical #4034

Description

@nicow-elia

Describe the current behavior

PhaseTapChangerSymmetricalis missing from the list of phase tap changer classes the SSH update query selects, so a tap position change on a symmetrical phase tap changer is silently discarded byNetwork.update`. The receiving side keeps its previous tap position.

cgmes-model/src/main/resources/CIM16-update.sparql:190:

# query: phaseTapChangers
SELECT *
{
    {
        SELECT DISTINCT ?PhaseTapChanger
        WHERE {
            {
                ?PhaseTapChanger a ?phaseTapChangerType ;
                VALUES ?phaseTapChangerType { cim:PhaseTapChangerLinear cim:PhaseTapChangerAsymmetrical cim:PhaseTapChangerNonLinear cim:PhaseTapChangerTabular } .
            }
            UNION
            { ... SvTapStep ... }
        }
    }
    OPTIONAL {
        ?PhaseTapChanger
            cim:TapChanger.controlEnabled ?tapChangerControlEnabled ;
            cim:TapChanger.step ?step .
    }
    ...
}

cim:PhaseTapChangerSymmetrical is absent, while its sibling cim:PhaseTapChangerAsymmetrical is present. The UNION branch only picks up tap changers referenced by an SvTapStep, which is SV data and therefore not present in an SSH-only update.

This affects Network.update only. The initial import is unaffected, because its query (CIM16.sparql:551) binds the class without restricting it.

Describe the expected behavior

After the update, the receiving side should hold the tap position written in the file, exactly as it already does for a PhaseTapChangerAsymmetrical.

Describe the steps

Reproducible with CgmesConformity3Catalog.microGridBaseCaseBE(), which contains exactly one PhaseTapChangerAsymmetrical and one PhaseTapChangerSymmetrical.

@Test
void symmetricalPhaseTapChangerPositionIsLostOnUpdate() throws Exception {
    ReadOnlyDataSource ds = CgmesConformity3Catalog.microGridBaseCaseBE().dataSource();
    Network sender = Network.read(ds, new Properties());
    Network receiver = Network.read(ds, new Properties());

    String asymmetrical = "b94318f6-6d24-4f56-96b9-df2531ad6543";  // PhaseTapChangerAsymmetrical, control
    String symmetrical  = "a708c3bc-465d-4fe7-b6ef-6fa6408a62b0";  // PhaseTapChangerSymmetrical, subject

    sender.getTwoWindingsTransformer(asymmetrical).getPhaseTapChanger().setTapPosition(11);  // from 10
    sender.getTwoWindingsTransformer(symmetrical).getPhaseTapChanger().setTapPosition(11);   // from 10

    Path dir = Files.createTempDirectory("ptc");
    Properties exportParameters = new Properties();
    exportParameters.put(CgmesExport.PROFILES, List.of("SSH"));
    sender.write("CGMES", exportParameters, dir.resolve("s"));

    Properties importParameters = new Properties();
    importParameters.put("iidm.import.cgmes.use-previous-values-during-update", "true");
    receiver.update(new GenericReadOnlyDataSource(dir, "s"), importParameters);

    assertEquals(11, receiver.getTwoWindingsTransformer(asymmetrical).getPhaseTapChanger().getTapPosition()); // passes
    assertEquals(11, receiver.getTwoWindingsTransformer(symmetrical).getPhaseTapChanger().getTapPosition());  // fails, still 10
}

Environment

  • PowSyBl Core version: 7.4.0-SNAPSHOT, main at commit 7a1ae581a9
  • Java: Oracle GraalVM 21.0.11+9 LTS
  • OS: Ubuntu 24.04.4 LTS (kernel 6.17.0)

Relevant Log Output

The exported SSH holds the new position for both, under their respective classes:

<cim:PhaseTapChangerAsymmetrical rdf:about="#_36b83adb-3d45-4693-8967-96627b5f9ec9">
    <cim:TapChanger.controlEnabled>false</cim:TapChanger.controlEnabled>
    <cim:TapChanger.step>11</cim:TapChanger.step>
</cim:PhaseTapChangerAsymmetrical>
<cim:PhaseTapChangerSymmetrical rdf:about="#_63454a73-f439-45bb-951a-e7b193986571">
    <cim:TapChanger.controlEnabled>false</cim:TapChanger.controlEnabled>
    <cim:TapChanger.step>11</cim:TapChanger.step>
</cim:PhaseTapChangerSymmetrical>

Extra Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions