From f64c6d95a4c049374403507bfe2405f913e3c928 Mon Sep 17 00:00:00 2001 From: Lisrte Date: Wed, 18 Oct 2023 17:13:48 +0200 Subject: [PATCH] Refactor bus models (#261) * Split Bus model in three models based on use case : - connection point for equipment connection (use static id for macro connect with default bus) - action point for automaton (replace default bus model) - bus of equipment for omegaref (use equipment id instead of bus id for macro connect) * Replace OmegaRef with SetPoint when a StandardBus is found Signed-off-by: lisrte --- .../dynawaltz-inputs/powsybl_dynawaltz.dyd | 64 +++++------ .../dynawaltz-inputs/powsybl_dynawaltz.dyd | 64 +++++------ .../dynawaltz-inputs/powsybl_dynawaltz.dyd | 64 +++++------ .../dynawaltz-inputs/powsybl_dynawaltz.dyd | 38 +++---- .../powsybl/dynawaltz/DynaWaltzContext.java | 27 ++--- .../models/AbstractBlackBoxModel.java | 21 ++++ ...Point.java => MeasurementPointSuffix.java} | 12 ++- .../TapChangerBlockingAutomaton.java | 8 +- .../dynawaltz/models/buses/AbstractBus.java | 7 +- ...sModel.java => ActionConnectionPoint.java} | 13 ++- .../BusOfFrequencySynchronizedModel.java | 20 ++++ ...java => DefaultActionConnectionPoint.java} | 21 ++-- .../DefaultBusOfFrequencySynchronized.java | 19 ++++ .../DefaultEquipmentConnectionPoint.java | 63 +++++++++++ .../buses/EquipmentConnectionPoint.java | 32 ++++++ .../defaultmodels/DefaultModelsHandler.java | 10 +- .../models/events/NodeFaultEvent.java | 6 +- .../FrequencySynchronizedModel.java | 2 +- .../frequencysynchronizers/OmegaRef.java | 14 +-- .../models/generators/AbstractGenerator.java | 7 +- .../generators/GridFormingConverter.java | 14 +-- .../generators/SynchronizedGenerator.java | 7 -- .../generators/SynchronizedWeccGen.java | 7 -- .../dynawaltz/models/generators/WeccGen.java | 7 +- .../dynawaltz/models/hvdc/AbstractHvdc.java | 15 ++- .../dynawaltz/models/hvdc/DanglingSide.java | 10 +- .../dynawaltz/models/hvdc/HvdcPDangling.java | 5 +- .../models/hvdc/HvdcVscDangling.java | 4 +- .../dynawaltz/models/lines/StandardLine.java | 10 +- .../dynawaltz/models/loads/AbstractLoad.java | 7 +- .../dynawaltz/models/loads/BaseLoad.java | 4 +- .../models/loads/LoadOneTransformer.java | 4 +- .../loads/LoadOneTransformerTapChanger.java | 4 +- .../models/loads/LoadTwoTransformers.java | 4 +- .../loads/LoadTwoTransformersTapChangers.java | 4 +- .../models/svarcs/StaticVarCompensator.java | 7 +- .../transformers/TransformerFixedRatio.java | 10 +- .../dynawaltz/models/utils/BusUtils.java | 17 +-- dynawaltz/src/test/resources/apv_dyd.xml | 32 +++--- dynawaltz/src/test/resources/cla_dyd.xml | 12 +-- .../src/test/resources/disconnect_dyd.xml | 8 +- .../disconnect_hvdc_pv_dangling_dyd.xml | 14 +-- .../test/resources/disconnect_hvdc_pv_dyd.xml | 16 +-- .../disconnect_hvdc_vsc_dangling_dyd.xml | 14 +-- .../resources/disconnect_hvdc_vsc_dyd.xml | 16 +-- dynawaltz/src/test/resources/dyd.xml | 100 +++++++++--------- .../src/test/resources/dyd_fictitious.xml | 8 +- dynawaltz/src/test/resources/events.xml | 14 +-- .../resources/grid_forming_converter_dyd.xml | 12 +-- .../test/resources/hvdc_p_dangling_dyd.xml | 14 +-- dynawaltz/src/test/resources/hvdc_p_dyd.xml | 16 +-- .../test/resources/hvdc_vsc_dangling_dyd.xml | 14 +-- dynawaltz/src/test/resources/hvdc_vsc_dyd.xml | 16 +-- .../test/resources/load_alpha_beta_dyd.xml | 8 +- .../resources/load_one_transformer_dyd.xml | 10 +- .../load_one_transformer_tap_changer_dyd.xml | 12 +-- .../resources/load_two_transformers_dyd.xml | 12 +-- ...load_two_transformers_tap_changers_dyd.xml | 16 +-- .../src/test/resources/node_fault_dyd.xml | 4 +- .../src/test/resources/omega_ref_dyd.xml | 34 +++--- .../test/resources/phase_shifter_i_dyd.xml | 12 +-- .../test/resources/set_point_inf_bus_dyd.xml | 6 +- dynawaltz/src/test/resources/svarc_dyd.xml | 6 +- .../resources/tap_changer_blocking_dyd.xml | 48 ++++----- .../tap_changer_blocking_empty_dyd.xml | 10 +- .../tap_changer_blocking_tap_changer_dyd.xml | 28 ++--- .../src/test/resources/tap_changer_dyd.xml | 24 ++--- .../test/resources/tap_changer_empty_dyd.xml | 8 +- dynawaltz/src/test/resources/tfr_dyd.xml | 12 +-- dynawaltz/src/test/resources/wecc_pv_dyd.xml | 12 +-- dynawaltz/src/test/resources/wecc_wt_dyd.xml | 6 +- .../test/resources/wecc_wt_synchro_dyd.xml | 12 +-- 72 files changed, 668 insertions(+), 570 deletions(-) rename dynawaltz/src/main/java/com/powsybl/dynawaltz/models/{macroconnections/MeasurementPoint.java => MeasurementPointSuffix.java} (66%) rename dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/{BusModel.java => ActionConnectionPoint.java} (60%) create mode 100644 dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/BusOfFrequencySynchronizedModel.java rename dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/{DefaultBus.java => DefaultActionConnectionPoint.java} (65%) create mode 100644 dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultBusOfFrequencySynchronized.java create mode 100644 dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultEquipmentConnectionPoint.java create mode 100644 dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/EquipmentConnectionPoint.java diff --git a/dynawaltz-dsl/src/test/resources/ieee14-currentlimitautomaton/dynawaltz-inputs/powsybl_dynawaltz.dyd b/dynawaltz-dsl/src/test/resources/ieee14-currentlimitautomaton/dynawaltz-inputs/powsybl_dynawaltz.dyd index 4a70b0fc9..31f7aa04c 100644 --- a/dynawaltz-dsl/src/test/resources/ieee14-currentlimitautomaton/dynawaltz-inputs/powsybl_dynawaltz.dyd +++ b/dynawaltz-dsl/src/test/resources/ieee14-currentlimitautomaton/dynawaltz-inputs/powsybl_dynawaltz.dyd @@ -52,17 +52,17 @@ - - - + + + - - - + + + - - - + + + @@ -76,8 +76,8 @@ - - + + @@ -102,35 +102,35 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - + - + - + - + diff --git a/dynawaltz-dsl/src/test/resources/ieee14-disconnectline/dynawaltz-inputs/powsybl_dynawaltz.dyd b/dynawaltz-dsl/src/test/resources/ieee14-disconnectline/dynawaltz-inputs/powsybl_dynawaltz.dyd index e220bde93..5ec4dc0b3 100644 --- a/dynawaltz-dsl/src/test/resources/ieee14-disconnectline/dynawaltz-inputs/powsybl_dynawaltz.dyd +++ b/dynawaltz-dsl/src/test/resources/ieee14-disconnectline/dynawaltz-inputs/powsybl_dynawaltz.dyd @@ -50,25 +50,25 @@ - - - + + + - - - + + + - - - + + + - - + + @@ -93,31 +93,31 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - + - + - + - + diff --git a/dynawaltz-dsl/src/test/resources/ieee14-macroconnects/dynawaltz-inputs/powsybl_dynawaltz.dyd b/dynawaltz-dsl/src/test/resources/ieee14-macroconnects/dynawaltz-inputs/powsybl_dynawaltz.dyd index 49a579af0..c7d4d570f 100644 --- a/dynawaltz-dsl/src/test/resources/ieee14-macroconnects/dynawaltz-inputs/powsybl_dynawaltz.dyd +++ b/dynawaltz-dsl/src/test/resources/ieee14-macroconnects/dynawaltz-inputs/powsybl_dynawaltz.dyd @@ -49,25 +49,25 @@ - - - + + + - - - + + + - - - + + + - - + + @@ -89,30 +89,30 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - + - + - + - + diff --git a/dynawaltz-dsl/src/test/resources/ieee57-disconnectgenerator/dynawaltz-inputs/powsybl_dynawaltz.dyd b/dynawaltz-dsl/src/test/resources/ieee57-disconnectgenerator/dynawaltz-inputs/powsybl_dynawaltz.dyd index 342eebf1b..e8dcc5bb7 100644 --- a/dynawaltz-dsl/src/test/resources/ieee57-disconnectgenerator/dynawaltz-inputs/powsybl_dynawaltz.dyd +++ b/dynawaltz-dsl/src/test/resources/ieee57-disconnectgenerator/dynawaltz-inputs/powsybl_dynawaltz.dyd @@ -23,17 +23,17 @@ - - - + + + - - + + @@ -43,26 +43,26 @@ - - - - - - - + + + + + + + - + - + - + - + - + - + - + diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynaWaltzContext.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynaWaltzContext.java index 0e8a41f1a..608d940ee 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynaWaltzContext.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynaWaltzContext.java @@ -10,7 +10,9 @@ import com.powsybl.dynamicsimulation.Curve; import com.powsybl.dynamicsimulation.DynamicSimulationParameters; import com.powsybl.dynawaltz.models.*; -import com.powsybl.dynawaltz.models.buses.InfiniteBus; +import com.powsybl.dynawaltz.models.buses.AbstractBus; +import com.powsybl.dynawaltz.models.buses.EquipmentConnectionPoint; +import com.powsybl.dynawaltz.models.buses.DefaultEquipmentConnectionPoint; import com.powsybl.dynawaltz.models.defaultmodels.DefaultModelsHandler; import com.powsybl.dynawaltz.models.frequencysynchronizers.FrequencySynchronizedModel; import com.powsybl.dynawaltz.models.frequencysynchronizers.FrequencySynchronizerModel; @@ -74,7 +76,7 @@ public DynaWaltzContext(Network network, String workingVariantId, List new MacroStaticReference(k, bbm.getVarsMapping())); @@ -171,6 +173,17 @@ public T getPureDynamicModel(String dynamicId, Class connec } } + public EquipmentConnectionPoint getConnectionPointDynamicModel(String staticId) { + BlackBoxModel bbm = staticIdBlackBoxModelMap.get(staticId); + if (bbm == null) { + return DefaultEquipmentConnectionPoint.getInstance(); + } + if (bbm instanceof EquipmentConnectionPoint cp) { + return cp; + } + throw new PowsyblException(String.format(MODEL_ID_EXCEPTION, staticId, "ConnectionPoint")); + } + protected static Predicate distinctByStaticId() { Set seen = new HashSet<>(); return bbm -> { @@ -197,20 +210,10 @@ public void addMacroConnect(String macroConnectorId, List macroConnectList.add(new MacroConnect(macroConnectorId, attributesFrom, attributesTo)); } - public void addMacroConnect(String macroConnectorId, List attributesFrom) { - macroConnectList.add(new MacroConnect(macroConnectorId, attributesFrom)); - } - public List getMacroConnectList() { return macroConnectList; } - public String addMacroConnector(String name1, List varConnections) { - String macroConnectorId = MacroConnector.createMacroConnectorId(name1); - macroConnectorsMap.computeIfAbsent(macroConnectorId, k -> new MacroConnector(macroConnectorId, varConnections)); - return macroConnectorId; - } - public String addMacroConnector(String name1, String name2, List varConnections) { String macroConnectorId = MacroConnector.createMacroConnectorId(name1, name2); macroConnectorsMap.computeIfAbsent(macroConnectorId, k -> new MacroConnector(macroConnectorId, varConnections)); diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/AbstractBlackBoxModel.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/AbstractBlackBoxModel.java index 9bf57b720..c5a62731c 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/AbstractBlackBoxModel.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/AbstractBlackBoxModel.java @@ -12,6 +12,10 @@ import com.powsybl.dynawaltz.models.macroconnections.MacroConnectionSuffix; import com.powsybl.dynawaltz.parameters.ParametersSet; import com.powsybl.iidm.network.Identifiable; +import com.powsybl.dynawaltz.models.buses.EquipmentConnectionPoint; +import com.powsybl.dynawaltz.models.utils.BusUtils; +import com.powsybl.dynawaltz.models.utils.SideConverter; +import com.powsybl.iidm.network.*; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; @@ -171,4 +175,21 @@ protected final void createMacroConnections(Identifiable eq List fromAttributes = Stream.concat(getMacroConnectFromAttributes().stream(), Arrays.stream(connectFromAttributes)).collect(Collectors.toList()); context.addMacroConnect(macroConnectorId, fromAttributes, connectedModel.getMacroConnectToAttributes()); } + + protected void createTerminalMacroConnections(Injection equipment, Function> varConnectionsSupplier, DynaWaltzContext context) { + EquipmentConnectionPoint connectedModel = context.getConnectionPointDynamicModel(BusUtils.getConnectableBusStaticId(equipment)); + String macroConnectorId = context.addMacroConnector(getName(), connectedModel.getName(), varConnectionsSupplier.apply(connectedModel)); + context.addMacroConnect(macroConnectorId, getMacroConnectFromAttributes(), connectedModel.getMacroConnectToAttributes()); + } + + protected final void createTerminalMacroConnections(Terminal terminal, BiFunction> varConnectionsSupplier, DynaWaltzContext context, Side side) { + EquipmentConnectionPoint connectedModel = context.getConnectionPointDynamicModel(BusUtils.getConnectableBusStaticId(terminal)); + String macroConnectorId = context.addMacroConnector(getName(), connectedModel.getName(), side, varConnectionsSupplier.apply(connectedModel, side)); + context.addMacroConnect(macroConnectorId, getMacroConnectFromAttributes(), connectedModel.getMacroConnectToAttributes()); + } + + protected final void createTerminalMacroConnections(HvdcLine hvdc, BiFunction> varConnectionsSupplier, DynaWaltzContext context, Side side) { + HvdcConverterStation station = hvdc.getConverterStation(SideConverter.convert(side)); + createTerminalMacroConnections(station.getTerminal(), varConnectionsSupplier, context, side); + } } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/macroconnections/MeasurementPoint.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/MeasurementPointSuffix.java similarity index 66% rename from dynawaltz/src/main/java/com/powsybl/dynawaltz/models/macroconnections/MeasurementPoint.java rename to dynawaltz/src/main/java/com/powsybl/dynawaltz/models/MeasurementPointSuffix.java index e4b917fd4..c59e0bedc 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/macroconnections/MeasurementPoint.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/MeasurementPointSuffix.java @@ -5,28 +5,30 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. * SPDX-License-Identifier: MPL-2.0 */ -package com.powsybl.dynawaltz.models.macroconnections; +package com.powsybl.dynawaltz.models; + +import com.powsybl.dynawaltz.models.macroconnections.MacroConnectionSuffix; /** * @author Laurent Issertial */ -public final class MeasurementPoint implements MacroConnectionSuffix { +public final class MeasurementPointSuffix implements MacroConnectionSuffix { private static final String MEASURE_PREFIX = "Measure"; private final String idSuffix; private final String connectionSuffix; - private MeasurementPoint(String idSuffix, String connectionSuffix) { + private MeasurementPointSuffix(String idSuffix, String connectionSuffix) { this.idSuffix = idSuffix; this.connectionSuffix = connectionSuffix; } - public static MeasurementPoint of(int i) { + public static MeasurementPointSuffix of(int i) { if (i < 1) { throw new IllegalArgumentException(); } - return new MeasurementPoint(MEASURE_PREFIX + i, i != 1 ? String.valueOf(i) : ""); + return new MeasurementPointSuffix(MEASURE_PREFIX + i, i != 1 ? String.valueOf(i) : ""); } public String getIdSuffix() { diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automatons/TapChangerBlockingAutomaton.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automatons/TapChangerBlockingAutomaton.java index 22efa11e4..ee1a9a9e0 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automatons/TapChangerBlockingAutomaton.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automatons/TapChangerBlockingAutomaton.java @@ -10,9 +10,9 @@ import com.powsybl.commons.PowsyblException; import com.powsybl.dynawaltz.DynaWaltzContext; import com.powsybl.dynawaltz.models.AbstractPureDynamicBlackBoxModel; -import com.powsybl.dynawaltz.models.macroconnections.MeasurementPoint; +import com.powsybl.dynawaltz.models.MeasurementPointSuffix; import com.powsybl.dynawaltz.models.VarConnection; -import com.powsybl.dynawaltz.models.buses.BusModel; +import com.powsybl.dynawaltz.models.buses.ActionConnectionPoint; import com.powsybl.dynawaltz.models.transformers.TapChangerModel; import com.powsybl.iidm.network.Bus; import com.powsybl.iidm.network.IdentifiableType; @@ -99,7 +99,7 @@ public void createMacroConnections(DynaWaltzContext context) { if (!transformers.isEmpty() || skippedTapChangers < (loadsWithTransformer.size() + tapChangerAutomatonIds.size())) { int i = 1; for (Bus bus : uMeasurements) { - createMacroConnections(bus, BusModel.class, this::getVarConnectionsWith, context, MeasurementPoint.of(i)); + createMacroConnections(bus, ActionConnectionPoint.class, this::getVarConnectionsWith, context, MeasurementPointSuffix.of(i)); i++; } } else { @@ -112,7 +112,7 @@ private List getVarConnectionsWith(TapChangerModel connected) { return connected.getTapChangerBlockerVarConnections(); } - private List getVarConnectionsWith(BusModel connected, String suffix) { + private List getVarConnectionsWith(ActionConnectionPoint connected, String suffix) { return connected.getUImpinVarName() .map(uImpinVarName -> List.of(new VarConnection("tapChangerBlocking_UMonitored" + suffix, uImpinVarName))) .orElse(Collections.emptyList()); diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/AbstractBus.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/AbstractBus.java index c73ad40d9..1f56d21d6 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/AbstractBus.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/AbstractBus.java @@ -20,7 +20,7 @@ /** * @author Laurent Issertial */ -public abstract class AbstractBus extends AbstractEquipmentBlackBoxModel implements BusModel { +public abstract class AbstractBus extends AbstractEquipmentBlackBoxModel implements EquipmentConnectionPoint, ActionConnectionPoint { protected AbstractBus(String dynamicModelId, Bus bus, String parameterSetId, String lib) { super(dynamicModelId, parameterSetId, bus, lib); @@ -59,11 +59,6 @@ public Optional getSwitchOffSignalVarName() { return Optional.empty(); } - @Override - public Optional getNumCCVarName() { - return Optional.empty(); - } - @Override public Optional getUImpinVarName() { return Optional.empty(); diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/BusModel.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/ActionConnectionPoint.java similarity index 60% rename from dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/BusModel.java rename to dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/ActionConnectionPoint.java index 54e781deb..9dadb83bc 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/BusModel.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/ActionConnectionPoint.java @@ -1,8 +1,9 @@ /** - * Copyright (c) 2022, RTE (http://www.rte-france.com) + * Copyright (c) 2023, RTE (http://www.rte-france.com/) * 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/. + * SPDX-License-Identifier: MPL-2.0 */ package com.powsybl.dynawaltz.models.buses; @@ -11,14 +12,12 @@ import java.util.Optional; /** - * @author Florian Dupuy + * Interface for buses used by automatons for measure or event for various actions + * @author Laurent Issertial */ -public interface BusModel extends Model { - String getTerminalVarName(); - - Optional getSwitchOffSignalVarName(); +public interface ActionConnectionPoint extends Model { - Optional getNumCCVarName(); + String getTerminalVarName(); Optional getUImpinVarName(); diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/BusOfFrequencySynchronizedModel.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/BusOfFrequencySynchronizedModel.java new file mode 100644 index 000000000..ffcc73c58 --- /dev/null +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/BusOfFrequencySynchronizedModel.java @@ -0,0 +1,20 @@ +/** + * Copyright (c) 2023, RTE (http://www.rte-france.com/) + * 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/. + * SPDX-License-Identifier: MPL-2.0 + */ +package com.powsybl.dynawaltz.models.buses; + +import com.powsybl.dynawaltz.models.Model; + +/** + * View of frequency synchronized equipment from the bus to which it is connected + * Used by FrequencySynchronizer in order to get NummCC var name + * @author Laurent Issertial + */ +public interface BusOfFrequencySynchronizedModel extends Model { + + String getNumCCVarName(); +} diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultBus.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultActionConnectionPoint.java similarity index 65% rename from dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultBus.java rename to dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultActionConnectionPoint.java index fa61007cb..fa5ef173d 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultBus.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultActionConnectionPoint.java @@ -1,8 +1,9 @@ /** - * Copyright (c) 2022, RTE (http://www.rte-france.com) + * Copyright (c) 2023, RTE (http://www.rte-france.com/) * 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/. + * SPDX-License-Identifier: MPL-2.0 */ package com.powsybl.dynawaltz.models.buses; @@ -11,16 +12,18 @@ import java.util.Optional; /** + * @author Laurent Issertial * @author Florian Dupuy */ -public class DefaultBus extends AbstractDefaultModel implements BusModel { - public DefaultBus(String staticId) { +public class DefaultActionConnectionPoint extends AbstractDefaultModel implements ActionConnectionPoint { + + public DefaultActionConnectionPoint(String staticId) { super(staticId); } @Override public String getName() { - return "DefaultBus"; + return "DefaultActionConnectionPoint"; } @Override @@ -28,16 +31,6 @@ public String getTerminalVarName() { return "@NAME@_ACPIN"; } - @Override - public Optional getSwitchOffSignalVarName() { - return Optional.of("@NAME@_switchOff"); - } - - @Override - public Optional getNumCCVarName() { - return Optional.of("@NAME@_numcc"); - } - @Override public Optional getUImpinVarName() { return Optional.of("@NAME@_U"); diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultBusOfFrequencySynchronized.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultBusOfFrequencySynchronized.java new file mode 100644 index 000000000..ed59655c8 --- /dev/null +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultBusOfFrequencySynchronized.java @@ -0,0 +1,19 @@ +package com.powsybl.dynawaltz.models.buses; + +import com.powsybl.dynawaltz.models.defaultmodels.AbstractDefaultModel; + +public class DefaultBusOfFrequencySynchronized extends AbstractDefaultModel implements BusOfFrequencySynchronizedModel { + + public DefaultBusOfFrequencySynchronized(String staticId) { + super(staticId); + } + + @Override + public String getName() { + return "DefaultBusOfEquipment"; + } + + public String getNumCCVarName() { + return "@@NAME@@@NODE@_numcc"; + } +} diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultEquipmentConnectionPoint.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultEquipmentConnectionPoint.java new file mode 100644 index 000000000..1da6f4c9c --- /dev/null +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultEquipmentConnectionPoint.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) 2023, RTE (http://www.rte-france.com/) + * 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/. + * SPDX-License-Identifier: MPL-2.0 + */ +package com.powsybl.dynawaltz.models.buses; + +import com.powsybl.dynawaltz.models.Side; +import com.powsybl.dynawaltz.models.macroconnections.MacroConnectAttribute; +import com.powsybl.dynawaltz.xml.DynaWaltzXmlConstants; + +import java.util.List; +import java.util.Optional; + +/** + * Used for the connection between an equipment and a bus. + * Since the equipment static id (@STATIC_ID@ in varname) is the only information needed in order to create var connections, + * DefaultBusModel is implemented as a singleton + * @author Laurent Issertial + */ +public final class DefaultEquipmentConnectionPoint implements EquipmentConnectionPoint { + + private static final DefaultEquipmentConnectionPoint INSTANCE = new DefaultEquipmentConnectionPoint(); + + private DefaultEquipmentConnectionPoint() { + } + + public static DefaultEquipmentConnectionPoint getInstance() { + return INSTANCE; + } + + @Override + public String getName() { + return "DefaultEquipmentConnectionPoint"; + } + + @Override + public String getTerminalVarName() { + return "@STATIC_ID@@NODE@_ACPIN"; + } + + @Override + public String getTerminalVarName(Side side) { + return "@STATIC_ID@@NODE" + side.getSideNumber() + "@_ACPIN"; + } + + @Override + public Optional getSwitchOffSignalVarName() { + return Optional.of("@STATIC_ID@@NODE@_switchOff"); + } + + @Override + public Optional getSwitchOffSignalVarName(Side side) { + return Optional.of("@STATIC_ID@@NODE" + side.getSideNumber() + "@_switchOff"); + } + + @Override + public List getMacroConnectToAttributes() { + return List.of(MacroConnectAttribute.of("id2", DynaWaltzXmlConstants.NETWORK)); + } +} diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/EquipmentConnectionPoint.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/EquipmentConnectionPoint.java new file mode 100644 index 000000000..4ef77177c --- /dev/null +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/EquipmentConnectionPoint.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) 2023, RTE (http://www.rte-france.com/) + * 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/. + * SPDX-License-Identifier: MPL-2.0 + */ +package com.powsybl.dynawaltz.models.buses; + +import com.powsybl.dynawaltz.models.Model; +import com.powsybl.dynawaltz.models.Side; + +import java.util.Optional; + +/** + * Interface use for buses by equipments for connection with the network + * @author Laurent Issertial + */ +public interface EquipmentConnectionPoint extends Model { + + String getTerminalVarName(); + + default String getTerminalVarName(Side side) { + return getTerminalVarName(); + } + + Optional getSwitchOffSignalVarName(); + + default Optional getSwitchOffSignalVarName(Side side) { + return getSwitchOffSignalVarName(); + } +} diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/defaultmodels/DefaultModelsHandler.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/defaultmodels/DefaultModelsHandler.java index 656048e65..442178885 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/defaultmodels/DefaultModelsHandler.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/defaultmodels/DefaultModelsHandler.java @@ -8,8 +8,8 @@ import com.powsybl.commons.PowsyblException; import com.powsybl.dynawaltz.models.Model; -import com.powsybl.dynawaltz.models.buses.BusModel; -import com.powsybl.dynawaltz.models.buses.DefaultBus; +import com.powsybl.dynawaltz.models.buses.DefaultActionConnectionPoint; +import com.powsybl.dynawaltz.models.buses.ActionConnectionPoint; import com.powsybl.dynawaltz.models.generators.GeneratorModel; import com.powsybl.dynawaltz.models.generators.DefaultGenerator; import com.powsybl.dynawaltz.models.hvdc.DefaultHvdc; @@ -44,7 +44,7 @@ public class DefaultModelsHandler { private final Map, DefaultModelFactory> factoryMap; public DefaultModelsHandler() { - factoryMap = Map.of(BusModel.class, new DefaultModelFactory(DefaultBus::new), + factoryMap = Map.of(ActionConnectionPoint.class, new DefaultModelFactory(DefaultActionConnectionPoint::new), GeneratorModel.class, new DefaultModelFactory(DefaultGenerator::new), HvdcModel.class, new DefaultModelFactory(DefaultHvdc::new), LineModel.class, new DefaultModelFactory(DefaultLine::new), @@ -53,7 +53,9 @@ public DefaultModelsHandler() { StaticVarCompensatorModel.class, new DefaultModelFactory(DefaultStaticVarCompensator::new), TransformerModel.class, new DefaultModelFactory(DefaultTransformer::new)); - powSyBlTypeToModel.put(IdentifiableType.BUS, BusModel.class); + // When using the bus equipment DefaultModelsHandler will always instantiate the DefaultActionConnectionPoint default model, + // for EquipmentConnectionPoint the DefaultBus singleton will be accessed via DynaWaltzContext::getConnectionPointDynamicModel + powSyBlTypeToModel.put(IdentifiableType.BUS, ActionConnectionPoint.class); powSyBlTypeToModel.put(IdentifiableType.GENERATOR, GeneratorModel.class); powSyBlTypeToModel.put(IdentifiableType.HVDC_LINE, HvdcModel.class); powSyBlTypeToModel.put(IdentifiableType.LINE, LineModel.class); diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/events/NodeFaultEvent.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/events/NodeFaultEvent.java index bd4763d5b..8f4226486 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/events/NodeFaultEvent.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/events/NodeFaultEvent.java @@ -9,7 +9,7 @@ import com.powsybl.dynawaltz.DynaWaltzContext; import com.powsybl.dynawaltz.models.VarConnection; -import com.powsybl.dynawaltz.models.buses.BusModel; +import com.powsybl.dynawaltz.models.buses.ActionConnectionPoint; import com.powsybl.dynawaltz.parameters.ParametersSet; import com.powsybl.iidm.network.Bus; @@ -43,10 +43,10 @@ public String getLib() { @Override public void createMacroConnections(DynaWaltzContext context) { - createMacroConnections(getEquipment(), BusModel.class, this::getVarConnectionsWith, context); + createMacroConnections(getEquipment(), ActionConnectionPoint.class, this::getVarConnectionsWith, context); } - private List getVarConnectionsWith(BusModel connected) { + private List getVarConnectionsWith(ActionConnectionPoint connected) { return List.of(new VarConnection("fault_terminal", connected.getTerminalVarName())); } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/frequencysynchronizers/FrequencySynchronizedModel.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/frequencysynchronizers/FrequencySynchronizedModel.java index 464c170c9..d9711a178 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/frequencysynchronizers/FrequencySynchronizedModel.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/frequencysynchronizers/FrequencySynchronizedModel.java @@ -39,5 +39,5 @@ default double getWeightGen(DynaWaltzParameters dynaWaltzParameters) { String getRunningVarName(); - String getConnectedBusId(); + String getStaticId(); } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/frequencysynchronizers/OmegaRef.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/frequencysynchronizers/OmegaRef.java index fe6cef386..8eb2d0b57 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/frequencysynchronizers/OmegaRef.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/frequencysynchronizers/OmegaRef.java @@ -11,10 +11,10 @@ import com.powsybl.dynawaltz.DynaWaltzParameters; import com.powsybl.dynawaltz.models.macroconnections.MacroConnectAttribute; import com.powsybl.dynawaltz.models.VarConnection; -import com.powsybl.dynawaltz.models.buses.BusModel; +import com.powsybl.dynawaltz.models.buses.BusOfFrequencySynchronizedModel; +import com.powsybl.dynawaltz.models.buses.DefaultBusOfFrequencySynchronized; import com.powsybl.dynawaltz.parameters.ParametersSet; -import java.util.Collections; import java.util.List; import java.util.function.Consumer; @@ -61,10 +61,8 @@ private List getVarConnectionsWith(FrequencySynchronizedModel con return connected.getOmegaRefVarConnections(); } - private List getVarConnectionsWith(BusModel connected) { - return connected.getNumCCVarName() - .map(numCCVarName -> List.of(new VarConnection("numcc_node_@INDEX@", numCCVarName))) - .orElse(Collections.emptyList()); + private List getVarConnectionsWith(BusOfFrequencySynchronizedModel connected) { + return List.of(new VarConnection("numcc_node_@INDEX@", connected.getNumCCVarName())); } @Override @@ -72,7 +70,9 @@ public void createMacroConnections(DynaWaltzContext context) throws PowsyblExcep int index = 0; for (FrequencySynchronizedModel eq : synchronizedEquipments) { createMacroConnections(eq, getVarConnectionsWith(eq), context, MacroConnectAttribute.ofIndex1(index)); - createMacroConnections(eq.getConnectedBusId(), BusModel.class, this::getVarConnectionsWith, context, MacroConnectAttribute.ofIndex1(index)); + // If a bus with a dynamic model is found SetPoint is used in place of OmegaRef, thus at this point we don't have to handle dynamic model buses + BusOfFrequencySynchronizedModel busOf = new DefaultBusOfFrequencySynchronized(eq.getStaticId()); + createMacroConnections(busOf, getVarConnectionsWith(busOf), context, MacroConnectAttribute.ofIndex1(index)); index++; } } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/AbstractGenerator.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/AbstractGenerator.java index ba34d2d0a..52e4205ef 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/AbstractGenerator.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/AbstractGenerator.java @@ -10,8 +10,7 @@ import com.powsybl.dynawaltz.models.AbstractEquipmentBlackBoxModel; import com.powsybl.dynawaltz.models.VarConnection; import com.powsybl.dynawaltz.models.VarMapping; -import com.powsybl.dynawaltz.models.buses.BusModel; -import com.powsybl.dynawaltz.models.utils.BusUtils; +import com.powsybl.dynawaltz.models.buses.EquipmentConnectionPoint; import com.powsybl.iidm.network.Generator; import java.util.ArrayList; @@ -40,10 +39,10 @@ public List getVarsMapping() { @Override public void createMacroConnections(DynaWaltzContext context) { - createMacroConnections(BusUtils.getConnectableBusStaticId(equipment), BusModel.class, this::getVarConnectionsWith, context); + createTerminalMacroConnections(equipment, this::getVarConnectionsWith, context); } - private List getVarConnectionsWith(BusModel connected) { + private List getVarConnectionsWith(EquipmentConnectionPoint connected) { List varConnections = new ArrayList<>(2); varConnections.add(new VarConnection(getTerminalVarName(), connected.getTerminalVarName())); connected.getSwitchOffSignalVarName() diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/GridFormingConverter.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/GridFormingConverter.java index d30864f93..833007b69 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/GridFormingConverter.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/GridFormingConverter.java @@ -12,16 +12,13 @@ import com.powsybl.dynawaltz.models.AbstractEquipmentBlackBoxModel; import com.powsybl.dynawaltz.models.VarConnection; import com.powsybl.dynawaltz.models.VarMapping; -import com.powsybl.dynawaltz.models.buses.BusModel; +import com.powsybl.dynawaltz.models.buses.EquipmentConnectionPoint; import com.powsybl.dynawaltz.models.frequencysynchronizers.FrequencySynchronizedModel; -import com.powsybl.dynawaltz.models.utils.BusUtils; import com.powsybl.iidm.network.Generator; import java.util.Arrays; import java.util.List; -import static com.powsybl.dynawaltz.models.utils.BusUtils.getConnectableBusStaticId; - /** * @author Laurent Issertial */ @@ -38,10 +35,10 @@ public GridFormingConverter(String dynamicModelId, Generator generator, String p @Override public void createMacroConnections(DynaWaltzContext context) { - createMacroConnections(BusUtils.getConnectableBusStaticId(equipment), BusModel.class, this::getVarConnectionsWith, context); + createTerminalMacroConnections(equipment, this::getVarConnectionsWith, context); } - private List getVarConnectionsWith(BusModel connected) { + private List getVarConnectionsWith(EquipmentConnectionPoint connected) { return List.of(new VarConnection("converter_terminal", connected.getTerminalVarName())); } @@ -59,11 +56,6 @@ public String getRunningVarName() { return "converter_running"; } - @Override - public String getConnectedBusId() { - return getConnectableBusStaticId(equipment); - } - @Override public List getOmegaRefVarConnections() { return List.of( diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/SynchronizedGenerator.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/SynchronizedGenerator.java index c9100675a..0a3ec5245 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/SynchronizedGenerator.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/SynchronizedGenerator.java @@ -13,8 +13,6 @@ import java.util.List; -import static com.powsybl.dynawaltz.models.utils.BusUtils.getConnectableBusStaticId; - /** * @author Dimitri Baudrier * @author Laurent Issertial @@ -44,9 +42,4 @@ public List getSetPointVarConnections() { public String getOmegaRefPuVarName() { return "generator_omegaRefPu"; } - - @Override - public String getConnectedBusId() { - return getConnectableBusStaticId(equipment); - } } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/SynchronizedWeccGen.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/SynchronizedWeccGen.java index c75760db8..f19c93a21 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/SynchronizedWeccGen.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/SynchronizedWeccGen.java @@ -10,8 +10,6 @@ import com.powsybl.dynawaltz.models.frequencysynchronizers.FrequencySynchronizedModel; import com.powsybl.iidm.network.Generator; -import static com.powsybl.dynawaltz.models.utils.BusUtils.getConnectableBusStaticId; - /** * @author Laurent Issertial */ @@ -30,9 +28,4 @@ public String getOmegaRefPuVarName() { public String getRunningVarName() { return weccPrefix + "_injector_running"; } - - @Override - public String getConnectedBusId() { - return getConnectableBusStaticId(equipment); - } } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/WeccGen.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/WeccGen.java index 85421af72..07365edba 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/WeccGen.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/WeccGen.java @@ -11,8 +11,7 @@ import com.powsybl.dynawaltz.models.AbstractEquipmentBlackBoxModel; import com.powsybl.dynawaltz.models.VarConnection; import com.powsybl.dynawaltz.models.VarMapping; -import com.powsybl.dynawaltz.models.buses.BusModel; -import com.powsybl.dynawaltz.models.utils.BusUtils; +import com.powsybl.dynawaltz.models.buses.EquipmentConnectionPoint; import com.powsybl.iidm.network.Generator; import java.util.List; @@ -37,10 +36,10 @@ public WeccGen(String dynamicModelId, Generator generator, String parameterSetId @Override public void createMacroConnections(DynaWaltzContext context) { - createMacroConnections(BusUtils.getConnectableBusStaticId(equipment), BusModel.class, this::getVarConnectionsWith, context); + createTerminalMacroConnections(equipment, this::getVarConnectionsWith, context); } - private List getVarConnectionsWith(BusModel connected) { + private List getVarConnectionsWith(EquipmentConnectionPoint connected) { return List.of(new VarConnection(weccPrefix + "_terminal", connected.getTerminalVarName())); } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/AbstractHvdc.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/AbstractHvdc.java index 8dc6a1b62..8f83acc66 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/AbstractHvdc.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/AbstractHvdc.java @@ -12,8 +12,7 @@ import com.powsybl.dynawaltz.models.Side; import com.powsybl.dynawaltz.models.VarConnection; import com.powsybl.dynawaltz.models.VarMapping; -import com.powsybl.dynawaltz.models.buses.BusModel; -import com.powsybl.dynawaltz.models.utils.BusUtils; +import com.powsybl.dynawaltz.models.buses.EquipmentConnectionPoint; import com.powsybl.iidm.network.HvdcLine; import java.util.ArrayList; @@ -41,8 +40,8 @@ protected AbstractHvdc(String dynamicModelId, HvdcLine hvdc, String parameterSet @Override public void createMacroConnections(DynaWaltzContext context) { - createMacroConnections(BusUtils.getConnectableBusStaticId(equipment.getConverterStation1().getTerminal()), BusModel.class, this::getVarConnectionsWith, context, Side.ONE); - createMacroConnections(BusUtils.getConnectableBusStaticId(equipment.getConverterStation2().getTerminal()), BusModel.class, this::getVarConnectionsWith, context, Side.TWO); + createTerminalMacroConnections(equipment, this::getVarConnectionsWith, context, Side.ONE); + createTerminalMacroConnections(equipment, this::getVarConnectionsWith, context, Side.TWO); } @Override @@ -50,16 +49,16 @@ public List getVarsMapping() { return VAR_MAPPING; } - protected List getVarConnectionsWith(BusModel connected, Side side) { + protected List getVarConnectionsWith(EquipmentConnectionPoint connected, Side side) { List varConnections = new ArrayList<>(2); varConnections.add(getSimpleVarConnectionWithBus(connected, side)); - connected.getSwitchOffSignalVarName() + connected.getSwitchOffSignalVarName(side) .map(switchOff -> new VarConnection("hvdc_switchOffSignal1" + side.getSideSuffix(), switchOff)) .ifPresent(varConnections::add); return varConnections; } - protected final VarConnection getSimpleVarConnectionWithBus(BusModel connected, Side side) { - return new VarConnection(TERMINAL_PREFIX + side.getSideNumber(), connected.getTerminalVarName()); + protected final VarConnection getSimpleVarConnectionWithBus(EquipmentConnectionPoint connected, Side side) { + return new VarConnection(TERMINAL_PREFIX + side.getSideNumber(), connected.getTerminalVarName(side)); } } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/DanglingSide.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/DanglingSide.java index c6e7998c9..86d93f717 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/DanglingSide.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/DanglingSide.java @@ -2,7 +2,7 @@ import com.powsybl.dynawaltz.models.Side; import com.powsybl.dynawaltz.models.VarConnection; -import com.powsybl.dynawaltz.models.buses.BusModel; +import com.powsybl.dynawaltz.models.buses.EquipmentConnectionPoint; import java.util.List; import java.util.Objects; @@ -27,13 +27,13 @@ public int getSideNumber() { return side.getSideNumber(); } - public void createMacroConnections(BiFunction> basicVarConnectionsSupplier, - BiConsumer>, Side> connectionCreator) { + public void createMacroConnections(BiFunction> basicVarConnectionsSupplier, + BiConsumer>, Side> connectionCreator) { connectionCreator.accept(this::getVarConnectionsWith, side); connectionCreator.accept(basicVarConnectionsSupplier, side.getOppositeSide()); } - private List getVarConnectionsWith(BusModel connected, Side side) { - return List.of(new VarConnection(prefix + side.getSideNumber(), connected.getTerminalVarName())); + private List getVarConnectionsWith(EquipmentConnectionPoint connected, Side side) { + return List.of(new VarConnection(prefix + side.getSideNumber(), connected.getTerminalVarName(side))); } } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/HvdcPDangling.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/HvdcPDangling.java index 69c2c3d0d..e54b3648c 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/HvdcPDangling.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/HvdcPDangling.java @@ -10,8 +10,7 @@ import com.powsybl.commons.PowsyblException; import com.powsybl.dynawaltz.DynaWaltzContext; import com.powsybl.dynawaltz.models.Side; -import com.powsybl.dynawaltz.models.buses.BusModel; -import com.powsybl.dynawaltz.models.utils.BusUtils; +import com.powsybl.dynawaltz.models.utils.SideConverter; import com.powsybl.iidm.network.HvdcLine; /** @@ -30,7 +29,7 @@ public HvdcPDangling(String dynamicModelId, HvdcLine hvdc, String parameterSetId public void createMacroConnections(DynaWaltzContext context) { danglingSide.createMacroConnections( this::getVarConnectionsWith, - (varCoSupplier, side) -> createMacroConnections(BusUtils.getConnectableBusStaticId(equipment, side), BusModel.class, varCoSupplier, context, side) + (varCoSupplier, side) -> createTerminalMacroConnections(equipment.getConverterStation(SideConverter.convert(side)).getTerminal(), varCoSupplier, context, side) ); } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/HvdcVscDangling.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/HvdcVscDangling.java index 348ee87ef..f5afd7099 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/HvdcVscDangling.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/HvdcVscDangling.java @@ -10,8 +10,6 @@ import com.powsybl.commons.PowsyblException; import com.powsybl.dynawaltz.DynaWaltzContext; import com.powsybl.dynawaltz.models.Side; -import com.powsybl.dynawaltz.models.buses.BusModel; -import com.powsybl.dynawaltz.models.utils.BusUtils; import com.powsybl.iidm.network.HvdcLine; /** @@ -30,7 +28,7 @@ public HvdcVscDangling(String dynamicModelId, HvdcLine hvdc, String parameterSet public void createMacroConnections(DynaWaltzContext context) { danglingSide.createMacroConnections( this::getVarConnectionsWith, - (varCoSupplier, side) -> createMacroConnections(BusUtils.getConnectableBusStaticId(equipment, side), BusModel.class, varCoSupplier, context, side) + (varCoSupplier, side) -> createTerminalMacroConnections(equipment, varCoSupplier, context, side) ); } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/lines/StandardLine.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/lines/StandardLine.java index dd8713be7..47d6d09de 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/lines/StandardLine.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/lines/StandardLine.java @@ -11,8 +11,7 @@ import com.powsybl.dynawaltz.models.AbstractEquipmentBlackBoxModel; import com.powsybl.dynawaltz.models.Side; import com.powsybl.dynawaltz.models.VarConnection; -import com.powsybl.dynawaltz.models.buses.BusModel; -import com.powsybl.dynawaltz.models.utils.BusUtils; +import com.powsybl.dynawaltz.models.buses.EquipmentConnectionPoint; import com.powsybl.dynawaltz.models.utils.SideConverter; import com.powsybl.iidm.network.Line; @@ -27,7 +26,7 @@ public StandardLine(String dynamicModelId, Line line, String parameterSetId) { super(dynamicModelId, parameterSetId, line, "Line"); } - private List getVarConnectionsWith(BusModel connected, Side side) { + private List getVarConnectionsWith(EquipmentConnectionPoint connected, Side side) { return List.of(new VarConnection(getTerminalVarName(side), connected.getTerminalVarName())); } @@ -37,10 +36,7 @@ private String getTerminalVarName(Side side) { @Override public void createMacroConnections(DynaWaltzContext context) { - equipment.getTerminals().forEach(t -> { - String busStaticId = BusUtils.getConnectableBusStaticId(t); - createMacroConnections(busStaticId, BusModel.class, this::getVarConnectionsWith, context, SideConverter.convert(equipment.getSide(t))); - }); + equipment.getTerminals().forEach(t -> createTerminalMacroConnections(t, this::getVarConnectionsWith, context, SideConverter.convert(equipment.getSide(t)))); } @Override diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/AbstractLoad.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/AbstractLoad.java index ca2187ac7..68b157657 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/AbstractLoad.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/AbstractLoad.java @@ -9,8 +9,7 @@ import com.powsybl.dynawaltz.DynaWaltzContext; import com.powsybl.dynawaltz.models.AbstractEquipmentBlackBoxModel; import com.powsybl.dynawaltz.models.VarConnection; -import com.powsybl.dynawaltz.models.buses.BusModel; -import com.powsybl.dynawaltz.models.utils.BusUtils; +import com.powsybl.dynawaltz.models.buses.EquipmentConnectionPoint; import com.powsybl.iidm.network.Load; import java.util.List; @@ -34,10 +33,10 @@ protected String getTerminalVarName() { @Override public void createMacroConnections(DynaWaltzContext context) { - createMacroConnections(BusUtils.getConnectableBusStaticId(equipment), BusModel.class, this::getVarConnectionsWith, context); + createTerminalMacroConnections(equipment, this::getVarConnectionsWith, context); } - abstract List getVarConnectionsWith(BusModel connected); + abstract List getVarConnectionsWith(EquipmentConnectionPoint connected); @Override public String getSwitchOffSignalEventVarName() { diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/BaseLoad.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/BaseLoad.java index 4702b9988..962a89196 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/BaseLoad.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/BaseLoad.java @@ -8,7 +8,7 @@ import com.powsybl.dynawaltz.models.VarConnection; import com.powsybl.dynawaltz.models.VarMapping; -import com.powsybl.dynawaltz.models.buses.BusModel; +import com.powsybl.dynawaltz.models.buses.EquipmentConnectionPoint; import com.powsybl.iidm.network.Load; import java.util.ArrayList; @@ -35,7 +35,7 @@ public List getVarsMapping() { } @Override - protected List getVarConnectionsWith(BusModel connected) { + protected List getVarConnectionsWith(EquipmentConnectionPoint connected) { List varConnections = new ArrayList<>(2); varConnections.add(new VarConnection(getTerminalVarName(), connected.getTerminalVarName())); connected.getSwitchOffSignalVarName() diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadOneTransformer.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadOneTransformer.java index 70ef6eedf..fff652f41 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadOneTransformer.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadOneTransformer.java @@ -10,7 +10,7 @@ import com.powsybl.dynawaltz.models.TransformerSide; import com.powsybl.dynawaltz.models.VarConnection; import com.powsybl.dynawaltz.models.VarMapping; -import com.powsybl.dynawaltz.models.buses.BusModel; +import com.powsybl.dynawaltz.models.buses.EquipmentConnectionPoint; import com.powsybl.iidm.network.Load; import java.util.ArrayList; @@ -44,7 +44,7 @@ public List getVarsMapping() { } @Override - protected List getVarConnectionsWith(BusModel connected) { + protected List getVarConnectionsWith(EquipmentConnectionPoint connected) { List varConnections = new ArrayList<>(3); varConnections.add(new VarConnection(getTerminalVarName(), connected.getTerminalVarName())); connected.getSwitchOffSignalVarName() diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadOneTransformerTapChanger.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadOneTransformerTapChanger.java index 480ac6425..6b55ee0c7 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadOneTransformerTapChanger.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadOneTransformerTapChanger.java @@ -10,7 +10,7 @@ import com.powsybl.commons.PowsyblException; import com.powsybl.dynawaltz.models.TransformerSide; import com.powsybl.dynawaltz.models.VarConnection; -import com.powsybl.dynawaltz.models.buses.BusModel; +import com.powsybl.dynawaltz.models.buses.EquipmentConnectionPoint; import com.powsybl.dynawaltz.models.transformers.TapChangerModel; import com.powsybl.iidm.network.Load; @@ -28,7 +28,7 @@ public LoadOneTransformerTapChanger(String dynamicModelId, Load load, String par } @Override - protected List getVarConnectionsWith(BusModel connected) { + protected List getVarConnectionsWith(EquipmentConnectionPoint connected) { List varConnections = super.getVarConnectionsWith(connected); connected.getSwitchOffSignalVarName() .map(switchOff -> new VarConnection("tapChanger_switchOffSignal1", switchOff)) diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadTwoTransformers.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadTwoTransformers.java index 31274cd48..bf581f1e5 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadTwoTransformers.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadTwoTransformers.java @@ -11,7 +11,7 @@ import com.powsybl.dynawaltz.models.TransformerSide; import com.powsybl.dynawaltz.models.VarConnection; import com.powsybl.dynawaltz.models.VarMapping; -import com.powsybl.dynawaltz.models.buses.BusModel; +import com.powsybl.dynawaltz.models.buses.EquipmentConnectionPoint; import com.powsybl.iidm.network.Load; import java.util.ArrayList; @@ -40,7 +40,7 @@ protected LoadTwoTransformers(String dynamicModelId, Load load, String parameter } @Override - protected List getVarConnectionsWith(BusModel connected) { + protected List getVarConnectionsWith(EquipmentConnectionPoint connected) { List varConnections = new ArrayList<>(3); varConnections.add(new VarConnection(getTerminalVarName(), connected.getTerminalVarName())); connected.getSwitchOffSignalVarName() diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadTwoTransformersTapChangers.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadTwoTransformersTapChangers.java index a7ce7fa3f..991b314ef 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadTwoTransformersTapChangers.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadTwoTransformersTapChangers.java @@ -10,7 +10,7 @@ import com.powsybl.commons.PowsyblException; import com.powsybl.dynawaltz.models.TransformerSide; import com.powsybl.dynawaltz.models.VarConnection; -import com.powsybl.dynawaltz.models.buses.BusModel; +import com.powsybl.dynawaltz.models.buses.EquipmentConnectionPoint; import com.powsybl.dynawaltz.models.transformers.TapChangerModel; import com.powsybl.iidm.network.Load; @@ -29,7 +29,7 @@ public LoadTwoTransformersTapChangers(String dynamicModelId, Load load, String p } @Override - protected List getVarConnectionsWith(BusModel connected) { + protected List getVarConnectionsWith(EquipmentConnectionPoint connected) { List varConnections = super.getVarConnectionsWith(connected); connected.getSwitchOffSignalVarName() .ifPresent(switchOff -> { diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/svarcs/StaticVarCompensator.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/svarcs/StaticVarCompensator.java index 225eb1d02..ecfcebe86 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/svarcs/StaticVarCompensator.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/svarcs/StaticVarCompensator.java @@ -11,8 +11,7 @@ import com.powsybl.dynawaltz.models.AbstractEquipmentBlackBoxModel; import com.powsybl.dynawaltz.models.VarConnection; import com.powsybl.dynawaltz.models.VarMapping; -import com.powsybl.dynawaltz.models.buses.BusModel; -import com.powsybl.dynawaltz.models.utils.BusUtils; +import com.powsybl.dynawaltz.models.buses.EquipmentConnectionPoint; import java.util.Arrays; import java.util.List; @@ -34,10 +33,10 @@ public StaticVarCompensator(String dynamicModelId, com.powsybl.iidm.network.Stat @Override public void createMacroConnections(DynaWaltzContext context) { - createMacroConnections(BusUtils.getConnectableBusStaticId(equipment), BusModel.class, this::getVarConnectionsWithBus, context); + createTerminalMacroConnections(equipment, this::getVarConnectionsWith, context); } - private List getVarConnectionsWithBus(BusModel connected) { + private List getVarConnectionsWith(EquipmentConnectionPoint connected) { return List.of(new VarConnection("SVarC_terminal", connected.getTerminalVarName())); } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/transformers/TransformerFixedRatio.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/transformers/TransformerFixedRatio.java index 00e80c1f8..d2c2d44b9 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/transformers/TransformerFixedRatio.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/transformers/TransformerFixedRatio.java @@ -11,8 +11,7 @@ import com.powsybl.dynawaltz.models.AbstractEquipmentBlackBoxModel; import com.powsybl.dynawaltz.models.Side; import com.powsybl.dynawaltz.models.VarConnection; -import com.powsybl.dynawaltz.models.buses.BusModel; -import com.powsybl.dynawaltz.models.utils.BusUtils; +import com.powsybl.dynawaltz.models.buses.EquipmentConnectionPoint; import com.powsybl.dynawaltz.models.utils.SideConverter; import com.powsybl.iidm.network.TwoWindingsTransformer; @@ -29,7 +28,7 @@ public TransformerFixedRatio(String dynamicModelId, TwoWindingsTransformer trans super(dynamicModelId, parameterSetId, transformer, lib); } - private List getVarConnectionsWith(BusModel connected, Side side) { + private List getVarConnectionsWith(EquipmentConnectionPoint connected, Side side) { return List.of(new VarConnection(getTerminalVarName(side), connected.getTerminalVarName())); } @@ -39,10 +38,7 @@ private String getTerminalVarName(Side side) { @Override public void createMacroConnections(DynaWaltzContext context) { - equipment.getTerminals().forEach(t -> { - String busStaticId = BusUtils.getConnectableBusStaticId(t); - createMacroConnections(busStaticId, BusModel.class, this::getVarConnectionsWith, context, SideConverter.convert(equipment.getSide(t))); - }); + equipment.getTerminals().forEach(t -> createTerminalMacroConnections(t, this::getVarConnectionsWith, context, SideConverter.convert(equipment.getSide(t)))); } @Override diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/utils/BusUtils.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/utils/BusUtils.java index bc68f7b98..fb3b6ee58 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/utils/BusUtils.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/utils/BusUtils.java @@ -7,7 +7,6 @@ */ package com.powsybl.dynawaltz.models.utils; -import com.powsybl.dynawaltz.models.Side; import com.powsybl.iidm.network.*; /** @@ -22,19 +21,7 @@ public static String getConnectableBusStaticId(Terminal terminal) { return terminal.getBusBreakerView().getConnectableBus().getId(); } - public static String getConnectableBusStaticId(Generator generator) { - return getConnectableBusStaticId(generator.getTerminal()); - } - - public static String getConnectableBusStaticId(StaticVarCompensator svarc) { - return getConnectableBusStaticId(svarc.getTerminal()); - } - - public static String getConnectableBusStaticId(HvdcLine hvdc, Side side) { - return getConnectableBusStaticId(hvdc.getConverterStation(SideConverter.convert(side)).getTerminal()); - } - - public static String getConnectableBusStaticId(Load load) { - return getConnectableBusStaticId(load.getTerminal()); + public static String getConnectableBusStaticId(Injection injection) { + return getConnectableBusStaticId(injection.getTerminal()); } } diff --git a/dynawaltz/src/test/resources/apv_dyd.xml b/dynawaltz/src/test/resources/apv_dyd.xml index cff7305db..5604eff39 100644 --- a/dynawaltz/src/test/resources/apv_dyd.xml +++ b/dynawaltz/src/test/resources/apv_dyd.xml @@ -15,24 +15,24 @@ - - - + + + - - - + + + - - - + + + - - + + @@ -69,13 +69,13 @@ - - - + + + - + - + diff --git a/dynawaltz/src/test/resources/cla_dyd.xml b/dynawaltz/src/test/resources/cla_dyd.xml index a96984c77..2024bff15 100644 --- a/dynawaltz/src/test/resources/cla_dyd.xml +++ b/dynawaltz/src/test/resources/cla_dyd.xml @@ -18,11 +18,11 @@ - - + + - - + + @@ -32,8 +32,8 @@ - - + + diff --git a/dynawaltz/src/test/resources/disconnect_dyd.xml b/dynawaltz/src/test/resources/disconnect_dyd.xml index d19e6da4f..5daadbbf6 100644 --- a/dynawaltz/src/test/resources/disconnect_dyd.xml +++ b/dynawaltz/src/test/resources/disconnect_dyd.xml @@ -7,9 +7,9 @@ - - - + + + @@ -28,7 +28,7 @@ - + diff --git a/dynawaltz/src/test/resources/disconnect_hvdc_pv_dangling_dyd.xml b/dynawaltz/src/test/resources/disconnect_hvdc_pv_dangling_dyd.xml index 8e75eeaf1..62194fbec 100644 --- a/dynawaltz/src/test/resources/disconnect_hvdc_pv_dangling_dyd.xml +++ b/dynawaltz/src/test/resources/disconnect_hvdc_pv_dangling_dyd.xml @@ -4,12 +4,12 @@ - - + + - - - + + + @@ -22,7 +22,7 @@ - - + + diff --git a/dynawaltz/src/test/resources/disconnect_hvdc_pv_dyd.xml b/dynawaltz/src/test/resources/disconnect_hvdc_pv_dyd.xml index ed5b27309..62fd89a2f 100644 --- a/dynawaltz/src/test/resources/disconnect_hvdc_pv_dyd.xml +++ b/dynawaltz/src/test/resources/disconnect_hvdc_pv_dyd.xml @@ -4,13 +4,13 @@ - - - + + + - - - + + + @@ -23,7 +23,7 @@ - - + + diff --git a/dynawaltz/src/test/resources/disconnect_hvdc_vsc_dangling_dyd.xml b/dynawaltz/src/test/resources/disconnect_hvdc_vsc_dangling_dyd.xml index 94291ba0a..54440fb29 100644 --- a/dynawaltz/src/test/resources/disconnect_hvdc_vsc_dangling_dyd.xml +++ b/dynawaltz/src/test/resources/disconnect_hvdc_vsc_dangling_dyd.xml @@ -4,12 +4,12 @@ - - + + - - - + + + @@ -22,7 +22,7 @@ - - + + diff --git a/dynawaltz/src/test/resources/disconnect_hvdc_vsc_dyd.xml b/dynawaltz/src/test/resources/disconnect_hvdc_vsc_dyd.xml index 99755b917..28aaf84a3 100644 --- a/dynawaltz/src/test/resources/disconnect_hvdc_vsc_dyd.xml +++ b/dynawaltz/src/test/resources/disconnect_hvdc_vsc_dyd.xml @@ -4,13 +4,13 @@ - - - + + + - - - + + + @@ -23,7 +23,7 @@ - - + + diff --git a/dynawaltz/src/test/resources/dyd.xml b/dynawaltz/src/test/resources/dyd.xml index 3a791e720..7ba5ddea3 100644 --- a/dynawaltz/src/test/resources/dyd.xml +++ b/dynawaltz/src/test/resources/dyd.xml @@ -33,44 +33,44 @@ - - - + + + - - - - + + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - + + - - + + @@ -84,8 +84,8 @@ - - + + @@ -146,32 +146,32 @@ - - - - - - - - - - - - + + + + + + + + + + + + - + - + - + - + - + - + - + diff --git a/dynawaltz/src/test/resources/dyd_fictitious.xml b/dynawaltz/src/test/resources/dyd_fictitious.xml index 55bec847b..2a84f989a 100644 --- a/dynawaltz/src/test/resources/dyd_fictitious.xml +++ b/dynawaltz/src/test/resources/dyd_fictitious.xml @@ -3,14 +3,14 @@ - - - + + + - + diff --git a/dynawaltz/src/test/resources/events.xml b/dynawaltz/src/test/resources/events.xml index 00431e2b4..4dacda7de 100644 --- a/dynawaltz/src/test/resources/events.xml +++ b/dynawaltz/src/test/resources/events.xml @@ -7,17 +7,17 @@ - - - + + + - - + + @@ -30,9 +30,9 @@ - + - + diff --git a/dynawaltz/src/test/resources/grid_forming_converter_dyd.xml b/dynawaltz/src/test/resources/grid_forming_converter_dyd.xml index 722df7781..730a02372 100644 --- a/dynawaltz/src/test/resources/grid_forming_converter_dyd.xml +++ b/dynawaltz/src/test/resources/grid_forming_converter_dyd.xml @@ -4,23 +4,23 @@ - - + + - - + + - + - + diff --git a/dynawaltz/src/test/resources/hvdc_p_dangling_dyd.xml b/dynawaltz/src/test/resources/hvdc_p_dangling_dyd.xml index 39f65bf63..339f38446 100644 --- a/dynawaltz/src/test/resources/hvdc_p_dangling_dyd.xml +++ b/dynawaltz/src/test/resources/hvdc_p_dangling_dyd.xml @@ -3,12 +3,12 @@ - - + + - - - + + + @@ -18,6 +18,6 @@ - - + + diff --git a/dynawaltz/src/test/resources/hvdc_p_dyd.xml b/dynawaltz/src/test/resources/hvdc_p_dyd.xml index d214a7e45..ade52c952 100644 --- a/dynawaltz/src/test/resources/hvdc_p_dyd.xml +++ b/dynawaltz/src/test/resources/hvdc_p_dyd.xml @@ -3,13 +3,13 @@ - - - + + + - - - + + + @@ -19,6 +19,6 @@ - - + + diff --git a/dynawaltz/src/test/resources/hvdc_vsc_dangling_dyd.xml b/dynawaltz/src/test/resources/hvdc_vsc_dangling_dyd.xml index 50c4bd754..4942f42eb 100644 --- a/dynawaltz/src/test/resources/hvdc_vsc_dangling_dyd.xml +++ b/dynawaltz/src/test/resources/hvdc_vsc_dangling_dyd.xml @@ -3,12 +3,12 @@ - - + + - - - + + + @@ -18,6 +18,6 @@ - - + + diff --git a/dynawaltz/src/test/resources/hvdc_vsc_dyd.xml b/dynawaltz/src/test/resources/hvdc_vsc_dyd.xml index 4cdcfc786..9b4b144cb 100644 --- a/dynawaltz/src/test/resources/hvdc_vsc_dyd.xml +++ b/dynawaltz/src/test/resources/hvdc_vsc_dyd.xml @@ -3,13 +3,13 @@ - - - + + + - - - + + + @@ -19,6 +19,6 @@ - - + + diff --git a/dynawaltz/src/test/resources/load_alpha_beta_dyd.xml b/dynawaltz/src/test/resources/load_alpha_beta_dyd.xml index f8a5c52df..ae6a68a67 100644 --- a/dynawaltz/src/test/resources/load_alpha_beta_dyd.xml +++ b/dynawaltz/src/test/resources/load_alpha_beta_dyd.xml @@ -3,14 +3,14 @@ - - - + + + - + diff --git a/dynawaltz/src/test/resources/load_one_transformer_dyd.xml b/dynawaltz/src/test/resources/load_one_transformer_dyd.xml index 510a89f48..73bc2c0aa 100644 --- a/dynawaltz/src/test/resources/load_one_transformer_dyd.xml +++ b/dynawaltz/src/test/resources/load_one_transformer_dyd.xml @@ -3,15 +3,15 @@ - - - - + + + + - + diff --git a/dynawaltz/src/test/resources/load_one_transformer_tap_changer_dyd.xml b/dynawaltz/src/test/resources/load_one_transformer_tap_changer_dyd.xml index 06f3081a7..a27fb14ba 100644 --- a/dynawaltz/src/test/resources/load_one_transformer_tap_changer_dyd.xml +++ b/dynawaltz/src/test/resources/load_one_transformer_tap_changer_dyd.xml @@ -3,16 +3,16 @@ - - - - - + + + + + - + diff --git a/dynawaltz/src/test/resources/load_two_transformers_dyd.xml b/dynawaltz/src/test/resources/load_two_transformers_dyd.xml index 899cec446..7942b2e2f 100644 --- a/dynawaltz/src/test/resources/load_two_transformers_dyd.xml +++ b/dynawaltz/src/test/resources/load_two_transformers_dyd.xml @@ -3,16 +3,16 @@ - - - - - + + + + + - + diff --git a/dynawaltz/src/test/resources/load_two_transformers_tap_changers_dyd.xml b/dynawaltz/src/test/resources/load_two_transformers_tap_changers_dyd.xml index 6da4b5b9d..37be45e74 100644 --- a/dynawaltz/src/test/resources/load_two_transformers_tap_changers_dyd.xml +++ b/dynawaltz/src/test/resources/load_two_transformers_tap_changers_dyd.xml @@ -3,18 +3,18 @@ - - - - - - - + + + + + + + - + diff --git a/dynawaltz/src/test/resources/node_fault_dyd.xml b/dynawaltz/src/test/resources/node_fault_dyd.xml index b789d91df..dba85ae14 100644 --- a/dynawaltz/src/test/resources/node_fault_dyd.xml +++ b/dynawaltz/src/test/resources/node_fault_dyd.xml @@ -1,8 +1,8 @@ - + - + diff --git a/dynawaltz/src/test/resources/omega_ref_dyd.xml b/dynawaltz/src/test/resources/omega_ref_dyd.xml index b1e5728f8..d1344a8a0 100644 --- a/dynawaltz/src/test/resources/omega_ref_dyd.xml +++ b/dynawaltz/src/test/resources/omega_ref_dyd.xml @@ -10,25 +10,25 @@ - - - + + + - - - + + + - - - + + + - - + + @@ -54,13 +54,13 @@ - - - + + + - + - + - + diff --git a/dynawaltz/src/test/resources/phase_shifter_i_dyd.xml b/dynawaltz/src/test/resources/phase_shifter_i_dyd.xml index ae1527cd9..183d6607c 100644 --- a/dynawaltz/src/test/resources/phase_shifter_i_dyd.xml +++ b/dynawaltz/src/test/resources/phase_shifter_i_dyd.xml @@ -8,13 +8,13 @@ - - + + - - + + - - + + diff --git a/dynawaltz/src/test/resources/set_point_inf_bus_dyd.xml b/dynawaltz/src/test/resources/set_point_inf_bus_dyd.xml index e13280f9b..66536f548 100644 --- a/dynawaltz/src/test/resources/set_point_inf_bus_dyd.xml +++ b/dynawaltz/src/test/resources/set_point_inf_bus_dyd.xml @@ -12,8 +12,8 @@ - - + + @@ -25,6 +25,6 @@ - + diff --git a/dynawaltz/src/test/resources/svarc_dyd.xml b/dynawaltz/src/test/resources/svarc_dyd.xml index 36acc0b3e..f3cb4bffd 100644 --- a/dynawaltz/src/test/resources/svarc_dyd.xml +++ b/dynawaltz/src/test/resources/svarc_dyd.xml @@ -3,8 +3,8 @@ - - + + @@ -12,5 +12,5 @@ - + diff --git a/dynawaltz/src/test/resources/tap_changer_blocking_dyd.xml b/dynawaltz/src/test/resources/tap_changer_blocking_dyd.xml index b8202377f..eb0c07a46 100644 --- a/dynawaltz/src/test/resources/tap_changer_blocking_dyd.xml +++ b/dynawaltz/src/test/resources/tap_changer_blocking_dyd.xml @@ -8,25 +8,25 @@ - - + + - - + + - - - - - + + + + + - - - - - - - + + + + + + + @@ -41,10 +41,10 @@ - + - + @@ -57,14 +57,14 @@ - - - - + + + + - - + + diff --git a/dynawaltz/src/test/resources/tap_changer_blocking_empty_dyd.xml b/dynawaltz/src/test/resources/tap_changer_blocking_empty_dyd.xml index 265b326d9..e5a37b183 100644 --- a/dynawaltz/src/test/resources/tap_changer_blocking_empty_dyd.xml +++ b/dynawaltz/src/test/resources/tap_changer_blocking_empty_dyd.xml @@ -3,15 +3,15 @@ - - - - + + + + - + diff --git a/dynawaltz/src/test/resources/tap_changer_blocking_tap_changer_dyd.xml b/dynawaltz/src/test/resources/tap_changer_blocking_tap_changer_dyd.xml index 79a0d84a2..5131bf04f 100644 --- a/dynawaltz/src/test/resources/tap_changer_blocking_tap_changer_dyd.xml +++ b/dynawaltz/src/test/resources/tap_changer_blocking_tap_changer_dyd.xml @@ -13,16 +13,16 @@ - - - - + + + + - - - - - + + + + + @@ -48,7 +48,7 @@ - + @@ -61,14 +61,14 @@ - - - + + + - + diff --git a/dynawaltz/src/test/resources/tap_changer_dyd.xml b/dynawaltz/src/test/resources/tap_changer_dyd.xml index f0780a439..1a9df0fd0 100644 --- a/dynawaltz/src/test/resources/tap_changer_dyd.xml +++ b/dynawaltz/src/test/resources/tap_changer_dyd.xml @@ -12,16 +12,16 @@ - - - - + + + + - - - - - + + + + + @@ -48,9 +48,9 @@ - - - + + + diff --git a/dynawaltz/src/test/resources/tap_changer_empty_dyd.xml b/dynawaltz/src/test/resources/tap_changer_empty_dyd.xml index f8a5c52df..ae6a68a67 100644 --- a/dynawaltz/src/test/resources/tap_changer_empty_dyd.xml +++ b/dynawaltz/src/test/resources/tap_changer_empty_dyd.xml @@ -3,14 +3,14 @@ - - - + + + - + diff --git a/dynawaltz/src/test/resources/tfr_dyd.xml b/dynawaltz/src/test/resources/tfr_dyd.xml index be6210e6b..cde84c87b 100644 --- a/dynawaltz/src/test/resources/tfr_dyd.xml +++ b/dynawaltz/src/test/resources/tfr_dyd.xml @@ -1,12 +1,12 @@ - - + + - - + + - - + + diff --git a/dynawaltz/src/test/resources/wecc_pv_dyd.xml b/dynawaltz/src/test/resources/wecc_pv_dyd.xml index 40cce1c0c..9b696f255 100644 --- a/dynawaltz/src/test/resources/wecc_pv_dyd.xml +++ b/dynawaltz/src/test/resources/wecc_pv_dyd.xml @@ -4,22 +4,22 @@ - - + + - - + + - + - + diff --git a/dynawaltz/src/test/resources/wecc_wt_dyd.xml b/dynawaltz/src/test/resources/wecc_wt_dyd.xml index 782625d6c..f55b2fb98 100644 --- a/dynawaltz/src/test/resources/wecc_wt_dyd.xml +++ b/dynawaltz/src/test/resources/wecc_wt_dyd.xml @@ -3,13 +3,13 @@ - - + + - + diff --git a/dynawaltz/src/test/resources/wecc_wt_synchro_dyd.xml b/dynawaltz/src/test/resources/wecc_wt_synchro_dyd.xml index 3a6b98a9e..014354498 100644 --- a/dynawaltz/src/test/resources/wecc_wt_synchro_dyd.xml +++ b/dynawaltz/src/test/resources/wecc_wt_synchro_dyd.xml @@ -4,22 +4,22 @@ - - + + - - + + - + - +