Skip to content

Commit

Permalink
reduce the size of test network
Browse files Browse the repository at this point in the history
Signed-off-by: jamal-khey <myjamal89@gmail.com>
  • Loading branch information
jamal-khey committed Dec 4, 2024
1 parent f3a5856 commit 1ccbc18
Showing 1 changed file with 4 additions and 241 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ static Network createNetwork(String prefix, boolean createVariant) {
.setTso("RTE")
.setGeographicalTags("A")
.add();
Substation p2 = network.newSubstation()
.setId(prefix + "P2")
.setCountry(Country.FR)
.setTso("RTE")
.setGeographicalTags("B")
.add();
VoltageLevel vlgen = p1.newVoltageLevel()
.setId(prefix + "VLGEN")
.setNominalV(24.0)
Expand All @@ -44,58 +38,14 @@ static Network createNetwork(String prefix, boolean createVariant) {
.setNominalV(380.0)
.setTopologyKind(TopologyKind.BUS_BREAKER)
.add();
VoltageLevel vlhv2 = p2.newVoltageLevel()
.setId(prefix + "VLHV2")
.setNominalV(380.0)
.setTopologyKind(TopologyKind.BUS_BREAKER)
.add();
VoltageLevel vlload = p2.newVoltageLevel()
.setId(prefix + "VLLOAD")
.setNominalV(150.0)
.setTopologyKind(TopologyKind.BUS_BREAKER)
.add();

Bus ngen = vlgen.getBusBreakerView().newBus()
.setId(prefix + "NGEN")
.add();
Bus nhv1 = vlhv1.getBusBreakerView().newBus()
.setId(prefix + "NHV1")
.add();
Bus nhv2 = vlhv2.getBusBreakerView().newBus()
.setId(prefix + "NHV2")
.add();
Bus nload = vlload.getBusBreakerView().newBus()
.setId(prefix + "NLOAD")
.add();
network.newLine()
.setId(prefix + "NHV1_NHV2_1")
.setVoltageLevel1(vlhv1.getId())
.setBus1(nhv1.getId())
.setConnectableBus1(nhv1.getId())
.setVoltageLevel2(vlhv2.getId())
.setBus2(nhv2.getId())
.setConnectableBus2(nhv2.getId())
.setR(3.0)
.setX(33.0)
.setG1(0.0)
.setB1(386E-6 / 2)
.setG2(0.0)
.setB2(386E-6 / 2)
.add();
network.newLine()
.setId(prefix + "NHV1_NHV2_2")
.setVoltageLevel1(vlhv1.getId())
.setBus1(nhv1.getId())
.setConnectableBus1(nhv1.getId())
.setVoltageLevel2(vlhv2.getId())
.setBus2(nhv2.getId())
.setConnectableBus2(nhv2.getId())
.setR(3.0)
.setX(33.0)
.setG1(0.0)
.setB1(386E-6 / 2)
.setG2(0.0)
.setB2(386E-6 / 2)
.add();

int zb380 = 380 * 380 / 100;
p1.newTwoWindingsTransformer()
.setId(prefix + "NGEN_NHV1")
Expand All @@ -112,74 +62,7 @@ static Network createNetwork(String prefix, boolean createVariant) {
.setG(0.0)
.setB(0.0)
.add();
int zb150 = 150 * 150 / 100;
TwoWindingsTransformer nhv2Nload = p2.newTwoWindingsTransformer()
.setId(prefix + "NHV2_NLOAD")
.setVoltageLevel1(vlhv2.getId())
.setBus1(nhv2.getId())
.setConnectableBus1(nhv2.getId())
.setRatedU1(400.0)
.setVoltageLevel2(vlload.getId())
.setBus2(nload.getId())
.setConnectableBus2(nload.getId())
.setRatedU2(158.0)
.setR(0.21 / 1000 * zb150)
.setX(Math.sqrt(18 * 18 - 0.21 * 0.21) / 1000 * zb150)
.setG(0.0)
.setB(0.0)
.add();
double a = (158.0 / 150.0) / (400.0 / 380.0);
nhv2Nload.newRatioTapChanger()
.beginStep()
.setRho(0.85f * a)
.setR(0.0)
.setX(0.0)
.setG(0.0)
.setB(0.0)
.endStep()
.beginStep()
.setRho(a)
.setR(0.0)
.setX(0.0)
.setG(0.0)
.setB(0.0)
.endStep()
.beginStep()
.setRho(1.15f * a)
.setR(0.0)
.setX(0.0)
.setG(0.0)
.setB(0.0)
.endStep()
.setTapPosition(1)
.setLoadTapChangingCapabilities(true)
.setRegulating(true)
.setTargetV(158.0)
.setTargetDeadband(0)
.setRegulationTerminal(nhv2Nload.getTerminal2())
.add();
vlload.newLoad()
.setId(prefix + "LOAD")
.setBus(nload.getId())
.setConnectableBus(nload.getId())
.setP0(600.0)
.setQ0(200.0)
.add();
Generator generator = vlgen.newGenerator()
.setId(prefix + "GEN")
.setBus(ngen.getId())
.setConnectableBus(ngen.getId())
.setMinP(-9999.99)
.setMaxP(9999.99)
.setVoltageRegulatorOn(true)
.setTargetV(24.5)
.setTargetP(607.0)
.setTargetQ(301.0)
.add();
generator.newMinMaxReactiveLimits()
.setMinQ(-9999.99)
.setMaxQ(9999.99)
.add();


if (createVariant) {
network.getVariantManager().cloneVariant(VariantManagerConstants.INITIAL_VARIANT_ID, VARIANT_1_ID);
Expand All @@ -188,43 +71,7 @@ static Network createNetwork(String prefix, boolean createVariant) {
return network;
}

/**
* <pre>
* G
* C |
* BBS1 -------[+]------- BBS2 VL1
* | [+] B1
* | |
* L1 | | L2
* | |
* B3 [+] [+] B4
* BBS3 ----------------- VL2
* |
* LD
* </pre>
* 6 buses
* 6 branches
*
* G
* |
* o--C--o
* | |
* | B1
* | |
* | o
* | |
* L1 L2
* | |
* o o
* | |
* B3 B4
* | |
* ---o---
* |
* LD
*
* @author Gael Macharel {@literal <gael.macherel at artelys.com>}
*/

public static Network createNodeBreakerNetwork() {
Network network = Network.create("test", "test");
Substation s = network.newSubstation()
Expand All @@ -245,40 +92,6 @@ public static Network createNodeBreakerNetwork() {
.setId("BBS2")
.setNode(1)
.add();
vl1.getNodeBreakerView().newDisconnector()
.setId("D")
.setNode1(0)
.setNode2(6)
.add();
vl1.getNodeBreakerView().newBreaker()
.setId("C")
.setNode1(6)
.setNode2(1)
.setRetained(true)
.add();
vl1.getNodeBreakerView().newBreaker()
.setId("B1")
.setNode1(1)
.setNode2(3)
.add();
vl1.getNodeBreakerView().newInternalConnection()
.setNode1(1)
.setNode2(4)
.add();
vl1.getNodeBreakerView().newInternalConnection()
.setNode1(0)
.setNode2(5)
.add();
vl1.newGenerator()
.setId("G")
.setNode(4)
.setMinP(0.0)
.setMaxP(1000.0)
.setVoltageRegulatorOn(true)
.setTargetV(398)
.setTargetP(603.77)
.setTargetQ(301.0)
.add();

VoltageLevel vl2 = s.newVoltageLevel()
.setId("VL2")
Expand All @@ -291,56 +104,6 @@ public static Network createNodeBreakerNetwork() {
.setId("BBS3")
.setNode(0)
.add();
vl2.getNodeBreakerView().newBreaker()
.setId("B3")
.setNode1(0)
.setNode2(1)
.setRetained(true)
.add();
vl2.getNodeBreakerView().newBreaker()
.setId("B4")
.setNode1(0)
.setNode2(2)
.add();
vl2.getNodeBreakerView().newInternalConnection()
.setNode1(0)
.setNode2(3)
.add();
vl2.newLoad()
.setId("LD")
.setNode(3)
.setP0(600.0)
.setQ0(200.0)
.add();

network.newLine()
.setId("L1")
.setVoltageLevel1("VL1")
.setNode1(5)
.setVoltageLevel2("VL2")
.setNode2(1)
.setR(3.0)
.setX(33.0)
.setB1(386E-6 / 2)
.setB2(386E-6 / 2)
.add();

network.newLine()
.setId("L2")
.setVoltageLevel1("VL1")
.setNode1(3)
.setVoltageLevel2("VL2")
.setNode2(2)
.setR(3.0)
.setX(33.0)
.setB1(386E-6 / 2)
.setB2(386E-6 / 2)
.add();

network.getLine("L1").newCurrentLimits1().setPermanentLimit(940.0).add();
network.getLine("L1").newCurrentLimits2().setPermanentLimit(940.0).add();
network.getLine("L2").newCurrentLimits1().setPermanentLimit(940.0).add();
network.getLine("L2").newCurrentLimits2().setPermanentLimit(940.0).add();

return network;
}
Expand Down

0 comments on commit 1ccbc18

Please sign in to comment.