Skip to content

Commit 89a0365

Browse files
fachifdietmarw
authored andcommitted
New Microgrid Examples
The following is a list of updates: 1- Creation of a Microgrid sub-package within the Examples sub-package. 2- Addition of two microgrid examples (university microgrid campus examples), named CampusA, and CampusB. 3- Record structure used in each example. 4- CampusB was built utilizing the renewable models from the WECCRenewables pull request.
1 parent ac6dd83 commit 89a0365

File tree

129 files changed

+5031
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+5031
-0
lines changed

OpenIPSL/Examples/Microgrids/UniversityCampus/CampusA/CampusGridA.mo

Lines changed: 608 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
within OpenIPSL.Examples.Microgrids.UniversityCampus.CampusA.GUnitTest;
2+
model CTG1 "SMIB test model for CTG1"
3+
extends OpenIPSL.Tests.BaseClasses.SMIB(
4+
SysData(fn=60),
5+
constantLoad(
6+
P_0=powerFlow.powerflow.loads.PL1,
7+
Q_0=powerFlow.powerflow.loads.QL1,
8+
v_0=powerFlow.powerflow.bus.v3,
9+
angle_0=powerFlow.powerflow.bus.A3),
10+
gENCLS(
11+
P_0=powerFlow.powerflow.machines.PG2,
12+
Q_0=powerFlow.powerflow.machines.QG2,
13+
v_0=powerFlow.powerflow.bus.v2,
14+
angle_0=powerFlow.powerflow.bus.A2));
15+
GenerationGroups.CTG1.CTG1MachineESVC genUnit(
16+
P_0=powerFlow.powerflow.machines.PG1,
17+
Q_0=powerFlow.powerflow.machines.QG1,
18+
v_0=powerFlow.powerflow.bus.v1,
19+
angle_0=powerFlow.powerflow.bus.A1,
20+
displayPF=true)
21+
annotation (Placement(transformation(rotation=0, extent={{-66,-10},{-46,10}})),
22+
choicesAllMatching=true);
23+
GUnitTest.PfDataSMIB.PowerFlow powerFlow(redeclare record PowerFlow =
24+
OpenIPSL.Examples.Microgrids.UniversityCampus.CampusA.GUnitTest.PfDataSMIB.PfCTG1)
25+
annotation (Placement(transformation(extent={{-80,40},{-60,60}})));
26+
equation
27+
connect(genUnit.pwPin, GEN1.p)
28+
annotation (Line(points={{-45,0},{-30,0}}, color={0,0,255}));
29+
annotation (
30+
experiment(
31+
StopTime=15,
32+
Interval=0.001,
33+
__Dymola_Algorithm="Dassl"));
34+
end CTG1;
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
within OpenIPSL.Examples.Microgrids.UniversityCampus.CampusA.GUnitTest;
2+
model CTG2 "SMIB test model for CTG2"
3+
extends OpenIPSL.Tests.BaseClasses.SMIB(
4+
SysData(fn=60),
5+
constantLoad(
6+
P_0=powerFlow.powerflow.loads.PL1,
7+
Q_0=powerFlow.powerflow.loads.QL1,
8+
v_0=powerFlow.powerflow.bus.v3,
9+
angle_0=powerFlow.powerflow.bus.A3),
10+
gENCLS(
11+
P_0=powerFlow.powerflow.machines.PG2,
12+
Q_0=powerFlow.powerflow.machines.QG2,
13+
v_0=powerFlow.powerflow.bus.v2,
14+
angle_0=powerFlow.powerflow.bus.A2));
15+
GenerationGroups.CTG2.CTG2MachineES genUnit(
16+
P_0=powerFlow.powerflow.machines.PG1,
17+
Q_0=powerFlow.powerflow.machines.QG1,
18+
v_0=powerFlow.powerflow.bus.v1,
19+
angle_0=powerFlow.powerflow.bus.A1,
20+
displayPF=true) annotation (Placement(transformation(rotation=0, extent={{-66,
21+
-10},{-46,10}})));
22+
GUnitTest.PfDataSMIB.PowerFlow powerFlow(redeclare record PowerFlow =
23+
GUnitTest.PfDataSMIB.PfCTG2)
24+
annotation (Placement(transformation(extent={{-80,40},{-60,60}})));
25+
equation
26+
connect(genUnit.pwPin, GEN1.p)
27+
annotation (Line(points={{-45,0},{-30,0}}, color={0,0,255}));
28+
annotation (
29+
experiment(
30+
StopTime=15,
31+
Interval=0.001,
32+
__Dymola_Algorithm="Dassl"));
33+
end CTG2;
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
within OpenIPSL.Examples.Microgrids.UniversityCampus.CampusA.GUnitTest.PfDataSMIB;
2+
package BusData "Records with power flow solutions for buses"
3+
extends Modelica.Icons.RecordsPackage;
4+
5+
partial record BusTemplate "Record template for power flow solutions in buses"
6+
7+
parameter OpenIPSL.Types.PerUnit v1 "FAULT"
8+
annotation (Dialog(enable=false));
9+
parameter OpenIPSL.Types.Angle A1 "FAULT" annotation (Dialog(enable=false));
10+
11+
parameter OpenIPSL.Types.PerUnit v2 "GEN1"
12+
annotation (Dialog(enable=false));
13+
parameter OpenIPSL.Types.Angle A2 "GEN1" annotation (Dialog(enable=false));
14+
15+
parameter OpenIPSL.Types.PerUnit v3 "GEN2"
16+
annotation (Dialog(enable=false));
17+
parameter OpenIPSL.Types.Angle A3 "GEN2" annotation (Dialog(enable=false));
18+
19+
parameter OpenIPSL.Types.PerUnit v4 "LOAD"
20+
annotation (Dialog(enable=false));
21+
parameter OpenIPSL.Types.Angle A4 "LOAD" annotation (Dialog(enable=false));
22+
23+
parameter OpenIPSL.Types.PerUnit v5 "SHUNT"
24+
annotation (Dialog(enable=false));
25+
parameter OpenIPSL.Types.Angle A5 "SHUNT" annotation (Dialog(enable=false));
26+
27+
end BusTemplate;
28+
29+
record PfBusCTG1 "Record for power flow solutions in buses - CTG1"
30+
extends BusTemplate(
31+
v1=1.000000000000,
32+
A1=0.0351335730883302,
33+
v2=1.000000000000,
34+
A2=0.000000000000,
35+
v3=0.9962938904832637,
36+
A3=-0.00500433127679407,
37+
v4=0.9981438211590149,
38+
A4=-0.00249752321899275,
39+
v5=0.9981438211590149,
40+
A5=-0.00249752321899275);
41+
42+
// Bus: 'B01' (PV bus)
43+
44+
// Bus: 'B02' (slack bus)
45+
46+
// Bus: 'B03' (PQ bus)
47+
48+
// Bus: 'B04' (PQ bus)
49+
50+
// Bus: 'B05' (PQ bus)
51+
52+
end PfBusCTG1;
53+
54+
record PfBusCTG2 "Record for power flow solutions in buses - CTG2"
55+
extends BusTemplate(
56+
v1=1.000000000000,
57+
A1=0.028082878029775,
58+
v2=1.000000000000,
59+
A2=0.000000000000,
60+
v3=0.9970818338868578,
61+
A3=-0.00399985804022414,
62+
v4=0.9985389202207743,
63+
A4=-0.00199700783930364,
64+
v5=0.9985389202207743,
65+
A5=-0.00199700783930364);
66+
67+
// Bus: 'B01' (PV bus)
68+
69+
// Bus: 'B02' (slack bus)
70+
71+
// Bus: 'B03' (PQ bus)
72+
73+
// Bus: 'B04' (PQ bus)
74+
75+
// Bus: 'B05' (PQ bus)
76+
77+
end PfBusCTG2;
78+
79+
record PfBusSTGx
80+
"Record for power flow solutions in buses - STGs 1 and 2"
81+
extends BusTemplate(
82+
v1=0.9999999999999999,
83+
A1=0.0200458055147281,
84+
v2=1.000000000000,
85+
A2=0.000000000000,
86+
v3=0.9977066303828163,
87+
A3=-0.00399933569283056,
88+
v4=0.9988513182764066,
89+
A4=-0.00199737273742058,
90+
v5=0.9988513182764066,
91+
A5=-0.00199737273742058);
92+
93+
// Bus: 'B01' (PV bus)
94+
95+
// Bus: 'B02' (slack bus)
96+
97+
// Bus: 'B03' (PQ bus)
98+
99+
// Bus: 'B04' (PQ bus)
100+
101+
// Bus: 'B05' (PQ bus)
102+
103+
end PfBusSTGx;
104+
end BusData;
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
within OpenIPSL.Examples.Microgrids.UniversityCampus.CampusA.GUnitTest.PfDataSMIB;
2+
package LoadData "Records with power flow solutions for loads"
3+
extends Modelica.Icons.RecordsPackage;
4+
5+
partial record LoadTemplate
6+
"Record template for power flow solutions in loads"
7+
8+
parameter OpenIPSL.Types.ActivePower PL1 "Load: constantLoad"
9+
annotation (Dialog(enable=false));
10+
parameter OpenIPSL.Types.ReactivePower QL1 "Load: constantLoad"
11+
annotation (Dialog(enable=false));
12+
13+
end LoadTemplate;
14+
15+
record PfLoadCTG1 "Record for power flow solutions in loads - CTG1"
16+
extends LoadTemplate( PL1=1e06*(24.999963726394313), QL1=1e06*(4.999871114142722));
17+
18+
// Load: '3_1'
19+
20+
end PfLoadCTG1;
21+
22+
record PfLoadCTG2 "Record for power flow solutions in loads - CTG2"
23+
extends LoadTemplate( PL1=1e06*(19.99998553308777), QL1=1e06*(3.999947489386742));
24+
25+
// Load: '3_1'
26+
27+
end PfLoadCTG2;
28+
29+
record PfLoadSTGx
30+
"Record for power flow solutions in loads - STGs 1 and 2"
31+
extends LoadTemplate( PL1=1e06*(15.999994571217577), QL1=1e06*(3.1999826291098503));
32+
33+
// Load: '3_1'
34+
35+
end PfLoadSTGx;
36+
end LoadData;
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
within OpenIPSL.Examples.Microgrids.UniversityCampus.CampusA.GUnitTest.PfDataSMIB;
2+
package MachineData "Records with power flow solutions for machines"
3+
extends Modelica.Icons.RecordsPackage;
4+
5+
partial record MachineTemplate
6+
"Record template for power flow solutions in machines"
7+
8+
parameter OpenIPSL.Types.ActivePower PG1 "machine: generator1"
9+
annotation (Dialog(enable=false));
10+
parameter OpenIPSL.Types.ReactivePower QG1 "machine: generator1"
11+
annotation (Dialog(enable=false));
12+
13+
parameter OpenIPSL.Types.ActivePower PG2 "machine: generator2"
14+
annotation (Dialog(enable=false));
15+
parameter OpenIPSL.Types.ReactivePower QG2 "machine: generator2"
16+
annotation (Dialog(enable=false));
17+
18+
end MachineTemplate;
19+
20+
record PfMachineCTG1 "Record for power flow solutions in machines - CTG1"
21+
extends MachineTemplate(
22+
PG1=1e06*(19.999977521718698),
23+
QG1=1e06*(2.1542711599214925),
24+
PG2=1e06*(5.004237367929214),
25+
QG2=1e06*(3.693562535981343));
26+
27+
// MACHINE: '1_1'
28+
// Bus: B01'
29+
30+
// MACHINE: '2_1'
31+
// Bus: B02'
32+
33+
end PfMachineCTG1;
34+
35+
record PfMachineCTG2
36+
"Record for power flow solutions in machines - CTG2"
37+
extends MachineTemplate(
38+
PG1=1e06*(15.999991106518504),
39+
QG1=1e06*(1.6356356639820249),
40+
PG2=1e06*(4.002708093375343),
41+
QG2=1e06*(2.9061282301263702));
42+
43+
// MACHINE: '1_1'
44+
// Bus: B01'
45+
46+
// MACHINE: '2_1'
47+
// Bus: B02'
48+
49+
end PfMachineCTG2;
50+
51+
record PfMachineSTGx
52+
"Record for power flow solutions in machines - STGs 1 and 2"
53+
extends MachineTemplate(
54+
PG1=1e06*(11.999997026332537),
55+
QG1=1e06*(1.230888590639907),
56+
PG2=1e06*(4.00156083338845),
57+
QG2=1e06*(2.2813405568836487));
58+
59+
// MACHINE: '1_1'
60+
// Bus: B01'
61+
62+
// MACHINE: '2_1'
63+
// Bus: B02'
64+
65+
end PfMachineSTGx;
66+
end MachineData;
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
within OpenIPSL.Examples.Microgrids.UniversityCampus.CampusA.GUnitTest.PfDataSMIB;
2+
record PfCTG1 "Record for power flow solutions - CTG1"
3+
extends PowerFlowTemplate;
4+
5+
replaceable record Bus =
6+
BusData.PfBusCTG1 constrainedby BusData.BusTemplate
7+
"Bus power flow results";
8+
Bus bus;
9+
10+
replaceable record Loads =
11+
LoadData.PfLoadCTG1 constrainedby LoadData.LoadTemplate
12+
"Loads power flow results";
13+
Loads loads;
14+
15+
replaceable record Machines =
16+
MachineData.PfMachineCTG1 constrainedby MachineData.MachineTemplate
17+
"Machine power flow results";
18+
Machines machines;
19+
20+
replaceable record Trafos =
21+
TrafoData.PfTrafoCTG1 constrainedby TrafoData.TrafoTemplate
22+
"Trafos power flow results";
23+
Trafos trafos;
24+
25+
end PfCTG1;
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
within OpenIPSL.Examples.Microgrids.UniversityCampus.CampusA.GUnitTest.PfDataSMIB;
2+
record PfCTG2 "Record for power flow solutions - CTG2"
3+
extends PowerFlowTemplate;
4+
5+
replaceable record Bus =
6+
BusData.PfBusCTG2 constrainedby BusData.BusTemplate
7+
"Bus power flow results";
8+
Bus bus;
9+
10+
replaceable record Loads =
11+
LoadData.PfLoadCTG2 constrainedby LoadData.LoadTemplate
12+
"Loads power flow results";
13+
Loads loads;
14+
15+
replaceable record Machines =
16+
MachineData.PfMachineCTG2 constrainedby MachineData.MachineTemplate
17+
"Machine power flow results";
18+
Machines machines;
19+
20+
replaceable record Trafos =
21+
TrafoData.PfTrafoCTG2 constrainedby TrafoData.TrafoTemplate
22+
"Trafos power flow results";
23+
Trafos trafos;
24+
25+
end PfCTG2;
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
within OpenIPSL.Examples.Microgrids.UniversityCampus.CampusA.GUnitTest.PfDataSMIB;
2+
record PfSTGx "Record for power flow solutions - Pload = 50 MW"
3+
extends PowerFlowTemplate;
4+
5+
replaceable record Bus =
6+
BusData.PfBusSTGx constrainedby BusData.BusTemplate
7+
"Bus power flow results";
8+
Bus bus;
9+
10+
replaceable record Loads =
11+
LoadData.PfLoadSTGx constrainedby LoadData.LoadTemplate
12+
"Loads power flow results";
13+
Loads loads;
14+
15+
replaceable record Machines =
16+
MachineData.PfMachineSTGx constrainedby MachineData.MachineTemplate
17+
"Machine power flow results";
18+
Machines machines;
19+
20+
replaceable record Trafos =
21+
TrafoData.PfTrafoSTGx constrainedby TrafoData.TrafoTemplate
22+
"Trafos power flow results";
23+
Trafos trafos;
24+
25+
end PfSTGx;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
within OpenIPSL.Examples.Microgrids.UniversityCampus.CampusA.GUnitTest.PfDataSMIB;
2+
record PowerFlow
3+
extends Modelica.Icons.Record;
4+
5+
replaceable record PowerFlow =
6+
PowerFlowTemplate constrainedby PowerFlowTemplate "Replaceable power flow record"
7+
annotation (
8+
choicesAllMatching);
9+
10+
PowerFlow powerflow;
11+
12+
end PowerFlow;

0 commit comments

Comments
 (0)