Skip to content

Commit 82c799d

Browse files
authored
Merge branch 'master' into UniversityCampusMicrogrid_1
2 parents f247da4 + 5a7f68b commit 82c799d

File tree

121 files changed

+4520
-2329
lines changed

Some content is hidden

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

121 files changed

+4520
-2329
lines changed

.github/workflows/cla.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- name: "CLA Assistant"
1313
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
1414
# Beta Release
15-
uses: cla-assistant/github-action@v2.2.1
15+
uses: cla-assistant/github-action@v2.6.1
1616
env:
1717
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1818
# the below token should have repo scope and must be manually added by you in the repository's secret

OpenIPSL/Electrical/Controls/PSSE/ES/BaseClasses/invFEX.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
within OpenIPSL.Electrical.Controls.PSSE.ES.BaseClasses;
22
function invFEX "Inverse F_EX function for initialization"
3-
input Real K_C=K_C;
3+
input Real K_C;
44
input Real Efd0;
55
input Real Ifd0;
66
output Real VE0;

OpenIPSL/Electrical/Controls/PSSE/ES/ESURRY.mo

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,6 @@ model ESURRY "AC1A Excitation System"
6666
E_2=E_2,
6767
S_EE_1=S_EE_1,
6868
S_EE_2=S_EE_2,
69-
redeclare replaceable Modelica.Blocks.Continuous.LimIntegrator sISO(
70-
outMin=0,
71-
k=1/rotatingExciterWithDemagnetization.T_E,
72-
initType=Modelica.Blocks.Types.Init.InitialOutput,
73-
y_start=rotatingExciterWithDemagnetization.Efd0,
74-
outMax=Modelica.Constants.inf),
7569
K_D=K_D,
7670
Efd0=VE0,
7771
Sum(k3=K_D))

OpenIPSL/Electrical/Controls/PSSE/PSS/IEE2ST.mo

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,19 @@ initial equation
7676
ICS10 = V_S1;
7777
ICS20 = V_S2;
7878
equation
79-
if V_CU == 0 and not V_CL == 0 then
79+
if not (V_CU < 0 or V_CU > 0) and (V_CL < 0 or V_CL > 0) then
8080
if VCT > V_CL then
8181
VOTHSG = VSS;
8282
else
8383
VOTHSG = 0;
8484
end if;
85-
elseif V_CL == 0 and not V_CU == 0 then
85+
elseif not (V_CL < 0 or V_CL > 0) and (V_CU < 0 or V_CU > 0) then
8686
if VCT < V_CU then
8787
VOTHSG = VSS;
8888
else
8989
VOTHSG = 0;
9090
end if;
91-
elseif V_CU == 0 and V_CL == 0 then
91+
elseif not (V_CU < 0 or V_CU > 0) and not (V_CL < 0 or V_CL > 0) then
9292
VOTHSG = VSS;
9393
elseif VCT > V_CL and VCT < V_CU then
9494
VOTHSG = VSS;

OpenIPSL/Electrical/Controls/PSSE/PSS/PSS2A.mo

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,5 +118,10 @@ equation
118118
<td><p>see <a href=\"modelica://OpenIPSL.UsersGuide.Contact\">UsersGuide.Contact</a></p></td>
119119
</tr>
120120
</table>
121+
</html>", info="<html>
122+
123+
<p>This model uses an implementation of the ramp tracking filter as described in <a href=\"modelica://OpenIPSL.UsersGuide.References\">[Laera2022]</a>, which can be found under <code>OpenIPSL.NonElectrical.Continuous.RampTrackingFilter</code>.</p>
124+
<p>See <a href=\"modelica://OpenIPSL.UsersGuide.References\">[Laera2022]</a> for the expected behavior of this model.</p>
125+
121126
</html>"));
122127
end PSS2A;

OpenIPSL/Electrical/Controls/PSSE/PSS/PSS2B.mo

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,11 @@ equation
113113
extent={{-40,80},{40,40}},
114114
lineColor={28,108,200},
115115
textString="PSS2B")}),
116-
Documentation(info="<html>IEEE Dual-Input Stabilizer Model.</html>",
116+
Documentation(info="<html>
117+
<p>IEEE Dual-Input Stabilizer Model.</p>
118+
<p>This model uses an implementation of the ramp tracking filter as described in <a href=\"modelica://OpenIPSL.UsersGuide.References\">[Laera2022]</a>, which can be found under <code>OpenIPSL.NonElectrical.Continuous.RampTrackingFilter</code>.</p>
119+
<p>See <a href=\"modelica://OpenIPSL.UsersGuide.References\">[Laera2022]</a> for the expected behavior of this model.</p>
120+
</html>",
117121
revisions="<html><table cellspacing=\"1\" cellpadding=\"1\" border=\"1\">
118122
<tr>
119123
<td><p>Reference</p></td>
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
within OpenIPSL.Electrical.Controls.PSSE.TG;
2+
model DEGOV "DEGOV - Woodward Diesel Governor"
3+
extends BaseClasses.BaseGovernor;
4+
5+
parameter Modelica.Units.SI.Time T1 "Governor Mechanism Time Constant";
6+
parameter Modelica.Units.SI.Time T2 "Turbine Power Time Constant";
7+
parameter Modelica.Units.SI.Time T3 "Turbine Exhaust Temperature Time Constant";
8+
parameter OpenIPSL.Types.PerUnit K "Governor Gain";
9+
parameter Modelica.Units.SI.Time T4 "Governor Lead Time Constant";
10+
parameter Modelica.Units.SI.Time T5 "Governor Lag Time Constant";
11+
parameter Modelica.Units.SI.Time T6 "Actuator Time Constant";
12+
parameter Modelica.Units.SI.Time TD "Engine Time Delay";
13+
parameter OpenIPSL.Types.PerUnit TMAX "Upper Limit";
14+
parameter OpenIPSL.Types.PerUnit TMIN "Lower Limit";
15+
16+
17+
Modelica.Blocks.Continuous.TransferFunction transferFunction(b={-T3,-1}, a={
18+
T2*T1,T1,1},
19+
initType=Modelica.Blocks.Types.Init.InitialOutput,
20+
y_start=0)
21+
annotation (Placement(transformation(extent={{-140,-10},{-120,10}})));
22+
Modelica.Blocks.Continuous.Integrator integrator(k=K, y_start=P0)
23+
annotation (Placement(transformation(extent={{-100,-10},{-80,10}})));
24+
NonElectrical.Continuous.LeadLag leadLag(
25+
K=1,
26+
T1=T4,
27+
T2=T5,
28+
y_start=P0)
29+
annotation (Placement(transformation(extent={{-60,-10},{-40,10}})));
30+
NonElectrical.Continuous.SimpleLagLim simpleLagLim(
31+
K=1,
32+
T=T6,
33+
y_start=P0,
34+
outMax=TMAX,
35+
outMin=TMIN)
36+
annotation (Placement(transformation(extent={{-20,-10},{0,10}})));
37+
Modelica.Blocks.Nonlinear.FixedDelay fixedDelay(delayTime=TD)
38+
annotation (Placement(transformation(extent={{20,-10},{40,10}})));
39+
Modelica.Blocks.Math.Product product1
40+
annotation (Placement(transformation(extent={{80,-10},{100,10}})));
41+
Modelica.Blocks.Math.Add add
42+
annotation (Placement(transformation(extent={{-80,-124},{-60,-104}})));
43+
Modelica.Blocks.Sources.Constant Constant(k=1)
44+
annotation (Placement(transformation(extent={{-140,-80},{-120,-60}})));
45+
46+
protected
47+
parameter Types.PerUnit P0(fixed=false) "Power reference of the governor";
48+
initial equation
49+
P0 = PMECH0;
50+
51+
equation
52+
connect(SPEED, transferFunction.u) annotation (Line(points={{-240,-120},{-180,
53+
-120},{-180,0},{-142,0}}, color={0,0,127}));
54+
connect(transferFunction.y, integrator.u)
55+
annotation (Line(points={{-119,0},{-102,0}}, color={0,0,127}));
56+
connect(integrator.y, leadLag.u)
57+
annotation (Line(points={{-79,0},{-62,0}}, color={0,0,127}));
58+
connect(leadLag.y, simpleLagLim.u)
59+
annotation (Line(points={{-39,0},{-22,0}}, color={0,0,127}));
60+
connect(simpleLagLim.y, fixedDelay.u)
61+
annotation (Line(points={{1,0},{18,0}}, color={0,0,127}));
62+
connect(fixedDelay.y, product1.u1)
63+
annotation (Line(points={{41,0},{60,0},{60,6},{78,6}}, color={0,0,127}));
64+
connect(Constant.y, add.u1) annotation (Line(points={{-119,-70},{-94,-70},{-94,
65+
-108},{-82,-108}}, color={0,0,127}));
66+
connect(add.u2, transferFunction.u) annotation (Line(points={{-82,-120},{-180,
67+
-120},{-180,0},{-142,0}}, color={0,0,127}));
68+
connect(add.y, product1.u2) annotation (Line(points={{-59,-114},{70,-114},{70,
69+
-6},{78,-6}}, color={0,0,127}));
70+
connect(product1.y, PMECH)
71+
annotation (Line(points={{101,0},{250,0}}, color={0,0,127}));
72+
annotation (Icon(graphics={
73+
Text(
74+
extent={{-100,160},{100,100}},
75+
lineColor={28,108,200},
76+
textString="DEGOV")}));
77+
end DEGOV;

OpenIPSL/Electrical/Controls/PSSE/TG/package.order

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
ConstantPower
2+
DEGOV
23
GAST
34
GGOV1
45
GGOV1DU

OpenIPSL/Electrical/Loads/PSSE/Load_variation.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ protected
88
parameter Real PF=if q0 <= C.eps then 1 else p0/q0 "Ration between active and reactive power; Not Power Factor";
99
parameter Types.PerUnit d_Q=(p0 + d_P)/PF - q0;
1010
equation
11-
if time >= t1 and time <= t1 + d_t then
11+
if time >= t1 and time < t1 + d_t then
1212
kI*S_I.re*v + S_Y.re*v^2 + kP*(S_P.re + d_P) = p.vr*p.ir + p.vi*p.ii;
1313
kI*S_I.im*v + S_Y.im*v^2 + kP*(S_P.im + d_Q) = (-p.vr*p.ii) + p.vi*p.ir;
1414
else
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
within OpenIPSL.Electrical.Machines.PSSE.BaseClasses;
2+
partial model baseMotor "Base model for the PSSE three-phase induction motor models"
3+
4+
parameter OpenIPSL.Types.ApparentPower M_b = 15e6 "Machine base power"
5+
annotation (Dialog(group="Power flow data"));
6+
extends OpenIPSL.Electrical.Essentials.pfComponent(
7+
final enabledisplayPF=false,
8+
final enablefn=false,
9+
final enableV_b=false,
10+
final enableangle_0=false,
11+
final enablev_0=false,
12+
final enableQ_0=false,
13+
final enableP_0=false,
14+
final enableS_b=true);
15+
16+
import OpenIPSL.NonElectrical.Functions.SE;
17+
18+
parameter Boolean Sup = true "True: Start-up process, False: Steady-state condition" annotation (Dialog(group="Motor Setup"));
19+
parameter Boolean Ctrl = true "True: Model for VSD control, False: Model not controllable"
20+
annotation (Dialog(group="Motor Setup"));
21+
parameter Real N = 1 "Number of pair of Poles"
22+
annotation (Dialog(group="Machine parameters"));
23+
parameter Modelica.Units.SI.Time H = 0.4 "Inertia constant"
24+
annotation (Dialog(group="Machine parameters"));
25+
26+
OpenIPSL.Types.PerUnit v "Bus voltage magnitude";
27+
OpenIPSL.Types.Angle anglev "Bus voltage angle";
28+
OpenIPSL.Types.Angle delta "Bus voltage angle";
29+
OpenIPSL.Types.PerUnit s "Induction motor slip";
30+
OpenIPSL.Types.PerUnit P "Active power";
31+
OpenIPSL.Types.PerUnit Q "Reactive power";
32+
Modelica.Units.SI.AngularVelocity nr "Rotor speed";
33+
Modelica.Units.SI.AngularVelocity ns "Synchronous speed";
34+
Modelica.Units.SI.AngularVelocity w_sync "Controllable synchronous speed";
35+
OpenIPSL.Types.PerUnit P_motor "Active power in motor base power";
36+
OpenIPSL.Types.PerUnit Q_motor "Reactive power in motor base power";
37+
OpenIPSL.Types.PerUnit Vr "Real part of terminal voltage";
38+
OpenIPSL.Types.PerUnit Vi "Imaginary part of terminal voltage";
39+
OpenIPSL.Types.PerUnit Ir "Real part of terminal current";
40+
OpenIPSL.Types.PerUnit Ii "Imaginary part of terminal current";
41+
OpenIPSL.Types.PerUnit Imag "Terminal current magnitude";
42+
OpenIPSL.Types.PerUnit Te_motor "Electromagnetic torque in motor base";
43+
OpenIPSL.Types.PerUnit Te_sys "Electromagnetic torque in system base";
44+
45+
Modelica.Blocks.Math.Gain we_fix(k=1) "Necessary gain for controllable synchronous speed functionality"
46+
annotation (Placement(transformation(extent={{80,-88},{90,-78}})));
47+
Modelica.Blocks.Sources.Constant we_source_fix(k=0)
48+
if not Ctrl "Necessary source for controllable synchrnous speed functionality"
49+
annotation (Placement(transformation(extent={{32,-86},{44,-74}})));
50+
OpenIPSL.Interfaces.PwPin p(
51+
vr(start=vr0),
52+
vi(start=vi0),
53+
ir(start=ir0_sys),
54+
ii(start=ii0_sys))
55+
annotation (Placement(transformation(extent={{90,-10},{110,10}})));
56+
Modelica.Blocks.Interfaces.RealOutput wr
57+
"Absolute angular velocity of flange as output signal (rad/s)"
58+
annotation (Placement(transformation(extent={{-100,-10},{-120,10}}),
59+
iconTransformation(
60+
extent={{20,-20},{-20,20}},
61+
rotation=90,
62+
origin={60,-120})));
63+
Modelica.Blocks.Interfaces.RealInput we if Ctrl "Input for controllable synchronous speed functionality (rad/s)" annotation (Placement(
64+
transformation(
65+
extent={{-20,-20},{20,20}},
66+
rotation=90,
67+
origin={60,-120}), iconTransformation(
68+
extent={{-20,-20},{20,20}},
69+
rotation=90,
70+
origin={-60,-120})));
71+
72+
protected
73+
parameter OpenIPSL.Types.PerUnit p0 = P_0/M_b "Initial active power";
74+
parameter OpenIPSL.Types.PerUnit q0 = Q_0/M_b "Initial reactive power";
75+
parameter Modelica.Units.SI.AngularVelocity w_b=2*C.pi*fn/N "Base freq in rad/s";
76+
parameter OpenIPSL.Types.PerUnit vr0=v_0*cos(angle_0) "Initial real voltage";
77+
parameter OpenIPSL.Types.PerUnit vi0=v_0*sin(angle_0) "Initial imaginary voltage";
78+
parameter OpenIPSL.Types.PerUnit ir0=(p0*vr0 + q0*vi0)/(vr0^2 + vi0^2) "Initial real current in motor base";
79+
parameter OpenIPSL.Types.PerUnit ii0=(p0*vi0 - q0*vr0)/(vr0^2 + vi0^2) "Initial real current in motor base";
80+
parameter OpenIPSL.Types.PerUnit ir0_sys = CoB*ir0 "Initial real current in system base";
81+
parameter OpenIPSL.Types.PerUnit ii0_sys = CoB*ii0 "Initial imaginary current in system base";
82+
parameter Real CoB = M_b/S_b "Change of base";
83+
equation
84+
connect(we,we_fix. u)
85+
annotation (Line(points={{60,-120},{60,-83},{79,-83}}, color={0,0,127}));
86+
connect(we_source_fix.y,we_fix. u)
87+
annotation (Line(points={{44.6,-80},{70,-80},{70,-83},{79,-83}},
88+
color={0,0,127}));
89+
90+
w_sync = (if Ctrl == true then we_fix.y else w_b);
91+
[Vr; Vi] = [p.vr; p.vi];
92+
[Ir; Ii] = (1/CoB)*[p.ir; p.ii];
93+
Imag = sqrt(Ir^2 + Ii^2);
94+
v = sqrt(p.vr^2 + p.vi^2);
95+
anglev = atan2(p.vi, p.vr);
96+
delta = anglev;
97+
//P = if Ctrl == true then (p.vr*p.ir + p.vi*p.ii)*(we_fix.y/w_b) else (p.vr*p.ir + p.vi*p.ii);
98+
//Q = if Ctrl == true then ((-p.vr*p.ii) + p.vi*p.ir)*(we_fix.y/w_b) else ((-p.vr*p.ii) + p.vi*p.ir);
99+
//P = (p.vr*p.ir + p.vi*p.ii);
100+
P = if Ctrl == true then Te_sys*nr/w_b else Te_sys;
101+
Q = (-p.vr*p.ii) + p.vi*p.ir;
102+
103+
P_motor = P/CoB;
104+
Q_motor = Q/CoB;
105+
ns = w_sync/N;
106+
nr = (1-s)*ns;
107+
wr = nr;
108+
109+
annotation (preferredView = "info",Icon(graphics={
110+
Rectangle(extent={{-100,100},{100,-100}}, lineColor={28,108,200}),
111+
Ellipse(
112+
fillColor={255,255,255},
113+
extent={{-56,-58},{55.932,54}}), Text(
114+
extent={{-50,48},{50,-52}},
115+
lineColor={0,0,0},
116+
textString="M"),Text(
117+
origin={0,-80},
118+
extent={{-100,-20},{100,20}},
119+
fontName="Arial",
120+
lineColor={0,0,0},
121+
textString="%name")}),
122+
Documentation(info="<html>
123+
<p>
124+
This component is the base class for the PSSE induction motor models from the Machines.PSSE sub-package.
125+
</p>
126+
</html>"));
127+
end baseMotor;

0 commit comments

Comments
 (0)