From 9da345e8d18bcf41013d82cdb707684ea29938c5 Mon Sep 17 00:00:00 2001 From: g-steiner Date: Thu, 18 Jul 2024 18:22:08 +0200 Subject: [PATCH] Use of extension GeneratorFortescue from powsybl-core (#5) Signed-off-by: Georges Steiner --- .../CgmesShortCircuitImportPostProcessor.java | 31 +++++--- .../sc/extensions/FortescueConstants.java | 2 +- .../sc/extensions/GeneratorFortescue.java | 78 ------------------- .../extensions/GeneratorFortescueAdder.java | 72 ----------------- .../GeneratorFortescueAdderImplProvider.java | 29 ------- .../sc/extensions/GeneratorFortescueType.java | 41 ++++++++++ .../GeneratorFortescueTypeAdder.java | 39 ++++++++++ ...neratorFortescueTypeAdderImplProvider.java | 38 +++++++++ sc-implementation/pom.xml | 6 ++ .../implementation/ShortCircuitNormIec.java | 8 +- .../implementation/ShortCircuitNormNone.java | 11 ++- .../extensions/ShortCircuitExtensions.java | 7 +- .../ShortCircuitMonophasedTest.java | 13 +++- .../implementation/ShortCircuitNormTest.java | 13 +++- .../com/powsybl/sc/util/ReferenceNetwork.java | 20 +++-- 15 files changed, 191 insertions(+), 217 deletions(-) delete mode 100644 sc-extensions/src/main/java/com/powsybl/sc/extensions/GeneratorFortescue.java delete mode 100644 sc-extensions/src/main/java/com/powsybl/sc/extensions/GeneratorFortescueAdder.java delete mode 100644 sc-extensions/src/main/java/com/powsybl/sc/extensions/GeneratorFortescueAdderImplProvider.java create mode 100644 sc-extensions/src/main/java/com/powsybl/sc/extensions/GeneratorFortescueType.java create mode 100644 sc-extensions/src/main/java/com/powsybl/sc/extensions/GeneratorFortescueTypeAdder.java create mode 100644 sc-extensions/src/main/java/com/powsybl/sc/extensions/GeneratorFortescueTypeAdderImplProvider.java diff --git a/sc-cgmes/src/main/java/com/powsybl/sc/cgmes/CgmesShortCircuitImportPostProcessor.java b/sc-cgmes/src/main/java/com/powsybl/sc/cgmes/CgmesShortCircuitImportPostProcessor.java index 16615dd..6223f05 100644 --- a/sc-cgmes/src/main/java/com/powsybl/sc/cgmes/CgmesShortCircuitImportPostProcessor.java +++ b/sc-cgmes/src/main/java/com/powsybl/sc/cgmes/CgmesShortCircuitImportPostProcessor.java @@ -11,6 +11,7 @@ import com.powsybl.cgmes.conversion.CgmesImportPostProcessor; import com.powsybl.commons.PowsyblException; import com.powsybl.iidm.network.*; +import com.powsybl.iidm.network.extensions.GeneratorFortescueAdder; import com.powsybl.iidm.network.extensions.GeneratorShortCircuitAdder; import com.powsybl.iidm.network.extensions.WindingConnectionType; import com.powsybl.sc.extensions.*; @@ -99,12 +100,15 @@ private void processExternalNetworkInjection(Network network, TripleStore triple .add(); generator.newExtension(GeneratorFortescueAdder.class) - .withRo(roOverR * rq) - .withXo(xoOverX * xq) - .withRi(0.) - .withXi(0.) - .withToGround(grounded) - .withGeneratorType(GeneratorFortescue.GeneratorType.FEEDER) + .withRz(roOverR * rq) + .withXz(xoOverX * xq) + .withRn(0.) + .withXn(0.) + .withGrounded(grounded) + .add(); + + generator.newExtension(GeneratorFortescueTypeAdder.class) + .withGeneratorType(GeneratorFortescueType.GeneratorType.FEEDER) .add(); } } @@ -154,14 +158,17 @@ private void processSynchronousMachines(Network network, TripleStore tripleStore .add(); generator.newExtension(GeneratorFortescueAdder.class) - .withRo(r0) - .withXo(x0) - .withRi(0.) - .withXi(0.) - .withGeneratorType(GeneratorFortescue.GeneratorType.ROTATING_MACHINE) - .withToGround(earthing) + .withRz(r0) + .withXz(x0) + .withRn(0.) + .withXn(0.) + .withGrounded(earthing) .withGroundingR(0.) // TODO : check if info available .add(); + + generator.newExtension(GeneratorFortescueTypeAdder.class) + .withGeneratorType(GeneratorFortescueType.GeneratorType.ROTATING_MACHINE) + .add(); } } diff --git a/sc-extensions/src/main/java/com/powsybl/sc/extensions/FortescueConstants.java b/sc-extensions/src/main/java/com/powsybl/sc/extensions/FortescueConstants.java index a56bb2d..b7022ef 100644 --- a/sc-extensions/src/main/java/com/powsybl/sc/extensions/FortescueConstants.java +++ b/sc-extensions/src/main/java/com/powsybl/sc/extensions/FortescueConstants.java @@ -30,5 +30,5 @@ private FortescueConstants() { public static final WindingConnectionType DEFAULT_LEG2_CONNECTION_TYPE = WindingConnectionType.Y_GROUNDED; // TODO : check if default connection acceptable public static final WindingConnectionType DEFAULT_LEG3_CONNECTION_TYPE = WindingConnectionType.DELTA; // TODO : check if default connection acceptable - public static final GeneratorFortescue.GeneratorType DEFAULT_GENERATOR_FORTESCUE_TYPE = GeneratorFortescue.GeneratorType.ROTATING_MACHINE; + public static final GeneratorFortescueType.GeneratorType DEFAULT_GENERATOR_FORTESCUE_TYPE = GeneratorFortescueType.GeneratorType.ROTATING_MACHINE; } diff --git a/sc-extensions/src/main/java/com/powsybl/sc/extensions/GeneratorFortescue.java b/sc-extensions/src/main/java/com/powsybl/sc/extensions/GeneratorFortescue.java deleted file mode 100644 index 36a564a..0000000 --- a/sc-extensions/src/main/java/com/powsybl/sc/extensions/GeneratorFortescue.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.powsybl.sc.extensions; - -import com.powsybl.commons.extensions.AbstractExtension; -import com.powsybl.iidm.network.Generator; - -public class GeneratorFortescue extends AbstractExtension { - - public static final String NAME = "generatorFortescue"; - - public enum GeneratorType { - UNKNOWN, - ROTATING_MACHINE, - FEEDER; - } - - private boolean toGround; - private final double ro; - private final double xo; - private final double ri; - private final double xi; - private final double groundingR; - private final double groundingX; - private final GeneratorType generatorType; - - @Override - public String getName() { - return NAME; - } - - public GeneratorFortescue(Generator generator, boolean toGround, double ro, double xo, double ri, double xi, double groundingR, double groundingX, GeneratorType generatorType) { - super(generator); - this.toGround = toGround; - this.ro = ro; - this.xo = xo; - this.ri = ri; - this.xi = xi; - this.groundingR = groundingR; - this.groundingX = groundingX; - this.generatorType = generatorType; - - } - - public boolean isToGround() { - return toGround; - } - - public double getGroundingR() { - return groundingR; - } - - public double getGroundingX() { - return groundingX; - } - - public double getRo() { - return ro; - } - - public double getXo() { - return xo; - } - - public double getRi() { - return ri; - } - - public double getXi() { - return xi; - } - - public GeneratorType getGeneratorType() { - return generatorType; - } - - public void setToGround(boolean toGround) { - this.toGround = toGround; - } -} diff --git a/sc-extensions/src/main/java/com/powsybl/sc/extensions/GeneratorFortescueAdder.java b/sc-extensions/src/main/java/com/powsybl/sc/extensions/GeneratorFortescueAdder.java deleted file mode 100644 index 140b9ec..0000000 --- a/sc-extensions/src/main/java/com/powsybl/sc/extensions/GeneratorFortescueAdder.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.powsybl.sc.extensions; - -import com.powsybl.commons.extensions.AbstractExtensionAdder; -import com.powsybl.iidm.network.Generator; - -import static com.powsybl.sc.extensions.FortescueConstants.*; - -public class GeneratorFortescueAdder extends AbstractExtensionAdder { - - private boolean toGround = DEFAULT_TO_GROUND; - private double ro = 0.; - private double xo = 0.; - private double ri = 0.; - private double xi = 0.; - private double groundingR = DEFAULT_GROUNDING_R; - private double groundingX = DEFAULT_GROUNDING_X; - private GeneratorFortescue.GeneratorType generatorType = DEFAULT_GENERATOR_FORTESCUE_TYPE; - - public GeneratorFortescueAdder(Generator generator) { - super(generator); - } - - @Override - public Class getExtensionClass() { - return GeneratorFortescue.class; - } - - @Override - protected GeneratorFortescue createExtension(Generator generator) { - return new GeneratorFortescue(generator, toGround, ro, xo, ri, xi, groundingR, groundingX, generatorType); - } - - public GeneratorFortescueAdder withToGround(boolean toGround) { - this.toGround = toGround; - return this; - } - - public GeneratorFortescueAdder withRo(double ro) { - this.ro = ro; - return this; - } - - public GeneratorFortescueAdder withXo(double xo) { - this.xo = xo; - return this; - } - - public GeneratorFortescueAdder withRi(double ri) { - this.ri = ri; - return this; - } - - public GeneratorFortescueAdder withXi(double xi) { - this.xi = xi; - return this; - } - - public GeneratorFortescueAdder withGroundingR(double groundingR) { - this.groundingR = groundingR; - return this; - } - - public GeneratorFortescueAdder withGroundingX(double groundingX) { - this.groundingX = groundingX; - return this; - } - - public GeneratorFortescueAdder withGeneratorType(GeneratorFortescue.GeneratorType generatorType) { - this.generatorType = generatorType; - return this; - } -} diff --git a/sc-extensions/src/main/java/com/powsybl/sc/extensions/GeneratorFortescueAdderImplProvider.java b/sc-extensions/src/main/java/com/powsybl/sc/extensions/GeneratorFortescueAdderImplProvider.java deleted file mode 100644 index c8d5d3c..0000000 --- a/sc-extensions/src/main/java/com/powsybl/sc/extensions/GeneratorFortescueAdderImplProvider.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.powsybl.sc.extensions; - -import com.google.auto.service.AutoService; -import com.powsybl.commons.extensions.ExtensionAdderProvider; -import com.powsybl.iidm.network.Generator; - -@AutoService(ExtensionAdderProvider.class) -public class GeneratorFortescueAdderImplProvider implements ExtensionAdderProvider { - - @Override - public String getImplementationName() { - return "Default"; - } - - @Override - public String getExtensionName() { - return GeneratorFortescue.NAME; - } - - @Override - public Class getAdderClass() { - return GeneratorFortescueAdder.class; - } - - @Override - public GeneratorFortescueAdder newAdder(Generator generator) { - return new GeneratorFortescueAdder(generator); - } -} diff --git a/sc-extensions/src/main/java/com/powsybl/sc/extensions/GeneratorFortescueType.java b/sc-extensions/src/main/java/com/powsybl/sc/extensions/GeneratorFortescueType.java new file mode 100644 index 0000000..52f1c63 --- /dev/null +++ b/sc-extensions/src/main/java/com/powsybl/sc/extensions/GeneratorFortescueType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2022, Jean-Baptiste Heyberger & Geoffroy Jamgotchian + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +package com.powsybl.sc.extensions; + +import com.powsybl.commons.extensions.AbstractExtension; +import com.powsybl.iidm.network.Generator; + +/** + * @author Geoffroy Jamgotchian + */ +public class GeneratorFortescueType extends AbstractExtension { + + public static final String NAME = "generatorFortescueType"; + + public enum GeneratorType { + UNKNOWN, + ROTATING_MACHINE, + FEEDER; + } + + private final GeneratorType generatorType; + + @Override + public String getName() { + return NAME; + } + + public GeneratorFortescueType(Generator generator, GeneratorType generatorType) { + super(generator); + this.generatorType = generatorType; + + } + + public GeneratorType getGeneratorType() { + return generatorType; + } +} diff --git a/sc-extensions/src/main/java/com/powsybl/sc/extensions/GeneratorFortescueTypeAdder.java b/sc-extensions/src/main/java/com/powsybl/sc/extensions/GeneratorFortescueTypeAdder.java new file mode 100644 index 0000000..fd61d91 --- /dev/null +++ b/sc-extensions/src/main/java/com/powsybl/sc/extensions/GeneratorFortescueTypeAdder.java @@ -0,0 +1,39 @@ +/** + * Copyright (c) 2022, Jean-Baptiste Heyberger & Geoffroy Jamgotchian + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +package com.powsybl.sc.extensions; + +import com.powsybl.commons.extensions.AbstractExtensionAdder; +import com.powsybl.iidm.network.Generator; + +import static com.powsybl.sc.extensions.FortescueConstants.*; + +/** + * @author Geoffroy Jamgotchian + */ +public class GeneratorFortescueTypeAdder extends AbstractExtensionAdder { + + private GeneratorFortescueType.GeneratorType generatorType = DEFAULT_GENERATOR_FORTESCUE_TYPE; + + public GeneratorFortescueTypeAdder(Generator generator) { + super(generator); + } + + @Override + public Class getExtensionClass() { + return GeneratorFortescueType.class; + } + + @Override + protected GeneratorFortescueType createExtension(Generator generator) { + return new GeneratorFortescueType(generator, generatorType); + } + + public GeneratorFortescueTypeAdder withGeneratorType(GeneratorFortescueType.GeneratorType generatorType) { + this.generatorType = generatorType; + return this; + } +} diff --git a/sc-extensions/src/main/java/com/powsybl/sc/extensions/GeneratorFortescueTypeAdderImplProvider.java b/sc-extensions/src/main/java/com/powsybl/sc/extensions/GeneratorFortescueTypeAdderImplProvider.java new file mode 100644 index 0000000..0cd2343 --- /dev/null +++ b/sc-extensions/src/main/java/com/powsybl/sc/extensions/GeneratorFortescueTypeAdderImplProvider.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) 2022, Jean-Baptiste Heyberger & Geoffroy Jamgotchian + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +package com.powsybl.sc.extensions; + +import com.google.auto.service.AutoService; +import com.powsybl.commons.extensions.ExtensionAdderProvider; +import com.powsybl.iidm.network.Generator; + +/** + * @author Geoffroy Jamgotchian + */ +@AutoService(ExtensionAdderProvider.class) +public class GeneratorFortescueTypeAdderImplProvider implements ExtensionAdderProvider { + + @Override + public String getImplementationName() { + return "Default"; + } + + @Override + public String getExtensionName() { + return GeneratorFortescueType.NAME; + } + + @Override + public Class getAdderClass() { + return GeneratorFortescueTypeAdder.class; + } + + @Override + public GeneratorFortescueTypeAdder newAdder(Generator generator) { + return new GeneratorFortescueTypeAdder(generator); + } +} diff --git a/sc-implementation/pom.xml b/sc-implementation/pom.xml index 0db09e2..720110a 100644 --- a/sc-implementation/pom.xml +++ b/sc-implementation/pom.xml @@ -59,6 +59,12 @@ log4j-over-slf4j test + + com.powsybl + powsybl-iidm-extensions + 6.4.0 + compile + diff --git a/sc-implementation/src/main/java/com/powsybl/sc/implementation/ShortCircuitNormIec.java b/sc-implementation/src/main/java/com/powsybl/sc/implementation/ShortCircuitNormIec.java index 9fea64d..8e7e94f 100644 --- a/sc-implementation/src/main/java/com/powsybl/sc/implementation/ShortCircuitNormIec.java +++ b/sc-implementation/src/main/java/com/powsybl/sc/implementation/ShortCircuitNormIec.java @@ -10,7 +10,7 @@ import com.powsybl.commons.PowsyblException; import com.powsybl.iidm.network.*; import com.powsybl.iidm.network.extensions.GeneratorShortCircuit; -import com.powsybl.sc.extensions.GeneratorFortescue; +import com.powsybl.sc.extensions.GeneratorFortescueType; import com.powsybl.sc.extensions.GeneratorShortCircuit2; import com.powsybl.sc.extensions.ThreeWindingsTransformerFortescue; import com.powsybl.sc.extensions.TwoWindingsTransformerFortescue; @@ -413,10 +413,10 @@ public double getKg(Generator gen) { // Check if not feeder boolean isFeeder = false; - GeneratorFortescue extensions2 = gen.getExtension(GeneratorFortescue.class); + GeneratorFortescueType extensions2 = gen.getExtension(GeneratorFortescueType.class); if (extensions2 != null) { - GeneratorFortescue.GeneratorType genType = extensions2.getGeneratorType(); - if (genType == GeneratorFortescue.GeneratorType.FEEDER) { + GeneratorFortescueType.GeneratorType genType = extensions2.getGeneratorType(); + if (genType == GeneratorFortescueType.GeneratorType.FEEDER) { isFeeder = true; } } diff --git a/sc-implementation/src/main/java/com/powsybl/sc/implementation/ShortCircuitNormNone.java b/sc-implementation/src/main/java/com/powsybl/sc/implementation/ShortCircuitNormNone.java index eed34b9..725e47a 100644 --- a/sc-implementation/src/main/java/com/powsybl/sc/implementation/ShortCircuitNormNone.java +++ b/sc-implementation/src/main/java/com/powsybl/sc/implementation/ShortCircuitNormNone.java @@ -8,7 +8,7 @@ package com.powsybl.sc.implementation; import com.powsybl.iidm.network.*; -import com.powsybl.sc.extensions.GeneratorFortescue; +import com.powsybl.sc.extensions.GeneratorFortescueType; import com.powsybl.sc.util.extensions.GeneratorNorm; import com.powsybl.sc.util.extensions.ShortCircuitNormExtensions; import com.powsybl.sc.util.extensions.ThreeWindingsTransformerNorm; @@ -141,11 +141,10 @@ public void applyNormToT2W(Network network) { public void applyNormToGenerators(Network network) { // Work on generators for (Generator gen : network.getGenerators()) { - - GeneratorFortescue extensions2 = gen.getExtension(GeneratorFortescue.class); - if (extensions2 != null) { - GeneratorFortescue.GeneratorType genType = extensions2.getGeneratorType(); - if (genType == GeneratorFortescue.GeneratorType.FEEDER) { + GeneratorFortescueType extensionGenType = gen.getExtension(GeneratorFortescueType.class); + if (extensionGenType != null) { + GeneratorFortescueType.GeneratorType genType = extensionGenType.getGeneratorType(); + if (genType == GeneratorFortescueType.GeneratorType.FEEDER) { //adjustGenValuesWithFeederInputs(gen); } else { // this includes standard rotating machines diff --git a/sc-implementation/src/main/java/com/powsybl/sc/util/extensions/ShortCircuitExtensions.java b/sc-implementation/src/main/java/com/powsybl/sc/util/extensions/ShortCircuitExtensions.java index e55bc59..ae87b1f 100644 --- a/sc-implementation/src/main/java/com/powsybl/sc/util/extensions/ShortCircuitExtensions.java +++ b/sc-implementation/src/main/java/com/powsybl/sc/util/extensions/ShortCircuitExtensions.java @@ -8,6 +8,7 @@ package com.powsybl.sc.util.extensions; import com.powsybl.iidm.network.*; +import com.powsybl.iidm.network.extensions.GeneratorFortescue; import com.powsybl.iidm.network.extensions.GeneratorShortCircuit; import com.powsybl.iidm.network.extensions.WindingConnectionType; import com.powsybl.openloadflow.network.*; @@ -259,9 +260,9 @@ private static void addGeneratorExtension(Network network, LfGenerator lfGenerat GeneratorFortescue extensionFortescue = generator.getExtension(GeneratorFortescue.class); if (extensionFortescue != null) { - toGround = extensionFortescue.isToGround(); - ro = extensionFortescue.getRo(); - xo = extensionFortescue.getXo(); + toGround = extensionFortescue.isGrounded(); + ro = extensionFortescue.getRz(); + xo = extensionFortescue.getXz(); } GeneratorNorm extensionGenNorm = shortCircuitNormExtensions.getNormExtension(generator); diff --git a/sc-implementation/src/test/java/com/powsybl/sc/implementation/ShortCircuitMonophasedTest.java b/sc-implementation/src/test/java/com/powsybl/sc/implementation/ShortCircuitMonophasedTest.java index bf742d6..104f66c 100644 --- a/sc-implementation/src/test/java/com/powsybl/sc/implementation/ShortCircuitMonophasedTest.java +++ b/sc-implementation/src/test/java/com/powsybl/sc/implementation/ShortCircuitMonophasedTest.java @@ -10,6 +10,7 @@ import com.powsybl.computation.ComputationManager; import com.powsybl.computation.local.LocalComputationManager; import com.powsybl.iidm.network.*; +import com.powsybl.iidm.network.extensions.GeneratorFortescueAdder; import com.powsybl.iidm.network.extensions.GeneratorShortCircuitAdder; import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; @@ -17,7 +18,7 @@ import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.math.matrix.MatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowProvider; -import com.powsybl.sc.extensions.GeneratorFortescueAdder; +import com.powsybl.sc.extensions.GeneratorFortescueTypeAdder; import com.powsybl.sc.extensions.LineFortescueAdder; import com.powsybl.sc.util.ReferenceNetwork; import com.powsybl.shortcircuit.*; @@ -160,8 +161,14 @@ void computeIoTestNew() { LoadFlowResult resultntg = loadFlowRunner.run(network, parameters); network.getGenerator("GB").newExtension(GeneratorFortescueAdder.class) - .withToGround(true) - .withXo(130) // initialized with subtransXd by default + .withGrounded(true) + .withXz(130) // initialized with subtransXd by default + .withRz(0) + .withRn(0) + .withXn(0) + .add(); + + network.getGenerator("GB").newExtension(GeneratorFortescueTypeAdder.class) .add(); List faultList = new ArrayList<>(); diff --git a/sc-implementation/src/test/java/com/powsybl/sc/implementation/ShortCircuitNormTest.java b/sc-implementation/src/test/java/com/powsybl/sc/implementation/ShortCircuitNormTest.java index dc56414..351ac85 100644 --- a/sc-implementation/src/test/java/com/powsybl/sc/implementation/ShortCircuitNormTest.java +++ b/sc-implementation/src/test/java/com/powsybl/sc/implementation/ShortCircuitNormTest.java @@ -8,6 +8,7 @@ package com.powsybl.sc.implementation; import com.powsybl.iidm.network.*; +import com.powsybl.iidm.network.extensions.GeneratorFortescueAdder; import com.powsybl.iidm.network.extensions.GeneratorShortCircuit; import com.powsybl.iidm.network.extensions.GeneratorShortCircuitAdder; import com.powsybl.iidm.network.extensions.WindingConnectionType; @@ -93,8 +94,11 @@ void shortCircuitNormTest() { .add(); g1.newExtension(GeneratorFortescueAdder.class) - .withToGround(true) - .withGeneratorType(GeneratorFortescue.GeneratorType.FEEDER) + .withGrounded(true) + .add(); + + g1.newExtension(GeneratorFortescueTypeAdder.class) + .withGeneratorType(GeneratorFortescueType.GeneratorType.FEEDER) .add(); shortCircuitNormNone.applyNormToNetwork(network); @@ -277,7 +281,10 @@ public static Network createNormNetwork() { .add(); g1.newExtension(GeneratorFortescueAdder.class) - .withToGround(true) + .withGrounded(true) + .add(); + + g1.newExtension(GeneratorFortescueTypeAdder.class) .add(); var t12 = substation1.newTwoWindingsTransformer() diff --git a/sc-implementation/src/test/java/com/powsybl/sc/util/ReferenceNetwork.java b/sc-implementation/src/test/java/com/powsybl/sc/util/ReferenceNetwork.java index 9b64526..84175f9 100644 --- a/sc-implementation/src/test/java/com/powsybl/sc/util/ReferenceNetwork.java +++ b/sc-implementation/src/test/java/com/powsybl/sc/util/ReferenceNetwork.java @@ -8,6 +8,7 @@ package com.powsybl.sc.util; import com.powsybl.iidm.network.*; +import com.powsybl.iidm.network.extensions.GeneratorFortescueAdder; import com.powsybl.iidm.network.extensions.GeneratorShortCircuitAdder; import com.powsybl.iidm.network.extensions.WindingConnectionType; import com.powsybl.sc.extensions.*; @@ -1256,14 +1257,21 @@ public static Network createShortCircuitIec31testNetwork() { .add(); g1.newExtension(GeneratorFortescueAdder.class) - .withToGround(true) - .withXo(xG1 * coeffXoG1) - .withRo(rG1 * coeffRoG1) + .withGrounded(true) + .withXz(xG1 * coeffXoG1) + .withRz(rG1 * coeffRoG1) .add(); + // extension used to get the default generator type + g1.newExtension(GeneratorFortescueTypeAdder.class) + .add(); + q2.newExtension(GeneratorFortescueAdder.class) - .withToGround(true) - .withRo(rFeeder2 * coeffF2Ro) - .withXo(xFeeder2 * coeffF2Xo) + .withGrounded(true) + .withRz(rFeeder2 * coeffF2Ro) + .withXz(xFeeder2 * coeffF2Xo) + .add(); + // extension used to get the default generator type + q2.newExtension(GeneratorFortescueTypeAdder.class) .add(); // transformers :