1 # Copyright (C) 2010 Richard Lincoln
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA, USA
17 from CIM14
.Dynamics
.RotatingMachine
import RotatingMachine
19 class SynchronousMachine(RotatingMachine
):
20 """An electromechanical device that operates synchronously with the network. It is a single machine operating either as a generator or synchronous condenser or pump.
23 def __init__(self
, operatingMode
="condenser", type="generator_or_condenser", coolantType
="air", xQuadTrans
=0.0, condenserP
=0.0, referencePriority
=0, damping
=0.0, x0
=0.0, r2
=0.0, minQ
=0.0, xDirectSync
=0.0, maxQ
=0.0, r0
=0.0, aVRToManualLead
=0.0, x
=0.0, inertia
=0.0, coolantCondition
=0.0, manualToAVR
=0.0, r
=0.0, maxU
=0.0, xQuadSync
=0.0, qPercent
=0.0, xQuadSubtrans
=0.0, minU
=0.0, aVRToManualLag
=0.0, baseQ
=0.0, xDirectTrans
=0.0, x2
=0.0, xDirectSubtrans
=0.0, genLoad0
=None, HydroPump
=None, GeneratingUnit
=None, govHydro10
=None, PrimeMovers
=None, InitialReactiveCapabilityCurve
=None, genEquiv0
=None, ReactiveCapabilityCurves
=None, *args
, **kw_args
):
24 """Initialises a new 'SynchronousMachine' instance.
26 @param operatingMode: Current mode of operation. Values are: "condenser", "generator"
27 @param type: Modes that this synchronous machine can operate in. Values are: "generator_or_condenser", "generator", "condenser"
28 @param coolantType: Method of cooling the machine. Values are: "air", "hydrogenGas", "water"
29 @param xQuadTrans: Quadrature-axis transient reactance, also known as X'q.
30 @param condenserP: Active power consumed when in condenser mode operation.
31 @param referencePriority: Priority of unit for reference bus selection. 0 = don t care (default) 1 = highest priority. 2 is less than 1 and so on.
32 @param damping: Damping torque coefficient, a proportionality constant that, when multiplied by the angular velocity of the rotor poles with respect to the magnetic field (frequency), results in the damping torque.
33 @param x0: Zero sequence reactance of the synchronous machine.
34 @param r2: Negative sequence resistance.
35 @param minQ: Minimum reactive power limit for the unit.
36 @param xDirectSync: Direct-axis synchronous reactance. The quotient of a sustained value of that AC component of armature voltage that is produced by the total direct-axis flux due to direct-axis armature current and the value of the AC component of this current, the machine running at rated speed. (Xd)
37 @param maxQ: Maximum reactive power limit. This is the maximum (nameplate) limit for the unit.
38 @param r0: Zero sequence resistance of the synchronous machine.
39 @param aVRToManualLead: Time delay required when switching from Automatic Voltage Regulation (AVR) to Manual for a leading MVAr violation.
40 @param x: Positive sequence reactance of the synchronous machine.
41 @param inertia: The energy stored in the rotor when operating at rated speed. This value is used in the accelerating power reference frame for operator training simulator solutions.
42 @param coolantCondition: Temperature or pressure of coolant medium
43 @param manualToAVR: Time delay required when switching from Manual to Automatic Voltage Regulation. This value is used in the accelerating power reference frame for powerflow solutions
44 @param r: Positive sequence resistance of the synchronous machine.
45 @param maxU: Maximum voltage limit for the unit.
46 @param xQuadSync: Quadrature-axis synchronous reactance (Xq) , the ratio of the component of reactive armature voltage, due to the quadrature-axis component of armature current, to this component of current, under steady state conditions and at rated frequency.
47 @param qPercent: Percent of the coordinated reactive control that comes from this machine.
48 @param xQuadSubtrans: Quadrature-axis subtransient reactance, also known as X'q.
49 @param minU: Minimum voltage limit for the unit.
50 @param aVRToManualLag: Time delay required when switching from Automatic Voltage Regulation (AVR) to Manual for a lagging MVAr violation.
51 @param baseQ: Default base reactive power value. This value represents the initial reactive power that can be used by any application function.
52 @param xDirectTrans: Direct-axis transient reactance, also known as X'd.
53 @param x2: Negative sequence reactance.
54 @param xDirectSubtrans: Direct-axis subtransient reactance, also known as X'd.
56 @param HydroPump: The synchronous machine drives the turbine which moves the water from a low elevation to a higher elevation. The direction of machine rotation for pumping may or may not be the same as for generating.
57 @param GeneratingUnit: A synchronous machine may operate as a generator and as such becomes a member of a generating unit
59 @param PrimeMovers: Prime movers that drive this SynchronousMachine.
60 @param InitialReactiveCapabilityCurve: The default ReactiveCapabilityCurve for use by a SynchronousMachine
62 @param ReactiveCapabilityCurves: All available Reactive capability curves for this SynchronousMachine.
64 #: Current mode of operation. Values are: "condenser", "generator"
65 self
.operatingMode
= operatingMode
67 #: Modes that this synchronous machine can operate in. Values are: "generator_or_condenser", "generator", "condenser"
70 #: Method of cooling the machine. Values are: "air", "hydrogenGas", "water"
71 self
.coolantType
= coolantType
73 #: Quadrature-axis transient reactance, also known as X'q.
74 self
.xQuadTrans
= xQuadTrans
76 #: Active power consumed when in condenser mode operation.
77 self
.condenserP
= condenserP
79 #: Priority of unit for reference bus selection. 0 = don t care (default) 1 = highest priority. 2 is less than 1 and so on.
80 self
.referencePriority
= referencePriority
82 #: Damping torque coefficient, a proportionality constant that, when multiplied by the angular velocity of the rotor poles with respect to the magnetic field (frequency), results in the damping torque.
83 self
.damping
= damping
85 #: Zero sequence reactance of the synchronous machine.
88 #: Negative sequence resistance.
91 #: Minimum reactive power limit for the unit.
94 #: Direct-axis synchronous reactance. The quotient of a sustained value of that AC component of armature voltage that is produced by the total direct-axis flux due to direct-axis armature current and the value of the AC component of this current, the machine running at rated speed. (Xd)
95 self
.xDirectSync
= xDirectSync
97 #: Maximum reactive power limit. This is the maximum (nameplate) limit for the unit.
100 #: Zero sequence resistance of the synchronous machine.
103 #: Time delay required when switching from Automatic Voltage Regulation (AVR) to Manual for a leading MVAr violation.
104 self
.aVRToManualLead
= aVRToManualLead
106 #: Positive sequence reactance of the synchronous machine.
109 #: The energy stored in the rotor when operating at rated speed. This value is used in the accelerating power reference frame for operator training simulator solutions.
110 self
.inertia
= inertia
112 #: Temperature or pressure of coolant medium
113 self
.coolantCondition
= coolantCondition
115 #: Time delay required when switching from Manual to Automatic Voltage Regulation. This value is used in the accelerating power reference frame for powerflow solutions
116 self
.manualToAVR
= manualToAVR
118 #: Positive sequence resistance of the synchronous machine.
121 #: Maximum voltage limit for the unit.
124 #: Quadrature-axis synchronous reactance (Xq) , the ratio of the component of reactive armature voltage, due to the quadrature-axis component of armature current, to this component of current, under steady state conditions and at rated frequency.
125 self
.xQuadSync
= xQuadSync
127 #: Percent of the coordinated reactive control that comes from this machine.
128 self
.qPercent
= qPercent
130 #: Quadrature-axis subtransient reactance, also known as X'q.
131 self
.xQuadSubtrans
= xQuadSubtrans
133 #: Minimum voltage limit for the unit.
136 #: Time delay required when switching from Automatic Voltage Regulation (AVR) to Manual for a lagging MVAr violation.
137 self
.aVRToManualLag
= aVRToManualLag
139 #: Default base reactive power value. This value represents the initial reactive power that can be used by any application function.
142 #: Direct-axis transient reactance, also known as X'd.
143 self
.xDirectTrans
= xDirectTrans
145 #: Negative sequence reactance.
148 #: Direct-axis subtransient reactance, also known as X'd.
149 self
.xDirectSubtrans
= xDirectSubtrans
152 self
.genLoad0
= [] if genLoad0
is None else genLoad0
154 self
._HydroPump
= None
155 self
.HydroPump
= HydroPump
157 self
._GeneratingUnit
= None
158 self
.GeneratingUnit
= GeneratingUnit
160 self
._govHydro
10 = []
161 self
.govHydro10
= [] if govHydro10
is None else govHydro10
163 self
._PrimeMovers
= []
164 self
.PrimeMovers
= [] if PrimeMovers
is None else PrimeMovers
166 self
._InitialReactiveCapabilityCurve
= None
167 self
.InitialReactiveCapabilityCurve
= InitialReactiveCapabilityCurve
170 self
.genEquiv0
= [] if genEquiv0
is None else genEquiv0
172 self
._ReactiveCapabilityCurves
= []
173 self
.ReactiveCapabilityCurves
= [] if ReactiveCapabilityCurves
is None else ReactiveCapabilityCurves
175 super(SynchronousMachine
, self
).__init
__(*args
, **kw_args
)
177 _attrs
= ["operatingMode", "type", "coolantType", "xQuadTrans", "condenserP", "referencePriority", "damping", "x0", "r2", "minQ", "xDirectSync", "maxQ", "r0", "aVRToManualLead", "x", "inertia", "coolantCondition", "manualToAVR", "r", "maxU", "xQuadSync", "qPercent", "xQuadSubtrans", "minU", "aVRToManualLag", "baseQ", "xDirectTrans", "x2", "xDirectSubtrans"]
178 _attr_types
= {"operatingMode": str, "type": str, "coolantType": str, "xQuadTrans": float, "condenserP": float, "referencePriority": int, "damping": float, "x0": float, "r2": float, "minQ": float, "xDirectSync": float, "maxQ": float, "r0": float, "aVRToManualLead": float, "x": float, "inertia": float, "coolantCondition": float, "manualToAVR": float, "r": float, "maxU": float, "xQuadSync": float, "qPercent": float, "xQuadSubtrans": float, "minU": float, "aVRToManualLag": float, "baseQ": float, "xDirectTrans": float, "x2": float, "xDirectSubtrans": float}
179 _defaults
= {"operatingMode": "condenser", "type": "generator_or_condenser", "coolantType": "air", "xQuadTrans": 0.0, "condenserP": 0.0, "referencePriority": 0, "damping": 0.0, "x0": 0.0, "r2": 0.0, "minQ": 0.0, "xDirectSync": 0.0, "maxQ": 0.0, "r0": 0.0, "aVRToManualLead": 0.0, "x": 0.0, "inertia": 0.0, "coolantCondition": 0.0, "manualToAVR": 0.0, "r": 0.0, "maxU": 0.0, "xQuadSync": 0.0, "qPercent": 0.0, "xQuadSubtrans": 0.0, "minU": 0.0, "aVRToManualLag": 0.0, "baseQ": 0.0, "xDirectTrans": 0.0, "x2": 0.0, "xDirectSubtrans": 0.0}
180 _enums
= {"operatingMode": "SynchronousMachineOperatingMode", "type": "SynchronousMachineType", "coolantType": "CoolantType"}
181 _refs
= ["genLoad0", "HydroPump", "GeneratingUnit", "govHydro10", "PrimeMovers", "InitialReactiveCapabilityCurve", "genEquiv0", "ReactiveCapabilityCurves"]
182 _many_refs
= ["genLoad0", "govHydro10", "PrimeMovers", "genEquiv0", "ReactiveCapabilityCurves"]
184 def getgenLoad0(self
):
186 return self
._genLoad
0
188 def setgenLoad0(self
, value
):
189 for p
in self
._genLoad
0:
190 filtered
= [q
for q
in p
.synchronousMachine0
if q
!= self
]
191 self
._genLoad
0._synchronousMachine
0 = filtered
193 if self
not in r
._synchronousMachine
0:
194 r
._synchronousMachine
0.append(self
)
195 self
._genLoad
0 = value
197 genLoad0
= property(getgenLoad0
, setgenLoad0
)
199 def addgenLoad0(self
, *genLoad0
):
201 if self
not in obj
._synchronousMachine
0:
202 obj
._synchronousMachine
0.append(self
)
203 self
._genLoad
0.append(obj
)
205 def removegenLoad0(self
, *genLoad0
):
207 if self
in obj
._synchronousMachine
0:
208 obj
._synchronousMachine
0.remove(self
)
209 self
._genLoad
0.remove(obj
)
211 def getHydroPump(self
):
212 """The synchronous machine drives the turbine which moves the water from a low elevation to a higher elevation. The direction of machine rotation for pumping may or may not be the same as for generating.
214 return self
._HydroPump
216 def setHydroPump(self
, value
):
217 if self
._HydroPump
is not None:
218 self
._HydroPump
._SynchronousMachine
= None
220 self
._HydroPump
= value
221 if self
._HydroPump
is not None:
222 self
._HydroPump
._SynchronousMachine
= self
224 HydroPump
= property(getHydroPump
, setHydroPump
)
226 def getGeneratingUnit(self
):
227 """A synchronous machine may operate as a generator and as such becomes a member of a generating unit
229 return self
._GeneratingUnit
231 def setGeneratingUnit(self
, value
):
232 if self
._GeneratingUnit
is not None:
233 filtered
= [x
for x
in self
.GeneratingUnit
.SynchronousMachines
if x
!= self
]
234 self
._GeneratingUnit
._SynchronousMachines
= filtered
236 self
._GeneratingUnit
= value
237 if self
._GeneratingUnit
is not None:
238 self
._GeneratingUnit
._SynchronousMachines
.append(self
)
240 GeneratingUnit
= property(getGeneratingUnit
, setGeneratingUnit
)
242 def getgovHydro10(self
):
244 return self
._govHydro
10
246 def setgovHydro10(self
, value
):
247 for p
in self
._govHydro
10:
248 filtered
= [q
for q
in p
.synchronousMachine0
if q
!= self
]
249 self
._govHydro
10._synchronousMachine
0 = filtered
251 if self
not in r
._synchronousMachine
0:
252 r
._synchronousMachine
0.append(self
)
253 self
._govHydro
10 = value
255 govHydro10
= property(getgovHydro10
, setgovHydro10
)
257 def addgovHydro10(self
, *govHydro10
):
258 for obj
in govHydro10
:
259 if self
not in obj
._synchronousMachine
0:
260 obj
._synchronousMachine
0.append(self
)
261 self
._govHydro
10.append(obj
)
263 def removegovHydro10(self
, *govHydro10
):
264 for obj
in govHydro10
:
265 if self
in obj
._synchronousMachine
0:
266 obj
._synchronousMachine
0.remove(self
)
267 self
._govHydro
10.remove(obj
)
269 def getPrimeMovers(self
):
270 """Prime movers that drive this SynchronousMachine.
272 return self
._PrimeMovers
274 def setPrimeMovers(self
, value
):
275 for p
in self
._PrimeMovers
:
276 filtered
= [q
for q
in p
.SynchronousMachines
if q
!= self
]
277 self
._PrimeMovers
._SynchronousMachines
= filtered
279 if self
not in r
._SynchronousMachines
:
280 r
._SynchronousMachines
.append(self
)
281 self
._PrimeMovers
= value
283 PrimeMovers
= property(getPrimeMovers
, setPrimeMovers
)
285 def addPrimeMovers(self
, *PrimeMovers
):
286 for obj
in PrimeMovers
:
287 if self
not in obj
._SynchronousMachines
:
288 obj
._SynchronousMachines
.append(self
)
289 self
._PrimeMovers
.append(obj
)
291 def removePrimeMovers(self
, *PrimeMovers
):
292 for obj
in PrimeMovers
:
293 if self
in obj
._SynchronousMachines
:
294 obj
._SynchronousMachines
.remove(self
)
295 self
._PrimeMovers
.remove(obj
)
297 def getInitialReactiveCapabilityCurve(self
):
298 """The default ReactiveCapabilityCurve for use by a SynchronousMachine
300 return self
._InitialReactiveCapabilityCurve
302 def setInitialReactiveCapabilityCurve(self
, value
):
303 if self
._InitialReactiveCapabilityCurve
is not None:
304 filtered
= [x
for x
in self
.InitialReactiveCapabilityCurve
.InitiallyUsedBySynchronousMachines
if x
!= self
]
305 self
._InitialReactiveCapabilityCurve
._InitiallyUsedBySynchronousMachines
= filtered
307 self
._InitialReactiveCapabilityCurve
= value
308 if self
._InitialReactiveCapabilityCurve
is not None:
309 self
._InitialReactiveCapabilityCurve
._InitiallyUsedBySynchronousMachines
.append(self
)
311 InitialReactiveCapabilityCurve
= property(getInitialReactiveCapabilityCurve
, setInitialReactiveCapabilityCurve
)
313 def getgenEquiv0(self
):
315 return self
._genEquiv
0
317 def setgenEquiv0(self
, value
):
318 for p
in self
._genEquiv
0:
319 filtered
= [q
for q
in p
.synchronousMachine0
if q
!= self
]
320 self
._genEquiv
0._synchronousMachine
0 = filtered
322 if self
not in r
._synchronousMachine
0:
323 r
._synchronousMachine
0.append(self
)
324 self
._genEquiv
0 = value
326 genEquiv0
= property(getgenEquiv0
, setgenEquiv0
)
328 def addgenEquiv0(self
, *genEquiv0
):
329 for obj
in genEquiv0
:
330 if self
not in obj
._synchronousMachine
0:
331 obj
._synchronousMachine
0.append(self
)
332 self
._genEquiv
0.append(obj
)
334 def removegenEquiv0(self
, *genEquiv0
):
335 for obj
in genEquiv0
:
336 if self
in obj
._synchronousMachine
0:
337 obj
._synchronousMachine
0.remove(self
)
338 self
._genEquiv
0.remove(obj
)
340 def getReactiveCapabilityCurves(self
):
341 """All available Reactive capability curves for this SynchronousMachine.
343 return self
._ReactiveCapabilityCurves
345 def setReactiveCapabilityCurves(self
, value
):
346 for p
in self
._ReactiveCapabilityCurves
:
347 filtered
= [q
for q
in p
.SynchronousMachines
if q
!= self
]
348 self
._ReactiveCapabilityCurves
._SynchronousMachines
= filtered
350 if self
not in r
._SynchronousMachines
:
351 r
._SynchronousMachines
.append(self
)
352 self
._ReactiveCapabilityCurves
= value
354 ReactiveCapabilityCurves
= property(getReactiveCapabilityCurves
, setReactiveCapabilityCurves
)
356 def addReactiveCapabilityCurves(self
, *ReactiveCapabilityCurves
):
357 for obj
in ReactiveCapabilityCurves
:
358 if self
not in obj
._SynchronousMachines
:
359 obj
._SynchronousMachines
.append(self
)
360 self
._ReactiveCapabilityCurves
.append(obj
)
362 def removeReactiveCapabilityCurves(self
, *ReactiveCapabilityCurves
):
363 for obj
in ReactiveCapabilityCurves
:
364 if self
in obj
._SynchronousMachines
:
365 obj
._SynchronousMachines
.remove(self
)
366 self
._ReactiveCapabilityCurves
.remove(obj
)