1
1
within PowerSystems.Examples.Network;
2
- model NetworkControlled
3
- "see Oeding, Oswald: Elektrische Kraftwerke und Netze, section 14.2.6: Leistungsfluss in Ringnetzen"
2
+ model NetworkControlled "Dynamic power flow calculation with two generators"
4
3
extends Modelica.Icons.Example;
5
4
6
5
PowerSystems.Generic.Impedance impedance1(R= 2 , L= 0 )
@@ -49,37 +48,38 @@ model NetworkControlled
49
48
origin={50,30},
50
49
extent={{-10,-10},{10,10}},
51
50
rotation=270)));
52
- PowerSystems.Generic.EMF eMF annotation (Placement(transformation(
53
- extent={{-30,70},{-10,90}}, rotation=0)));
54
- Modelica.Mechanics.Rotational.Components.Inertia inertia(
55
- J= 1e3 , w(start= 2 * pi* 50 ))
56
- annotation (Placement(transformation(extent={{-60,70},{-40,90}},
57
- rotation=0)));
58
- PowerSystems.Generic.EMF eMF1
59
- annotation (Placement(transformation(extent={
60
- {70,70},{90,90}}, rotation=0)));
51
+ PowerSystems.Generic.Generator generator1 annotation (Placement(
52
+ transformation(extent={{-30,70},{-10,90}}, rotation=0)));
61
53
Modelica.Mechanics.Rotational.Components.Inertia inertia1(
62
- J= 1e3 , w(start= 2 * pi* 50 ))
54
+ J= 1e3 ,
55
+ w(start= system.w_nom/ generator1.pp),
56
+ a(start= 0 )) annotation (Placement(transformation(extent={{-60,
57
+ 70},{-40,90}}, rotation=0)));
58
+ PowerSystems.Generic.Generator generator2(pp= 8 ) annotation (Placement(
59
+ transformation(extent={{70,70},{90,90}}, rotation=0)));
60
+ Modelica.Mechanics.Rotational.Components.Inertia inertia2(
61
+ J= 1e3 ,
62
+ w(start= system.w_nom/ generator2.pp),
63
+ a(start= 0 ))
63
64
annotation (Placement(transformation(extent={{40,70},{60,90}}, rotation=
64
65
0)));
65
- Modelica.Mechanics.Rotational.Sources.Torque torque(useSupport= false )
66
- annotation (Placement(transformation(extent={{-90,70},{-70,90}},
67
- rotation=0)));
66
+ Modelica.Mechanics.Rotational.Sources.Torque turbine1(useSupport= false )
67
+ annotation (Placement(transformation(extent={{-90,70},{-70,90}}, rotation=0)));
68
68
Modelica.Mechanics.Rotational.Sensors.SpeedSensor angularVelocity
69
69
annotation (Placement(transformation(extent={{-50,110},{-70,130}},
70
70
rotation=0)));
71
- Modelica.Mechanics.Rotational.Sources.Torque torque1(useSupport= false )
72
- annotation (Placement(transformation(extent={{10,70},{30,90}}, rotation=
73
- 0)));
71
+ Modelica.Mechanics.Rotational.Sources.Torque turbine2(useSupport= false )
72
+ annotation (Placement(transformation(extent={{10,70},{30,90}}, rotation=0)));
74
73
Modelica.Blocks.Sources.Trapezoid disturbance(
75
74
width= 30 ,
76
- amplitude= 2e4 ,
77
- offset= 2e4 ,
78
75
rising= 0 ,
79
76
falling= 0 ,
80
- period= 60 ) annotation (Placement(transformation(extent={{30,110},{10,
77
+ period= 60 ,
78
+ amplitude= 2e3 ,
79
+ offset= 2e3 )
80
+ annotation (Placement(transformation(extent={{30,110},{10,
81
81
130}}, rotation=0)));
82
- Modelica.Blocks.Sources.Constant const(k= 50 )
82
+ Modelica.Blocks.Sources.Constant const(k= system.f_nom )
83
83
annotation (Placement(transformation(extent={{-160,70},{-140,90}},
84
84
rotation=0)));
85
85
Modelica.Blocks.Continuous.LimPID frequencyPowerControl(
@@ -92,6 +92,20 @@ model NetworkControlled
92
92
rotation=0)));
93
93
Modelica.Blocks.Math.Gain frequency(k= 1 / (2 * pi))
94
94
annotation (Placement(transformation(extent={{-80,110},{-100,130}})));
95
+ inner System system( fType_par= false )
96
+ annotation (Placement(transformation(extent={{-170,110},{-150,130}})));
97
+ Interfaces.Sender sender1(H= 0.5 * inertia1.J* inertia1.w^ 2 / 1e6 , w= generator1.w)
98
+ annotation (Placement(transformation(extent={{-26,100},{-14,112}})));
99
+ Interfaces.Sender sender2(H= 0.5 * inertia2.J* inertia2.w^ 2 / 1e6 , w= generator2.w)
100
+ annotation (Placement(transformation(extent={{74,100},{86,112}})));
101
+ initial equation
102
+ if system.steadyIni then
103
+ inertia1.a = 0 ;
104
+ else
105
+ inertia1.w = system.omega/ generator1.pp;
106
+ end if ;
107
+ inertia1.phi = system.theta/ generator1.pp;
108
+
95
109
equation
96
110
connect (impedance1.terminal_n, impedance2.terminal_p)
97
111
annotation (Line(points={{-50,-20},{-50,-40}}, color={0,120,120}));
@@ -113,27 +127,24 @@ equation
113
127
annotation (Line(points={{-50,20},{-50,0}}, color={0,120,120}));
114
128
connect (transformer2.terminal_n, impedance5.terminal_p)
115
129
annotation (Line(points={{50,20},{50,0}}, color={0,120,120}));
116
- connect (inertia .flange_b, eMF .flange) annotation (Line(points={{-40,80},{
117
- -30,80}}, color={0,0,0}));
118
- connect (eMF .terminal , transformer1.terminal_p) annotation (Line(points={{
119
- -10,80},{-10,60},{-50,60},{-50,40}}, color={0,120,120}));
120
- connect (inertia1 .flange_b, eMF1 .flange) annotation (Line(points={{60,80},
121
- {70,80}}, color={0,0,0}));
122
- connect (eMF1 .terminal , transformer2.terminal_p) annotation (Line(points={
123
- {90,80},{90,60},{50,60},{50,40}}, color={0,120,120}));
124
- connect (torque .flange, inertia .flange_a)
130
+ connect (inertia1 .flange_b, generator1 .flange)
131
+ annotation (Line(points={{-40,80},{ -30,80}}, color={0,0,0}));
132
+ connect (generator1 .terminal , transformer1.terminal_p) annotation (Line(points=
133
+ {{ -10,80},{-10,60},{-50,60},{-50,40}}, color={0,120,120}));
134
+ connect (inertia2 .flange_b, generator2 .flange)
135
+ annotation (Line(points={{60,80}, {70,80}}, color={0,0,0}));
136
+ connect (generator2 .terminal , transformer2.terminal_p) annotation (Line(points=
137
+ { {90,80},{90,60},{50,60},{50,40}}, color={0,120,120}));
138
+ connect (turbine1 .flange, inertia1 .flange_a)
125
139
annotation (Line(points={{-70,80},{-60,80}}, color={0,0,0}));
126
- connect (torque1 .flange, inertia1 .flange_a)
140
+ connect (turbine2 .flange, inertia2 .flange_a)
127
141
annotation (Line(points={{30,80},{40,80}}, color={0,0,0}));
128
- connect (disturbance.y, torque1.tau)
129
- annotation (Line(points={{9,120},{0,120},
130
- {0,80},{8,80}}, color={0,0,127}));
131
- connect (angularVelocity.flange, inertia.flange_b)
132
- annotation (Line(points={{-50,120},
133
- {-40,120},{-40,80}}, color={0,0,0}));
134
- connect (frequencyPowerControl.y, torque.tau)
135
- annotation (Line(points={{-99,80},{-92,80}},
136
- color={0,0,127}));
142
+ connect (disturbance.y, turbine2.tau)
143
+ annotation (Line(points={{9,120},{0,120},{0,80},{8,80}}, color={0,0,127}));
144
+ connect (angularVelocity.flange, inertia1.flange_b)
145
+ annotation (Line(points={{-50,120},{-40,120},{-40,80}}, color={0,0,0}));
146
+ connect (frequencyPowerControl.y, turbine1.tau)
147
+ annotation (Line(points={{-99,80},{-92,80}}, color={0,0,127}));
137
148
connect (const.y, frequencyPowerControl.u_s) annotation (Line(
138
149
points={{-139,80},{-122,80}},
139
150
color={0,0,127},
@@ -146,8 +157,23 @@ equation
146
157
points={{-101,120},{-110,120},{-110,92}},
147
158
color={0,0,127},
148
159
smooth=Smooth.None));
149
- annotation (Diagram(coordinateSystem(
150
- preserveAspectRatio=true,
160
+ connect (system.receiveFreq, sender1.sendFreq) annotation (Line(
161
+ points={{-168,128},{-168,138},{-20,138},{-20,104.08}},
162
+ color={120,0,120},
163
+ smooth=Smooth.None));
164
+ connect (system.receiveFreq, sender2.sendFreq) annotation (Line(
165
+ points={{-168,128},{-168,138},{80,138},{80,104.08}},
166
+ color={120,0,120},
167
+ smooth=Smooth.None));
168
+ annotation (Documentation(info="<html>
169
+ <p>The fixed voltage sources of NetworkOpened have been replaced with generators.
170
+ Generator1 provides for primary frequency control, while generator2 introduces fluctuations.</p>
171
+ <p>Note the computation of the average sytem frequency in the global system model, basing on senders for
172
+ each generator. This is needed for initialization (see initial equations in
173
+ the text view). The initialization of the simulation corresponds to a black start in the real world.</p>
174
+ <p>The remainder of the PowerFlow library hides this mechanism in the composed generator or plant models.</p>
175
+ </html>" ), Diagram(coordinateSystem(
176
+ preserveAspectRatio=false,
151
177
extent={{-180,-100},{100,140}},
152
178
initialScale=0.1), graphics),
153
179
experiment(StopTime=120));
0 commit comments