Adding CIM15 package.
[PyCIM.git] / CIM15 / IEC61970 / Generation / GenerationDynamics / SteamTurbine.py
blob4ec5f1c7af445161d0356637642d51b2cc628713
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
19 # IN THE SOFTWARE.
21 from CIM15.IEC61970.Generation.GenerationDynamics.PrimeMover import PrimeMover
23 class SteamTurbine(PrimeMover):
24 """Steam turbineSteam turbine
25 """
27 def __init__(self, shaft1PowerIP=0.0, shaft2PowerIP=0.0, crossoverTC=0.0, shaft1PowerLP1=0.0, shaft1PowerLP2=0.0, reheater1TC=0.0, shaft2PowerLP1=0.0, shaft2PowerLP2=0.0, reheater2TC=0.0, steamChestTC=0.0, shaft1PowerHP=0.0, shaft2PowerHP=0.0, SteamSupplys=None, *args, **kw_args):
28 """Initialises a new 'SteamTurbine' instance.
30 @param shaft1PowerIP: Fraction Of Power From Shaft 1 Intermediate Pressure Turbine output
31 @param shaft2PowerIP: Fraction Of Power From Shaft 2 Intermediate Pressure Turbine output
32 @param crossoverTC: Crossover Time Constant
33 @param shaft1PowerLP1: Fraction Of Power From Shaft 1 First Low Pressure Turbine output
34 @param shaft1PowerLP2: Fraction Of Power From Shaft 1 Second Low Pressure Turbine output
35 @param reheater1TC: First Reheater Time Constant
36 @param shaft2PowerLP1: Fraction Of Power From Shaft 2 First Low Pressure Turbine output
37 @param shaft2PowerLP2: Fraction Of Power From Shaft 2 Second Low Pressure Turbine output
38 @param reheater2TC: Second Reheater Time Constant
39 @param steamChestTC: Steam Chest Time Constant
40 @param shaft1PowerHP: Fraction Of Power From Shaft 1 High Pressure Turbine output
41 @param shaft2PowerHP: Fraction Of Power From Shaft 2 High Pressure Turbine output
42 @param SteamSupplys: Steam turbines may have steam supplied by a steam supply
43 """
44 #: Fraction Of Power From Shaft 1 Intermediate Pressure Turbine output
45 self.shaft1PowerIP = shaft1PowerIP
47 #: Fraction Of Power From Shaft 2 Intermediate Pressure Turbine output
48 self.shaft2PowerIP = shaft2PowerIP
50 #: Crossover Time Constant
51 self.crossoverTC = crossoverTC
53 #: Fraction Of Power From Shaft 1 First Low Pressure Turbine output
54 self.shaft1PowerLP1 = shaft1PowerLP1
56 #: Fraction Of Power From Shaft 1 Second Low Pressure Turbine output
57 self.shaft1PowerLP2 = shaft1PowerLP2
59 #: First Reheater Time Constant
60 self.reheater1TC = reheater1TC
62 #: Fraction Of Power From Shaft 2 First Low Pressure Turbine output
63 self.shaft2PowerLP1 = shaft2PowerLP1
65 #: Fraction Of Power From Shaft 2 Second Low Pressure Turbine output
66 self.shaft2PowerLP2 = shaft2PowerLP2
68 #: Second Reheater Time Constant
69 self.reheater2TC = reheater2TC
71 #: Steam Chest Time Constant
72 self.steamChestTC = steamChestTC
74 #: Fraction Of Power From Shaft 1 High Pressure Turbine output
75 self.shaft1PowerHP = shaft1PowerHP
77 #: Fraction Of Power From Shaft 2 High Pressure Turbine output
78 self.shaft2PowerHP = shaft2PowerHP
80 self._SteamSupplys = []
81 self.SteamSupplys = [] if SteamSupplys is None else SteamSupplys
83 super(SteamTurbine, self).__init__(*args, **kw_args)
85 _attrs = ["shaft1PowerIP", "shaft2PowerIP", "crossoverTC", "shaft1PowerLP1", "shaft1PowerLP2", "reheater1TC", "shaft2PowerLP1", "shaft2PowerLP2", "reheater2TC", "steamChestTC", "shaft1PowerHP", "shaft2PowerHP"]
86 _attr_types = {"shaft1PowerIP": float, "shaft2PowerIP": float, "crossoverTC": float, "shaft1PowerLP1": float, "shaft1PowerLP2": float, "reheater1TC": float, "shaft2PowerLP1": float, "shaft2PowerLP2": float, "reheater2TC": float, "steamChestTC": float, "shaft1PowerHP": float, "shaft2PowerHP": float}
87 _defaults = {"shaft1PowerIP": 0.0, "shaft2PowerIP": 0.0, "crossoverTC": 0.0, "shaft1PowerLP1": 0.0, "shaft1PowerLP2": 0.0, "reheater1TC": 0.0, "shaft2PowerLP1": 0.0, "shaft2PowerLP2": 0.0, "reheater2TC": 0.0, "steamChestTC": 0.0, "shaft1PowerHP": 0.0, "shaft2PowerHP": 0.0}
88 _enums = {}
89 _refs = ["SteamSupplys"]
90 _many_refs = ["SteamSupplys"]
92 def getSteamSupplys(self):
93 """Steam turbines may have steam supplied by a steam supply
94 """
95 return self._SteamSupplys
97 def setSteamSupplys(self, value):
98 for p in self._SteamSupplys:
99 filtered = [q for q in p.SteamTurbines if q != self]
100 self._SteamSupplys._SteamTurbines = filtered
101 for r in value:
102 if self not in r._SteamTurbines:
103 r._SteamTurbines.append(self)
104 self._SteamSupplys = value
106 SteamSupplys = property(getSteamSupplys, setSteamSupplys)
108 def addSteamSupplys(self, *SteamSupplys):
109 for obj in SteamSupplys:
110 if self not in obj._SteamTurbines:
111 obj._SteamTurbines.append(self)
112 self._SteamSupplys.append(obj)
114 def removeSteamSupplys(self, *SteamSupplys):
115 for obj in SteamSupplys:
116 if self in obj._SteamTurbines:
117 obj._SteamTurbines.remove(self)
118 self._SteamSupplys.remove(obj)