Adding class meta-data attributes.
[PyCIM.git] / schemata / CIM14 / Dynamics / RotatingMachine.py
blobee5a808f650debf6836e929ff0185c62b2363081
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.IEC61970.Wires.RegulatingCondEq import RegulatingCondEq
19 class RotatingMachine(RegulatingCondEq):
20 """A rotating machine which may be used as a generator or motor.
21 """
23 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):
24 """Initialises a new 'RotatingMachine' instance.
26 @param parametersFormType: Values are: "timeConstantReactance", "equivalentCircuit"
27 @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
28 @param rs: Stator (armature) resistance (&gt;= 0.) - Equivalent resistance when used for GenEquiv model
29 @param h: Inertia constant of generator or motor and mechanical load (&gt;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.
30 @param s12: Saturation factor at 120% of rated term.voltage (&gt;=S1)
31 @param ratedS: Nameplate apparent power rating for the unit
32 @param s1: Saturation factor at rated term. voltage (&gt;= 0.)
33 @param xls: Stator leakage reactance (&gt; 0.)
34 @param mechanicalLoad0:
35 """
36 #: Values are: "timeConstantReactance", "equivalentCircuit"
37 self.parametersFormType = parametersFormType
39 #: 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
40 self.d = d
42 #: Stator (armature) resistance (&gt;= 0.) - Equivalent resistance when used for GenEquiv model
43 self.rs = rs
45 #: Inertia constant of generator or motor and mechanical load (&gt;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.
46 self.h = h
48 #: Saturation factor at 120% of rated term.voltage (&gt;=S1)
49 self.s12 = s12
51 #: Nameplate apparent power rating for the unit
52 self.ratedS = ratedS
54 #: Saturation factor at rated term. voltage (&gt;= 0.)
55 self.s1 = s1
57 #: Stator leakage reactance (&gt; 0.)
58 self.xls = xls
60 self._mechanicalLoad0 = []
61 self.mechanicalLoad0 = [] if mechanicalLoad0 is None else mechanicalLoad0
63 super(RotatingMachine, self).__init__(*args, **kw_args)
65 _attrs = ["parametersFormType", "d", "rs", "h", "s12", "ratedS", "s1", "xls"]
66 _attr_types = {"parametersFormType": str, "d": float, "rs": float, "h": float, "s12": float, "ratedS": float, "s1": float, "xls": float}
67 _defaults = {"parametersFormType": "timeConstantReactance", "d": 0.0, "rs": 0.0, "h": 0.0, "s12": 0.0, "ratedS": 0.0, "s1": 0.0, "xls": 0.0}
68 _enums = {"parametersFormType": "ParametersFormType"}
69 _refs = ["mechanicalLoad0"]
70 _many_refs = ["mechanicalLoad0"]
72 def getmechanicalLoad0(self):
74 return self._mechanicalLoad0
76 def setmechanicalLoad0(self, value):
77 for p in self._mechanicalLoad0:
78 filtered = [q for q in p.rotatingMachine0 if q != self]
79 self._mechanicalLoad0._rotatingMachine0 = filtered
80 for r in value:
81 if self not in r._rotatingMachine0:
82 r._rotatingMachine0.append(self)
83 self._mechanicalLoad0 = value
85 mechanicalLoad0 = property(getmechanicalLoad0, setmechanicalLoad0)
87 def addmechanicalLoad0(self, *mechanicalLoad0):
88 for obj in mechanicalLoad0:
89 if self not in obj._rotatingMachine0:
90 obj._rotatingMachine0.append(self)
91 self._mechanicalLoad0.append(obj)
93 def removemechanicalLoad0(self, *mechanicalLoad0):
94 for obj in mechanicalLoad0:
95 if self in obj._rotatingMachine0:
96 obj._rotatingMachine0.remove(self)
97 self._mechanicalLoad0.remove(obj)