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
.ENTSOE
.Equipment
.Core
.ConductingEquipment
import ConductingEquipment
23 class TransformerWinding(ConductingEquipment
):
24 """A winding is associated with each defined terminal of a transformer (or phase shifter).- [R5.4], [R5.6], and [R5.10] are satisfied by navigation to ConnectivityNode and Substation - Each TransformerWinging must be contained by a PowerTransformer. Because a TransformerWinding (or any other object) can not be contained by more than one parent, a TransformerWinding can not have an association to an EquipmentContainer (Substation, VoltageLevel, etc). - The attributes ratedS, b0, g0, r0, x0, rground, xground, and connectionType are not required.
27 def __init__(self
, x
=0.0, x0
=0.0, b0
=0.0, g0
=0.0, rground
=0.0, b
=0.0, connectionType
="I", ratedS
=0.0, r
=0.0, r0
=0.0, ratedU
=0.0, xground
=0.0, windingType
="tertiary", RatioTapChanger
=None, PhaseTapChanger
=None, PowerTransformer
=None, *args
, **kw_args
):
28 """Initialises a new 'TransformerWinding' instance.
30 @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.
31 @param x0: Zero sequence series reactance of the winding.
32 @param b0: Zero sequence magnetizing branch susceptance.
33 @param g0: Zero sequence magnetizing branch conductance.
34 @param rground: Ground resistance path through connected grounding transformer.
35 @param b: Magnetizing branch susceptance (B mag). The value can be positive or negative.
36 @param connectionType: The type of connection of the winding. Values are: "I", "Yn", "Z", "Y", "A", "D", "Zn"
37 @param ratedS: The normal apparent power rating for the windingShould not be null or zero.
38 @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.
39 @param r0: Zero sequence series resistance of the winding.
40 @param ratedU: The rated voltage (phase-to-phase) of the winding, usually the same as the neutral voltage.Should not be null or zero.
41 @param xground: Ground reactance path through connected grounding transformer.
42 @param windingType: The type of winding. Values are: "tertiary", "primary", "secondary"
43 @param RatioTapChanger: The ratio tap changer associated with the transformer winding.
44 @param PhaseTapChanger: The phase tap changer associated with the transformer winding.
45 @param PowerTransformer: A transformer has windings
47 #: 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.
50 #: Zero sequence series reactance of the winding.
53 #: Zero sequence magnetizing branch susceptance.
56 #: Zero sequence magnetizing branch conductance.
59 #: Ground resistance path through connected grounding transformer.
60 self
.rground
= rground
62 #: Magnetizing branch susceptance (B mag). The value can be positive or negative.
65 #: The type of connection of the winding. Values are: "I", "Yn", "Z", "Y", "A", "D", "Zn"
66 self
.connectionType
= connectionType
68 #: The normal apparent power rating for the windingShould not be null or zero.
71 #: 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.
74 #: Zero sequence series resistance of the winding.
77 #: The rated voltage (phase-to-phase) of the winding, usually the same as the neutral voltage.Should not be null or zero.
80 #: Ground reactance path through connected grounding transformer.
81 self
.xground
= xground
83 #: The type of winding. Values are: "tertiary", "primary", "secondary"
84 self
.windingType
= windingType
86 self
._RatioTapChanger
= None
87 self
.RatioTapChanger
= RatioTapChanger
89 self
._PhaseTapChanger
= None
90 self
.PhaseTapChanger
= PhaseTapChanger
92 self
._PowerTransformer
= None
93 self
.PowerTransformer
= PowerTransformer
95 super(TransformerWinding
, self
).__init
__(*args
, **kw_args
)
97 _attrs
= ["x", "x0", "b0", "g0", "rground", "b", "connectionType", "ratedS", "r", "r0", "ratedU", "xground", "windingType"]
98 _attr_types
= {"x": float, "x0": float, "b0": float, "g0": float, "rground": float, "b": float, "connectionType": str, "ratedS": float, "r": float, "r0": float, "ratedU": float, "xground": float, "windingType": str}
99 _defaults
= {"x": 0.0, "x0": 0.0, "b0": 0.0, "g0": 0.0, "rground": 0.0, "b": 0.0, "connectionType": "I", "ratedS": 0.0, "r": 0.0, "r0": 0.0, "ratedU": 0.0, "xground": 0.0, "windingType": "tertiary"}
100 _enums
= {"connectionType": "WindingConnection", "windingType": "WindingType"}
101 _refs
= ["RatioTapChanger", "PhaseTapChanger", "PowerTransformer"]
104 def getRatioTapChanger(self
):
105 """The ratio tap changer associated with the transformer winding.
107 return self
._RatioTapChanger
109 def setRatioTapChanger(self
, value
):
110 if self
._RatioTapChanger
is not None:
111 self
._RatioTapChanger
._TransformerWinding
= None
113 self
._RatioTapChanger
= value
114 if self
._RatioTapChanger
is not None:
115 self
._RatioTapChanger
.TransformerWinding
= None
116 self
._RatioTapChanger
._TransformerWinding
= self
118 RatioTapChanger
= property(getRatioTapChanger
, setRatioTapChanger
)
120 def getPhaseTapChanger(self
):
121 """The phase tap changer associated with the transformer winding.
123 return self
._PhaseTapChanger
125 def setPhaseTapChanger(self
, value
):
126 if self
._PhaseTapChanger
is not None:
127 self
._PhaseTapChanger
._TransformerWinding
= None
129 self
._PhaseTapChanger
= value
130 if self
._PhaseTapChanger
is not None:
131 self
._PhaseTapChanger
.TransformerWinding
= None
132 self
._PhaseTapChanger
._TransformerWinding
= self
134 PhaseTapChanger
= property(getPhaseTapChanger
, setPhaseTapChanger
)
136 def getPowerTransformer(self
):
137 """A transformer has windings
139 return self
._PowerTransformer
141 def setPowerTransformer(self
, value
):
142 if self
._PowerTransformer
is not None:
143 filtered
= [x
for x
in self
.PowerTransformer
.TransformerWindings
if x
!= self
]
144 self
._PowerTransformer
._TransformerWindings
= filtered
146 self
._PowerTransformer
= value
147 if self
._PowerTransformer
is not None:
148 if self
not in self
._PowerTransformer
._TransformerWindings
:
149 self
._PowerTransformer
._TransformerWindings
.append(self
)
151 PowerTransformer
= property(getPowerTransformer
, setPowerTransformer
)