1 # Copyright (C) 2010-2011 Richard Lincoln
3 # Permission is hereby granted, free of charge, to any person obtaining a copy
4 # of this software and associated documentation files (the "Software"), to
5 # deal in the Software without restriction, including without limitation the
6 # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7 # sell copies of the Software, and to permit persons to whom the Software is
8 # furnished to do so, subject to the following conditions:
10 # The above copyright notice and this permission notice shall be included in
11 # all copies or substantial portions of the Software.
13 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21 from CIM14
.IEC61970
.Wires
.RegulatingCondEq
import RegulatingCondEq
23 class RotatingMachine(RegulatingCondEq
):
24 """A rotating machine which may be used as a generator or motor.
27 def __init__(self
, parametersFormType
="timeConstantReactance", d
=0.0, rs
=0.0, h
=0.0, s12
=0.0, ratedS
=0.0, s1
=0.0, xls
=0.0, mechanicalLoad0
=None, *args
, **kw_args
):
28 """Initialises a new 'RotatingMachine' instance.
30 @param parametersFormType: Values are: "timeConstantReactance", "equivalentCircuit"
31 @param d: Damping torque coefficient. <b>D</b> represents a linearized approximation of damping torque effects. This value is often zero when the sources of damping torques (generator damper windings, load damping effects, etc.) are modeled in detail
32 @param rs: Stator (armature) resistance (>= 0.) - Equivalent resistance when used for GenEquiv model
33 @param h: Inertia constant of generator or motor and mechanical load (>0). <b>H</b> is the stored energy in the rotating mass. For a generator, this includes the <b>generator plus all other elements (turbine, exciter) on the same shaft</b> and has units of MW-sec. For a motor, it includes the motor plus its mechanical load. Conventional units are per unit on the generator MVA base, usually expressed as MW-sec./MVA or just sec.
34 @param s12: Saturation factor at 120% of rated term.voltage (>=S1)
35 @param ratedS: Nameplate apparent power rating for the unit
36 @param s1: Saturation factor at rated term. voltage (>= 0.)
37 @param xls: Stator leakage reactance (> 0.)
38 @param mechanicalLoad0:
40 #: Values are: "timeConstantReactance", "equivalentCircuit"
41 self
.parametersFormType
= parametersFormType
43 #: Damping torque coefficient. <b>D</b> represents a linearized approximation of damping torque effects. This value is often zero when the sources of damping torques (generator damper windings, load damping effects, etc.) are modeled in detail
46 #: Stator (armature) resistance (>= 0.) - Equivalent resistance when used for GenEquiv model
49 #: Inertia constant of generator or motor and mechanical load (>0). <b>H</b> is the stored energy in the rotating mass. For a generator, this includes the <b>generator plus all other elements (turbine, exciter) on the same shaft</b> and has units of MW-sec. For a motor, it includes the motor plus its mechanical load. Conventional units are per unit on the generator MVA base, usually expressed as MW-sec./MVA or just sec.
52 #: Saturation factor at 120% of rated term.voltage (>=S1)
55 #: Nameplate apparent power rating for the unit
58 #: Saturation factor at rated term. voltage (>= 0.)
61 #: Stator leakage reactance (> 0.)
64 self
._mechanicalLoad
0 = []
65 self
.mechanicalLoad0
= [] if mechanicalLoad0
is None else mechanicalLoad0
67 super(RotatingMachine
, self
).__init
__(*args
, **kw_args
)
69 _attrs
= ["parametersFormType", "d", "rs", "h", "s12", "ratedS", "s1", "xls"]
70 _attr_types
= {"parametersFormType": str, "d": float, "rs": float, "h": float, "s12": float, "ratedS": float, "s1": float, "xls": float}
71 _defaults
= {"parametersFormType": "timeConstantReactance", "d": 0.0, "rs": 0.0, "h": 0.0, "s12": 0.0, "ratedS": 0.0, "s1": 0.0, "xls": 0.0}
72 _enums
= {"parametersFormType": "ParametersFormType"}
73 _refs
= ["mechanicalLoad0"]
74 _many_refs
= ["mechanicalLoad0"]
76 def getmechanicalLoad0(self
):
78 return self
._mechanicalLoad
0
80 def setmechanicalLoad0(self
, value
):
81 for p
in self
._mechanicalLoad
0:
82 filtered
= [q
for q
in p
.rotatingMachine0
if q
!= self
]
83 self
._mechanicalLoad
0._rotatingMachine
0 = filtered
85 if self
not in r
._rotatingMachine
0:
86 r
._rotatingMachine
0.append(self
)
87 self
._mechanicalLoad
0 = value
89 mechanicalLoad0
= property(getmechanicalLoad0
, setmechanicalLoad0
)
91 def addmechanicalLoad0(self
, *mechanicalLoad0
):
92 for obj
in mechanicalLoad0
:
93 if self
not in obj
._rotatingMachine
0:
94 obj
._rotatingMachine
0.append(self
)
95 self
._mechanicalLoad
0.append(obj
)
97 def removemechanicalLoad0(self
, *mechanicalLoad0
):
98 for obj
in mechanicalLoad0
:
99 if self
in obj
._rotatingMachine
0:
100 obj
._rotatingMachine
0.remove(self
)
101 self
._mechanicalLoad
0.remove(obj
)