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
.Equipment
import Equipment
19 class PowerTransformer(Equipment
):
20 """An electrical device consisting of two or more coupled windings, with or without a magnetic core, for introducing mutual coupling between electric circuits. Transformers can be used to control voltage and phase shift (active power flow).
23 def __init__(self
, magSatFlux
=0.0, magBaseU
=0.0, bmagSat
=0.0, TransformerWindings
=None, HeatExchanger
=None, *args
, **kw_args
):
24 """Initialises a new 'PowerTransformer' instance.
26 @param magSatFlux: Core magnetizing saturation curve knee flux level.
27 @param magBaseU: The reference voltage at which the magnetizing saturation measurements were made
28 @param bmagSat: Core shunt magnetizing susceptance in the saturation region.
29 @param TransformerWindings: A transformer has windings
30 @param HeatExchanger: A transformer may have a heat exchanger
32 #: Core magnetizing saturation curve knee flux level.
33 self
.magSatFlux
= magSatFlux
35 #: The reference voltage at which the magnetizing saturation measurements were made
36 self
.magBaseU
= magBaseU
38 #: Core shunt magnetizing susceptance in the saturation region.
39 self
.bmagSat
= bmagSat
41 self
._TransformerWindings
= []
42 self
.TransformerWindings
= [] if TransformerWindings
is None else TransformerWindings
44 self
._HeatExchanger
= None
45 self
.HeatExchanger
= HeatExchanger
47 super(PowerTransformer
, self
).__init
__(*args
, **kw_args
)
49 _attrs
= ["magSatFlux", "magBaseU", "bmagSat"]
50 _attr_types
= {"magSatFlux": float, "magBaseU": float, "bmagSat": float}
51 _defaults
= {"magSatFlux": 0.0, "magBaseU": 0.0, "bmagSat": 0.0}
53 _refs
= ["TransformerWindings", "HeatExchanger"]
54 _many_refs
= ["TransformerWindings"]
56 def getTransformerWindings(self
):
57 """A transformer has windings
59 return self
._TransformerWindings
61 def setTransformerWindings(self
, value
):
62 for x
in self
._TransformerWindings
:
63 x
.PowerTransformer
= None
65 y
._PowerTransformer
= self
66 self
._TransformerWindings
= value
68 TransformerWindings
= property(getTransformerWindings
, setTransformerWindings
)
70 def addTransformerWindings(self
, *TransformerWindings
):
71 for obj
in TransformerWindings
:
72 obj
.PowerTransformer
= self
74 def removeTransformerWindings(self
, *TransformerWindings
):
75 for obj
in TransformerWindings
:
76 obj
.PowerTransformer
= None
78 def getHeatExchanger(self
):
79 """A transformer may have a heat exchanger
81 return self
._HeatExchanger
83 def setHeatExchanger(self
, value
):
84 if self
._HeatExchanger
is not None:
85 self
._HeatExchanger
._PowerTransformer
= None
87 self
._HeatExchanger
= value
88 if self
._HeatExchanger
is not None:
89 self
._HeatExchanger
.PowerTransformer
= None
90 self
._HeatExchanger
._PowerTransformer
= self
92 HeatExchanger
= property(getHeatExchanger
, setHeatExchanger
)