-
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.
* BusModel API changed to have some variables returned as Optional<String> * StandardBus returns Optional.empty() for those variables * StandardBus can still connect in a simplified way to Loads/Generators * StandardLine does not implement all methods of LineModel and an exception is thrown when a CurrentLimitAutomaton is connected. * Update unit tests * Add unit test * Fix generatorFictitious typo Signed-off-by: Gautier Bureau <gautier.bureau@rte-france.com > Co-authored-by: Florian Dupuy <florian.dupuy@rte-france.com>
- Loading branch information
1 parent
c8ecb55
commit 1a5c7f4
Showing
13 changed files
with
154 additions
and
102 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
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
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
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
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
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
55 changes: 55 additions & 0 deletions
55
dynawaltz/src/test/java/com/powsybl/dynawaltz/models/lines/StandardLineTest.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,55 @@ | ||
/* | ||
* 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.lines; | ||
|
||
import com.powsybl.dynamicsimulation.Curve; | ||
import com.powsybl.dynamicsimulation.DynamicSimulationParameters; | ||
import com.powsybl.dynawaltz.DynaWaltzContext; | ||
import com.powsybl.dynawaltz.DynaWaltzParameters; | ||
import com.powsybl.dynawaltz.models.BlackBoxModel; | ||
import com.powsybl.dynawaltz.models.Side; | ||
import com.powsybl.dynawaltz.models.automatons.CurrentLimitAutomaton; | ||
import com.powsybl.iidm.network.*; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertThrows; | ||
|
||
/** | ||
* @author Florian Dupuy <florian.dupuy at rte-france.com> | ||
*/ | ||
class StandardLineTest { | ||
|
||
@Test | ||
void connectionToCurrentLimitAutomatonException() { | ||
Network network = Network.create("test", "test"); | ||
Substation s = network.newSubstation().setId("s").add(); | ||
VoltageLevel vl1 = s.newVoltageLevel().setId("vl1").setNominalV(400).setTopologyKind(TopologyKind.BUS_BREAKER).add(); | ||
VoltageLevel vl2 = s.newVoltageLevel().setId("vl2").setNominalV(400).setTopologyKind(TopologyKind.BUS_BREAKER).add(); | ||
Bus b1 = vl1.getBusBreakerView().newBus().setId("bus1").add(); | ||
Bus b2 = vl2.getBusBreakerView().newBus().setId("bus2").add(); | ||
Line l = network.newLine().setId("l").setVoltageLevel1(vl1.getId()).setBus1(b1.getId()).setVoltageLevel2(vl2.getId()).setBus2(b2.getId()) | ||
.setR(1).setX(3).setG1(0).setG2(0).setB1(0).setB2(0).add(); | ||
|
||
List<BlackBoxModel> dynamicModels = new ArrayList<>(); | ||
dynamicModels.add(new StandardLine("BBM_l", l.getId(), "SL")); | ||
dynamicModels.add(new CurrentLimitAutomaton("BBM_CLA", l.getId(), "CLA", Side.ONE)); | ||
DynamicSimulationParameters parameters = DynamicSimulationParameters.load(); | ||
DynaWaltzParameters dynawoParameters = DynaWaltzParameters.load(); | ||
String workingVariantId = network.getVariantManager().getWorkingVariantId(); | ||
List<BlackBoxModel> events = Collections.emptyList(); | ||
List<Curve> curves = Collections.emptyList(); | ||
UnsupportedOperationException e = assertThrows(UnsupportedOperationException.class, | ||
() -> new DynaWaltzContext(network, workingVariantId, dynamicModels, events, curves, parameters, dynawoParameters)); | ||
assertEquals("i variable not implemented in StandardLine dynawo's model", e.getMessage()); | ||
} | ||
} |
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
Oops, something went wrong.