Skip to content

Commit cd2d624

Browse files
committed
Updates to the PV all-in-one model
The following are a list of updates: 1) The AddOnBlock (Irradiance to Power) was missing machine base power to transform the output power from MW to p.u. 2) The user now has the option of using the addOn block with the PV model through a boolean parameter. Toggling the parameter enables or disables a realinput that allows the connection to the addOn. This works with all control modes in the PV model. 3) Created a new Test model called PVPlantSolarIrradiance, that is documented.
1 parent 2a6a4b4 commit cd2d624

7 files changed

Lines changed: 182 additions & 22 deletions

File tree

OpenIPSL/Electrical/Renewables/PSSE/AddOnBlocks.mo

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package AddOnBlocks
33
"This package contains additional add ons that can be added to the original renewable models."
44
model IrradianceToPower "PV Array Power Output from Irradiance."
55

6+
parameter Modelica.Units.SI.ApparentPower M_b = 100000000;
67
parameter Modelica.Units.SI.ActivePower Ypv = 1000 "Rated capacity of the PV array";
78
parameter Modelica.Units.SI.Temperature Tcstc = 25 "PV cell temperature under standard test conditions";
89
parameter Real fpv = 0.9 "PV derating factor";
@@ -14,17 +15,23 @@ package AddOnBlocks
1415

1516
Modelica.Blocks.Interfaces.RealOutput Ppv
1617
annotation (Placement(transformation(extent={{100,-10},{120,10}})));
17-
Modelica.Blocks.Sources.CombiTimeTable SolarRadiation
18+
Modelica.Blocks.Sources.CombiTimeTable SolarRadiation(table=
19+
SolarRadiationTable)
1820
annotation (Placement(transformation(extent={{-80,40},{-60,60}})));
19-
Modelica.Blocks.Sources.CombiTimeTable SolarArrayTemperature
21+
Modelica.Blocks.Sources.CombiTimeTable SolarArrayTemperature(table=
22+
SolarArrayTemperatureTable)
2023
annotation (Placement(transformation(extent={{-80,-60},{-60,-40}})));
2124

2225

2326

2427

28+
parameter Real SolarRadiationTable[:,:]=fill(0.0, 0, 2)
29+
"Table matrix (time = first column; e.g., table=[0, 0; 1, 1; 2, 4])";
30+
parameter Real SolarArrayTemperatureTable[:,:]=fill(0.0, 0, 2)
31+
"Table matrix (time = first column; e.g., table=[0, 0; 1, 1; 2, 4])";
2532
equation
2633

27-
Ppv = Ypv*fpv*(SolarRadiation.y[1]/Gtstc)*(1 + ap*(SolarArrayTemperature.y[1] - Tcstc));
34+
Ppv = (Ypv/M_b)*fpv*(SolarRadiation.y[1]/Gtstc)*(1 + ap*(SolarArrayTemperature.y[1] - Tcstc));
2835

2936
annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={
3037
Rectangle(extent={{-100,100},{100,-100}}, lineColor={28,108,200}),

OpenIPSL/Electrical/Renewables/PSSE/PV.mo

Lines changed: 52 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ extends OpenIPSL.Electrical.Essentials.pfComponent(
1515
parameter Integer QFunctionality = 0 "BESS Reactive Power Control Options" annotation (Dialog(group= "Reactive Power Control Options"), choices(choice=0 "Constant local PF control", choice=1 "Constant local Q control", choice=2 "Local V control", choice=3 "Local coordinated V/Q control", choice=4 "Plant level Q control", choice=5 "Plant level V control", choice=6 "Plant level Q control + local coordinated V/Q control", choice=7 "Plant level V control + local coordinated V/Q control"));
1616
parameter Integer PFunctionality = 0 "BESS Real Power Control Options" annotation (Dialog(group= "Active Power Control Options", enable=(QFunctionality >=4)), choices(choice=0 "No governor response", choice=1 "Governor response with up and down regulation"));
1717

18+
// Irradiance to Power parameter selection
19+
parameter Boolean Irr2Pow = false "Irradiance to Power Options" annotation (Dialog(group= "Irradiance to Power Add-On Capability"));
1820
replaceable
1921
OpenIPSL.Electrical.Renewables.PSSE.InverterInterface.BaseClasses.BaseREGC
2022
RenewableGenerator(
@@ -46,7 +48,7 @@ extends OpenIPSL.Electrical.Essentials.pfComponent(
4648
refflag=refflag) if QFunctionality >= 4 annotation (choicesAllMatching=true,
4749
Placement(transformation(extent={{-78,-20},{-38,20}})));
4850
Modelica.Blocks.Math.Gain gain(k=1)
49-
if QFunctionality < 4
51+
if QFunctionality < 4 and not Irr2Pow
5052
annotation (Placement(transformation(
5153
extent={{-6,-6},{6,6}},
5254
rotation=180,
@@ -59,8 +61,10 @@ extends OpenIPSL.Electrical.Essentials.pfComponent(
5961
origin={-6,-80})));
6062
Modelica.Blocks.Sources.Constant freq_ref(k=SysData.fn) if QFunctionality >= 4
6163
annotation (Placement(transformation(extent={{-70,-60},{-80,-50}})));
62-
Modelica.Blocks.Interfaces.RealInput FREQ if QFunctionality >= 4 "Connection Point Frequency"
63-
annotation (Placement(transformation(extent={{-140,-20},{-100,20}})));
64+
Modelica.Blocks.Interfaces.RealInput FREQ if QFunctionality >= 4
65+
"Connection Point Frequency"
66+
annotation (Placement(transformation(extent={{-140,-60},{-100,-20}}),
67+
iconTransformation(extent={{-140,-60},{-100,-20}})));
6468

6569
Modelica.Blocks.Interfaces.RealInput branch_ir if QFunctionality >= 4 "Measured Branch Real Current"
6670
annotation (Placement(transformation(
@@ -94,6 +98,27 @@ extends OpenIPSL.Electrical.Essentials.pfComponent(
9498
extent={{-20,-20},{20,20}},
9599
rotation=270,
96100
origin={60,100})));
101+
Modelica.Blocks.Interfaces.RealInput i2p if Irr2Pow
102+
"Irradiance to Power input" annotation (Placement(transformation(extent={{-140,
103+
20},{-100,60}}), iconTransformation(extent={{-140,20},{-100,60}})));
104+
Modelica.Blocks.Math.Gain gain2(k=1)
105+
if Irr2Pow and QFunctionality < 4
106+
annotation (Placement(transformation(
107+
extent={{-6,-6},{6,6}},
108+
rotation=0,
109+
origin={-86,80})));
110+
Modelica.Blocks.Math.Gain gain3(k=1)
111+
if Irr2Pow and QFunctionality >= 4
112+
annotation (Placement(transformation(
113+
extent={{-6,-6},{6,6}},
114+
rotation=0,
115+
origin={-86,60})));
116+
Modelica.Blocks.Math.Gain gain4(k=1)
117+
if QFunctionality >= 4 and not Irr2Pow
118+
annotation (Placement(transformation(
119+
extent={{-6,-6},{6,6}},
120+
rotation=180,
121+
origin={-60,-86})));
97122
protected
98123
parameter Boolean pfflag = (if QFunctionality == 0 then true else false);
99124
parameter Boolean vflag = (if QFunctionality == 3 or QFunctionality == 6 or QFunctionality == 7 then true else false);
@@ -102,8 +127,8 @@ protected
102127
parameter Boolean fflag = (if PFunctionality == 1 then true else false);
103128
equation
104129
connect(RenewableController.Iqcmd, RenewableGenerator.Iqcmd)
105-
annotation (Line(points={{20.6667,11.3333},{23.9048,11.3333},{23.9048,
106-
11.4286},{27.1429,11.4286}}, color={0,0,127}));
130+
annotation (Line(points={{20.6667,11.3333},{23.9048,11.3333},{23.9048,11.4286},
131+
{27.1429,11.4286}}, color={0,0,127}));
107132
connect(RenewableGenerator.IQ0, RenewableController.iq0) annotation (Line(
108133
points={{32.8571,-21.4286},{32.8571,-28},{16,-28},{16,-21.3333}},
109134
color={0,0,127}));
@@ -140,28 +165,23 @@ equation
140165
{-58,-36},{0,-36},{0,-21.3333}}, color={0,0,127}));
141166
connect(PlantController.q0, RenewableController.q0) annotation (Line(points={{-46,-22},
142167
{-46,-40},{-8,-40},{-8,-21.3333}}, color={0,0,127}));
143-
connect(gain.u, RenewableGenerator.p_0) annotation (Line(points={{1.2,-60},{
144-
67.1429,-60},{67.1429,-21.4286}},
145-
color={0,0,127}));
146-
connect(gain1.y, RenewableController.Qext) annotation (Line(points={{-12.6,
147-
-80},{-32,-80},{-32,-5.33333},{-21.3333,-5.33333}},
148-
color={0,0,127}));
168+
connect(gain.u, RenewableGenerator.p_0) annotation (Line(points={{1.2,-60},{67.1429,
169+
-60},{67.1429,-21.4286}}, color={0,0,127}));
170+
connect(gain1.y, RenewableController.Qext) annotation (Line(points={{-12.6,-80},
171+
{-32,-80},{-32,-5.33333},{-21.3333,-5.33333}}, color={0,0,127}));
149172
connect(gain.y, RenewableController.Pref) annotation (Line(points={{-12.6,-60},
150173
{-30,-60},{-30,-10.6667},{-21.3333,-10.6667}}, color={0,0,127}));
151-
connect(gain1.u, RenewableGenerator.q_0) annotation (Line(points={{1.2,-80},{
152-
58.5714,-80},{58.5714,-21.4286}},
153-
color={0,0,127}));
174+
connect(gain1.u, RenewableGenerator.q_0) annotation (Line(points={{1.2,-80},{58.5714,
175+
-80},{58.5714,-21.4286}}, color={0,0,127}));
154176
connect(freq_ref.y, PlantController.Freq_ref) annotation (Line(points={{-80.5,
155177
-55},{-88,-55},{-88,-12},{-80,-12}}, color={0,0,127}));
156-
connect(PlantController.Plant_pref, RenewableGenerator.p_0) annotation (Line(
157-
points={{-80,4},{-96,4},{-96,-92},{67.1429,-92},{67.1429,-21.4286}},
158-
color={0,0,127}));
159178
connect(PlantController.Qref, RenewableGenerator.q_0) annotation (Line(points={{-80,12},
160179
{-98,12},{-98,-98},{58.5714,-98},{58.5714,-21.4286}}, color={
161180
0,0,127}));
162181
connect(RenewableGenerator.p, pwPin)
163182
annotation (Line(points={{70,0},{100,0}}, color={0,0,255}));
164-
connect(PlantController.Freq, FREQ) annotation (Line(points={{-80,-4},{-92,-4},{-92,0},{-120,0}},
183+
connect(PlantController.Freq, FREQ) annotation (Line(points={{-80,-4},{-92,-4},
184+
{-92,-40},{-120,-40}},
165185
color={0,0,127}));
166186
connect(PlantController.branch_ii, branch_ii) annotation (Line(points={{-62,22},{-62,96},{-40,96},{-40,120}},
167187
color={0,0,127}));
@@ -173,6 +193,20 @@ equation
173193
color={0,0,127}));
174194
connect(RenewableController.Ipcmd, RenewableGenerator.Ipcmd) annotation (Line(points={{20.6667,
175195
-11.3333},{23.9048,-11.3333},{23.9048,-11.4286},{27.1429,-11.4286}}, color={0,0,127}));
196+
connect(i2p, gain2.u)
197+
annotation (Line(points={{-120,40},{-98,40},{-98,80},{-93.2,80}},
198+
color={0,0,127}));
199+
connect(gain2.y, RenewableController.Pref) annotation (Line(points={{-79.4,80},
200+
{-36,80},{-36,22},{-34,22},{-34,-10.6667},{-21.3333,-10.6667}},
201+
color={0,0,127}));
202+
connect(gain3.u, i2p) annotation (Line(points={{-93.2,60},{-98,60},{-98,40},{-120,
203+
40}}, color={0,0,127}));
204+
connect(gain4.u, RenewableGenerator.p_0) annotation (Line(points={{-52.8,-86},
205+
{-40,-86},{-40,-94},{67.1429,-94},{67.1429,-21.4286}}, color={0,0,127}));
206+
connect(gain4.y, PlantController.Plant_pref) annotation (Line(points={{-66.6,-86},
207+
{-94,-86},{-94,4},{-80,4}}, color={0,0,127}));
208+
connect(gain3.y, PlantController.Plant_pref) annotation (Line(points={{-79.4,60},
209+
{-76,60},{-76,32},{-88,32},{-88,4},{-80,4}}, color={0,0,127}));
176210
annotation (Icon(graphics={ Ellipse(
177211
extent={{-100,100},{100,-100}},
178212
lineColor={0,0,0},
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
within OpenIPSL.Tests.BaseClasses;
2+
partial model SMIBAddOn
3+
"SMIB - Single Machine Infinite Base system with one load for renewable source validation."
4+
extends Modelica.Icons.Example;
5+
OpenIPSL.Electrical.Branches.PwLine pwLine(
6+
R=2.50000E-2,
7+
X=2.50000E-2,
8+
G=0,
9+
B=0.05000/2) annotation (Placement(transformation(extent={{34,10},{54,30}})));
10+
OpenIPSL.Electrical.Branches.PwLine pwLine1(
11+
R=2.50000E-2,
12+
X=2.50000E-2,
13+
G=0,
14+
B=0.05000/2) annotation (Placement(transformation(extent={{34,-30},{54,-10}})));
15+
OpenIPSL.Electrical.Machines.PSSE.GENCLS gENCLS2_1(
16+
angle_0=-1.570655e-05,
17+
R_a=0,
18+
X_d=2.00000E-1,
19+
M_b=100000000,
20+
V_b=100000,
21+
P_0=-1498800,
22+
Q_0=-4334000,
23+
v_0=1.00000) annotation (Placement(transformation(extent={{98,-12},{86,12}})));
24+
OpenIPSL.Electrical.Branches.PwLine pwLine2(
25+
G=0,
26+
B=0,
27+
R=2.50000E-3,
28+
X=2.50000E-3)
29+
annotation (Placement(transformation(extent={{-6,-10},{14,10}})));
30+
OpenIPSL.Electrical.Events.PwFault pwFault(
31+
R=0.5,
32+
X=0.5,
33+
t1=2.00,
34+
t2=2.15)
35+
annotation (Placement(transformation(extent={{32,-60},{52,-40}})));
36+
inner OpenIPSL.Electrical.SystemBase SysData(fn=50, S_b=100000000) annotation (Placement(transformation(extent={{-100,80},
37+
{-60,100}})));
38+
OpenIPSL.Electrical.Buses.Bus GEN1
39+
annotation (Placement(transformation(extent={{-40,-10},{-20,10}})));
40+
OpenIPSL.Electrical.Buses.Bus FAULT
41+
annotation (Placement(transformation(extent={{6,-10},{26,10}})));
42+
OpenIPSL.Electrical.Buses.Bus GEN2
43+
annotation (Placement(transformation(extent={{64,-10},{84,10}})));
44+
equation
45+
connect(FAULT.p,pwLine. p)
46+
annotation (Line(points={{16,0},{24,0},{24,20},{35,20}}, color={0,0,255}));
47+
connect(pwLine1.p,pwLine. p) annotation (Line(points={{35,-20},{24,-20},{24,20},
48+
{35,20}}, color={0,0,255}));
49+
connect(pwFault.p,FAULT. p) annotation (Line(points={{30.3333,-50},{20,-50},{
50+
20,0},{16,0}}, color={0,0,255}));
51+
connect(pwLine.n,GEN2. p)
52+
annotation (Line(points={{53,20},{64,20},{64,0},{74,0}}, color={0,0,255}));
53+
connect(pwLine1.n,GEN2. p) annotation (Line(points={{53,-20},{64,-20},{64,0},{
54+
74,0}}, color={0,0,255}));
55+
connect(GEN2.p,gENCLS2_1. p)
56+
annotation (Line(points={{74,0},{86,0}}, color={0,0,255}));
57+
connect(pwLine2.n, FAULT.p)
58+
annotation (Line(points={{13,0},{16,0}}, color={0,0,255}));
59+
connect(GEN1.p, pwLine2.p)
60+
annotation (Line(points={{-30,0},{-5,0}}, color={0,0,255}));
61+
annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,
62+
-100},{120,100}})), Diagram(
63+
coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,
64+
100}})));
65+
end SMIBAddOn;

OpenIPSL/Tests/BaseClasses/package.order

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ LoadTestBase
22
MachineTestBase
33
SMIB
44
SMIBRenewable
5+
SMIBAddOn
56
TGTestBase

OpenIPSL/Tests/Renewable/PSSE/PVPlant.mo

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ model PVPlant
99
angle_0(displayUnit="deg") = 0.02574992,
1010
QFunctionality=4,
1111
PFunctionality=0,
12+
Irr2Pow=false,
1213
redeclare OpenIPSL.Electrical.Renewables.PSSE.InverterInterface.REGCA1
1314
RenewableGenerator,
1415
redeclare OpenIPSL.Electrical.Renewables.PSSE.ElectricalController.REECB1
@@ -20,7 +21,8 @@ equation
2021
connect(pV.pwPin, GEN1.p)
2122
annotation (Line(points={{-40,0},{-30,0}}, color={0,0,255}));
2223
connect(freq.y, pV.FREQ)
23-
annotation (Line(points={{-75,0},{-62,0}}, color={0,0,127}));
24+
annotation (Line(points={{-75,0},{-68,0},{-68,-4},{-62,-4}},
25+
color={0,0,127}));
2426
connect(pwVoltage.vi, pV.regulate_vi)
2527
annotation (Line(points={{-36.6,30},{-44,30},{-44,10}}, color={0,0,127}));
2628
connect(pwVoltage.vr, pV.regulate_vr) annotation (Line(points={{-36.6,33.6},{
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
within OpenIPSL.Tests.Renewable.PSSE;
2+
model PVPlantSolarIrradiance
3+
"PV source in a SMIB system to test functionality of Irradiance to Power Add on"
4+
extends BaseClasses.SMIBAddOn;
5+
Electrical.Renewables.PSSE.PV pV(
6+
P_0=1500000,
7+
Q_0=-5665800,
8+
v_0=1,
9+
angle_0(displayUnit="deg") = 0.02574992,
10+
QFunctionality=1,
11+
PFunctionality=0,
12+
Irr2Pow=true,
13+
redeclare OpenIPSL.Electrical.Renewables.PSSE.InverterInterface.REGCA1
14+
RenewableGenerator,
15+
redeclare OpenIPSL.Electrical.Renewables.PSSE.ElectricalController.REECB1
16+
RenewableController(vref0=1),
17+
redeclare OpenIPSL.Electrical.Renewables.PSSE.PlantController.REPCA1
18+
PlantController)
19+
annotation (Placement(transformation(extent={{-60,-10},{-40,10}})));
20+
Electrical.Renewables.PSSE.AddOnBlocks.IrradianceToPower irradianceToPower(
21+
M_b(displayUnit="MV.A") = 100000000,
22+
Ypv(displayUnit="MW") = 1500000,
23+
Tcstc(displayUnit="degC") = 298.15,
24+
fpv=1,
25+
ap=0,
26+
SolarRadiationTable=[0.0,1000; 2,600; 3,700; 4,250; 5,1000],
27+
SolarArrayTemperatureTable=[0.0,25; 10,25])
28+
annotation (Placement(transformation(extent={{-92,-6},{-72,14}})));
29+
equation
30+
connect(pV.pwPin, GEN1.p)
31+
annotation (Line(points={{-40,0},{-30,0}}, color={0,0,255}));
32+
connect(irradianceToPower.Ppv, pV.i2p)
33+
annotation (Line(points={{-71,4},{-62,4}}, color={0,0,127}));
34+
annotation (experiment(
35+
StopTime=5,
36+
__Dymola_NumberOfIntervals=5000,
37+
__Dymola_Algorithm="Dassl"), Documentation(info="<html>
38+
<p>
39+
Simulate for 5 seconds.
40+
</p>
41+
<p>This test system aims to show how to use IrradianceToPower block, an Add-On component that enables varying active power reference in the PV model based on irradiance levels.
42+
This capability is not found in the original version of the WECC-based renewable models.</p>
43+
<p>Variables of interest:</p>
44+
<ul>
45+
<li><code>pV.RenewableGenerator.Pgen</code></li>
46+
<li><code>pV.RenewableGenerator.Qgen</code></li>
47+
<li><code>irradianceToPower.Ppv</code></li>
48+
</ul>
49+
</html>"));
50+
end PVPlantSolarIrradiance;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
BESSPlant
22
PVPlant
3+
PVPlantSolarIrradiance
34
WindPlant

0 commit comments

Comments
 (0)