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
.Core
.ConductingEquipment
import ConductingEquipment
19 class TransformerWinding(ConductingEquipment
):
20 """A winding is associated with each defined terminal of a transformer (or phase shifter).
23 def __init__(self
, connectionType
="Yn", windingType
="primary", x
=0.0, grounded
=False, g
=0.0, r
=0.0, x0
=0.0, ratedU
=0.0, ratedS
=0.0, emergencyS
=0.0, rground
=0.0, shortTermS
=0.0, r0
=0.0, g0
=0.0, insulationU
=0.0, b
=0.0, b0
=0.0, xground
=0.0, From_WindingTest
=None, To_WindingTest
=None, RatioTapChanger
=None, PowerTransformer
=None, PhaseTapChanger
=None, *args
, **kw_args
):
24 """Initialises a new 'TransformerWinding' instance.
26 @param connectionType: The type of connection of the winding. Values are: "Yn", "Y", "D", "I", "Z", "A", "Zn"
27 @param windingType: The type of winding. Values are: "primary", "quaternary", "secondary", "tertiary"
28 @param x: Positive sequence series reactance of the winding. For a two winding transformer, the full reactance of the transformer should be entered on the primary (high voltage) winding.
29 @param grounded: Set if the winding is grounded.
30 @param g: Magnetizing branch conductance (G mag).
31 @param r: Positive sequence series resistance of the winding. For a two winding transformer, the full resistance of the transformer should be entered on the primary (high voltage) winding.
32 @param x0: Zero sequence series reactance of the winding.
33 @param ratedU: The rated voltage (phase-to-phase) of the winding, usually the same as the neutral voltage.
34 @param ratedS: The normal apparent power rating for the winding
35 @param emergencyS: The apparent power that the winding can carry under emergency conditions.
36 @param rground: Ground resistance path through connected grounding transformer.
37 @param shortTermS: Apparent power that the winding can carry for a short period of time.
38 @param r0: Zero sequence series resistance of the winding.
39 @param g0: Zero sequence magnetizing branch conductance.
40 @param insulationU: Basic insulation level voltage rating
41 @param b: Magnetizing branch susceptance (B mag). The value can be positive or negative.
42 @param b0: Zero sequence magnetizing branch susceptance.
43 @param xground: Ground reactance path through connected grounding transformer.
44 @param From_WindingTest: The transformer winding tests for which the transformer winding (terminal) participates as the 'from' part of the test.
45 @param To_WindingTest: The winding winding tests for which the transformer winding (terminal) participates as the 'to' end of the test.
46 @param RatioTapChanger: The ratio tap changer associated with the transformer winding.
47 @param PowerTransformer: A transformer has windings
48 @param PhaseTapChanger: The phase tap changer associated with the transformer winding.
50 #: The type of connection of the winding. Values are: "Yn", "Y", "D", "I", "Z", "A", "Zn"
51 self
.connectionType
= connectionType
53 #: The type of winding. Values are: "primary", "quaternary", "secondary", "tertiary"
54 self
.windingType
= windingType
56 #: Positive sequence series reactance of the winding. For a two winding transformer, the full reactance of the transformer should be entered on the primary (high voltage) winding.
59 #: Set if the winding is grounded.
60 self
.grounded
= grounded
62 #: Magnetizing branch conductance (G mag).
65 #: Positive sequence series resistance of the winding. For a two winding transformer, the full resistance of the transformer should be entered on the primary (high voltage) winding.
68 #: Zero sequence series reactance of the winding.
71 #: The rated voltage (phase-to-phase) of the winding, usually the same as the neutral voltage.
74 #: The normal apparent power rating for the winding
77 #: The apparent power that the winding can carry under emergency conditions.
78 self
.emergencyS
= emergencyS
80 #: Ground resistance path through connected grounding transformer.
81 self
.rground
= rground
83 #: Apparent power that the winding can carry for a short period of time.
84 self
.shortTermS
= shortTermS
86 #: Zero sequence series resistance of the winding.
89 #: Zero sequence magnetizing branch conductance.
92 #: Basic insulation level voltage rating
93 self
.insulationU
= insulationU
95 #: Magnetizing branch susceptance (B mag). The value can be positive or negative.
98 #: Zero sequence magnetizing branch susceptance.
101 #: Ground reactance path through connected grounding transformer.
102 self
.xground
= xground
104 self
._From
_WindingTest
= []
105 self
.From_WindingTest
= [] if From_WindingTest
is None else From_WindingTest
107 self
._To
_WindingTest
= []
108 self
.To_WindingTest
= [] if To_WindingTest
is None else To_WindingTest
110 self
._RatioTapChanger
= None
111 self
.RatioTapChanger
= RatioTapChanger
113 self
._PowerTransformer
= None
114 self
.PowerTransformer
= PowerTransformer
116 self
._PhaseTapChanger
= None
117 self
.PhaseTapChanger
= PhaseTapChanger
119 super(TransformerWinding
, self
).__init
__(*args
, **kw_args
)
121 _attrs
= ["connectionType", "windingType", "x", "grounded", "g", "r", "x0", "ratedU", "ratedS", "emergencyS", "rground", "shortTermS", "r0", "g0", "insulationU", "b", "b0", "xground"]
122 _attr_types
= {"connectionType": str, "windingType": str, "x": float, "grounded": bool, "g": float, "r": float, "x0": float, "ratedU": float, "ratedS": float, "emergencyS": float, "rground": float, "shortTermS": float, "r0": float, "g0": float, "insulationU": float, "b": float, "b0": float, "xground": float}
123 _defaults
= {"connectionType": "Yn", "windingType": "primary", "x": 0.0, "grounded": False, "g": 0.0, "r": 0.0, "x0": 0.0, "ratedU": 0.0, "ratedS": 0.0, "emergencyS": 0.0, "rground": 0.0, "shortTermS": 0.0, "r0": 0.0, "g0": 0.0, "insulationU": 0.0, "b": 0.0, "b0": 0.0, "xground": 0.0}
124 _enums
= {"connectionType": "WindingConnection", "windingType": "WindingType"}
125 _refs
= ["From_WindingTest", "To_WindingTest", "RatioTapChanger", "PowerTransformer", "PhaseTapChanger"]
126 _many_refs
= ["From_WindingTest", "To_WindingTest"]
128 def getFrom_WindingTest(self
):
129 """The transformer winding tests for which the transformer winding (terminal) participates as the 'from' part of the test.
131 return self
._From
_WindingTest
133 def setFrom_WindingTest(self
, value
):
134 for x
in self
._From
_WindingTest
:
135 x
._From
_TransformerWinding
= None
137 y
._From
_TransformerWinding
= self
138 self
._From
_WindingTest
= value
140 From_WindingTest
= property(getFrom_WindingTest
, setFrom_WindingTest
)
142 def addFrom_WindingTest(self
, *From_WindingTest
):
143 for obj
in From_WindingTest
:
144 obj
._From
_TransformerWinding
= self
145 self
._From
_WindingTest
.append(obj
)
147 def removeFrom_WindingTest(self
, *From_WindingTest
):
148 for obj
in From_WindingTest
:
149 obj
._From
_TransformerWinding
= None
150 self
._From
_WindingTest
.remove(obj
)
152 def getTo_WindingTest(self
):
153 """The winding winding tests for which the transformer winding (terminal) participates as the 'to' end of the test.
155 return self
._To
_WindingTest
157 def setTo_WindingTest(self
, value
):
158 for x
in self
._To
_WindingTest
:
159 x
._To
_TransformerWinding
= None
161 y
._To
_TransformerWinding
= self
162 self
._To
_WindingTest
= value
164 To_WindingTest
= property(getTo_WindingTest
, setTo_WindingTest
)
166 def addTo_WindingTest(self
, *To_WindingTest
):
167 for obj
in To_WindingTest
:
168 obj
._To
_TransformerWinding
= self
169 self
._To
_WindingTest
.append(obj
)
171 def removeTo_WindingTest(self
, *To_WindingTest
):
172 for obj
in To_WindingTest
:
173 obj
._To
_TransformerWinding
= None
174 self
._To
_WindingTest
.remove(obj
)
176 def getRatioTapChanger(self
):
177 """The ratio tap changer associated with the transformer winding.
179 return self
._RatioTapChanger
181 def setRatioTapChanger(self
, value
):
182 if self
._RatioTapChanger
is not None:
183 self
._RatioTapChanger
._TransformerWinding
= None
185 self
._RatioTapChanger
= value
186 if self
._RatioTapChanger
is not None:
187 self
._RatioTapChanger
._TransformerWinding
= self
189 RatioTapChanger
= property(getRatioTapChanger
, setRatioTapChanger
)
191 def getPowerTransformer(self
):
192 """A transformer has windings
194 return self
._PowerTransformer
196 def setPowerTransformer(self
, value
):
197 if self
._PowerTransformer
is not None:
198 filtered
= [x
for x
in self
.PowerTransformer
.TransformerWindings
if x
!= self
]
199 self
._PowerTransformer
._TransformerWindings
= filtered
201 self
._PowerTransformer
= value
202 if self
._PowerTransformer
is not None:
203 self
._PowerTransformer
._TransformerWindings
.append(self
)
205 PowerTransformer
= property(getPowerTransformer
, setPowerTransformer
)
207 def getPhaseTapChanger(self
):
208 """The phase tap changer associated with the transformer winding.
210 return self
._PhaseTapChanger
212 def setPhaseTapChanger(self
, value
):
213 if self
._PhaseTapChanger
is not None:
214 self
._PhaseTapChanger
._TransformerWinding
= None
216 self
._PhaseTapChanger
= value
217 if self
._PhaseTapChanger
is not None:
218 self
._PhaseTapChanger
._TransformerWinding
= self
220 PhaseTapChanger
= property(getPhaseTapChanger
, setPhaseTapChanger
)