-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Edit models.json with SYNCHRONIZED properties for "Motor" loads Signed-off-by: lisrte <[email protected]>
- Loading branch information
Showing
5 changed files
with
108 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
dynawo-simulation/src/main/java/com/powsybl/dynawo/models/loads/SynchronizedLoad.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/** | ||
* Copyright (c) 2024, 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.dynawo.models.loads; | ||
|
||
import com.powsybl.dynawo.builders.ModelConfig; | ||
import com.powsybl.dynawo.models.VarConnection; | ||
import com.powsybl.dynawo.models.frequencysynchronizers.FrequencySynchronizedModel; | ||
import com.powsybl.dynawo.models.utils.BusUtils; | ||
import com.powsybl.iidm.network.Bus; | ||
import com.powsybl.iidm.network.Load; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* @author Laurent Issertial {@literal <laurent.issertial at rte-france.com>} | ||
*/ | ||
public class SynchronizedLoad extends BaseLoad implements FrequencySynchronizedModel { | ||
|
||
protected SynchronizedLoad(String dynamicModelId, Load load, String parameterSetId, ModelConfig modelConfig) { | ||
super(dynamicModelId, load, parameterSetId, modelConfig); | ||
} | ||
|
||
@Override | ||
public List<VarConnection> getOmegaRefVarConnections() { | ||
return List.of( | ||
new VarConnection("omegaRef_grp_@INDEX@_value", getOmegaRefPuVarName()), | ||
new VarConnection("running_grp_@INDEX@", getRunningVarName()) | ||
); | ||
} | ||
|
||
@Override | ||
public String getOmegaRefPuVarName() { | ||
return "load_omegaRefPu_value"; | ||
} | ||
|
||
@Override | ||
public String getRunningVarName() { | ||
return "load_running"; | ||
} | ||
|
||
@Override | ||
public Bus getConnectableBus() { | ||
return BusUtils.getConnectableBus(equipment); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
dynawo-simulation/src/test/resources/load_synchronized.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<dyn:dynamicModelsArchitecture xmlns:dyn="http://www.rte-france.com/dynawo"> | ||
<dyn:blackBoxModel id="BBM_LOAD" lib="LoadAlphaBetaMotor" parFile="models.par" parId="LAB" staticId="LOAD"> | ||
<dyn:macroStaticRef id="MSR_LoadAlphaBetaMotor"/> | ||
</dyn:blackBoxModel> | ||
<dyn:blackBoxModel id="FREQ_SYNC" lib="DYNModelOmegaRef" parFile="sim1.par" parId="FREQ_SYNC_PAR"/> | ||
<dyn:macroConnector id="MC_LoadAlphaBetaMotor-DefaultEquipmentConnectionPoint"> | ||
<dyn:connect var1="load_terminal" var2="@STATIC_ID@@NODE@_ACPIN"/> | ||
<dyn:connect var1="load_switchOffSignal1" var2="@STATIC_ID@@NODE@_switchOff"/> | ||
</dyn:macroConnector> | ||
<dyn:macroConnector id="MC_DYNModelOmegaRef-LoadAlphaBetaMotor"> | ||
<dyn:connect var1="omegaRef_grp_@INDEX@_value" var2="load_omegaRefPu_value"/> | ||
<dyn:connect var1="running_grp_@INDEX@" var2="load_running"/> | ||
</dyn:macroConnector> | ||
<dyn:macroConnector id="MC_DYNModelOmegaRef-DefaultBusOfFrequencySynchronized"> | ||
<dyn:connect var1="numcc_node_@INDEX@" var2="@@NAME@@@NODE@_numcc"/> | ||
</dyn:macroConnector> | ||
<dyn:macroStaticReference id="MSR_LoadAlphaBetaMotor"> | ||
<dyn:staticRef var="load_PPu" staticVar="p"/> | ||
<dyn:staticRef var="load_QPu" staticVar="q"/> | ||
<dyn:staticRef var="load_state" staticVar="state"/> | ||
</dyn:macroStaticReference> | ||
<dyn:macroConnect connector="MC_LoadAlphaBetaMotor-DefaultEquipmentConnectionPoint" id1="BBM_LOAD" id2="NETWORK"/> | ||
<dyn:macroConnect connector="MC_DYNModelOmegaRef-LoadAlphaBetaMotor" id1="FREQ_SYNC" index1="0" id2="BBM_LOAD"/> | ||
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfFrequencySynchronized" id1="FREQ_SYNC" index1="0" id2="NETWORK" name2="LOAD"/> | ||
</dyn:dynamicModelsArchitecture> |