PageRenderTime 83ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/CIM15/IEC61970/Generation/Production/ThermalGeneratingUnit.py

https://github.com/rwl/PyCIM
Python | 309 lines | 285 code | 3 blank | 21 comment | 0 complexity | 60fb819dbe100ac070a53f38a0eca062 MD5 | raw file
  1. # Copyright (C) 2010-2011 Richard Lincoln
  2. #
  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:
  9. #
  10. # The above copyright notice and this permission notice shall be included in
  11. # all copies or substantial portions of the Software.
  12. #
  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.
  20. from CIM15.IEC61970.Generation.Production.GeneratingUnit import GeneratingUnit
  21. class ThermalGeneratingUnit(GeneratingUnit):
  22. """A generating unit whose prime mover could be a steam turbine, combustion turbine, or diesel engine.A generating unit whose prime mover could be a steam turbine, combustion turbine, or diesel engine.
  23. """
  24. def __init__(self, oMCost=0.0, CAESPlant=None, CogenerationPlant=None, ShutdownCurve=None, FossilFuels=None, HeatRateCurve=None, FuelAllocationSchedules=None, EmissionCurves=None, HeatInputCurve=None, CombinedCyclePlant=None, IncrementalHeatRateCurve=None, StartupModel=None, EmmissionAccounts=None, *args, **kw_args):
  25. """Initialises a new 'ThermalGeneratingUnit' instance.
  26. @param oMCost: Operating and maintenance cost for the thermal unit
  27. @param CAESPlant: A thermal generating unit may be a member of a compressed air energy storage plant
  28. @param CogenerationPlant: A thermal generating unit may be a member of a cogeneration plant
  29. @param ShutdownCurve: A thermal generating unit may have a shutdown curve
  30. @param FossilFuels: A thermal generating unit may have one or more fossil fuels
  31. @param HeatRateCurve: A thermal generating unit may have a heat rate curve
  32. @param FuelAllocationSchedules: A thermal generating unit may have one or more fuel allocation schedules
  33. @param EmissionCurves: A thermal generating unit may have one or more emission curves
  34. @param HeatInputCurve: A thermal generating unit may have a heat input curve
  35. @param CombinedCyclePlant: A thermal generating unit may be a member of a combined cycle plant
  36. @param IncrementalHeatRateCurve: A thermal generating unit may have an incremental heat rate curve
  37. @param StartupModel: A thermal generating unit may have a startup model
  38. @param EmmissionAccounts: A thermal generating unit may have one or more emission allowance accounts
  39. """
  40. #: Operating and maintenance cost for the thermal unit
  41. self.oMCost = oMCost
  42. self._CAESPlant = None
  43. self.CAESPlant = CAESPlant
  44. self._CogenerationPlant = None
  45. self.CogenerationPlant = CogenerationPlant
  46. self._ShutdownCurve = None
  47. self.ShutdownCurve = ShutdownCurve
  48. self._FossilFuels = []
  49. self.FossilFuels = [] if FossilFuels is None else FossilFuels
  50. self._HeatRateCurve = None
  51. self.HeatRateCurve = HeatRateCurve
  52. self._FuelAllocationSchedules = []
  53. self.FuelAllocationSchedules = [] if FuelAllocationSchedules is None else FuelAllocationSchedules
  54. self._EmissionCurves = []
  55. self.EmissionCurves = [] if EmissionCurves is None else EmissionCurves
  56. self._HeatInputCurve = None
  57. self.HeatInputCurve = HeatInputCurve
  58. self._CombinedCyclePlant = None
  59. self.CombinedCyclePlant = CombinedCyclePlant
  60. self._IncrementalHeatRateCurve = None
  61. self.IncrementalHeatRateCurve = IncrementalHeatRateCurve
  62. self._StartupModel = None
  63. self.StartupModel = StartupModel
  64. self._EmmissionAccounts = []
  65. self.EmmissionAccounts = [] if EmmissionAccounts is None else EmmissionAccounts
  66. super(ThermalGeneratingUnit, self).__init__(*args, **kw_args)
  67. _attrs = ["oMCost"]
  68. _attr_types = {"oMCost": float}
  69. _defaults = {"oMCost": 0.0}
  70. _enums = {}
  71. _refs = ["CAESPlant", "CogenerationPlant", "ShutdownCurve", "FossilFuels", "HeatRateCurve", "FuelAllocationSchedules", "EmissionCurves", "HeatInputCurve", "CombinedCyclePlant", "IncrementalHeatRateCurve", "StartupModel", "EmmissionAccounts"]
  72. _many_refs = ["FossilFuels", "FuelAllocationSchedules", "EmissionCurves", "EmmissionAccounts"]
  73. def getCAESPlant(self):
  74. """A thermal generating unit may be a member of a compressed air energy storage plant
  75. """
  76. return self._CAESPlant
  77. def setCAESPlant(self, value):
  78. if self._CAESPlant is not None:
  79. self._CAESPlant._ThermalGeneratingUnit = None
  80. self._CAESPlant = value
  81. if self._CAESPlant is not None:
  82. self._CAESPlant.ThermalGeneratingUnit = None
  83. self._CAESPlant._ThermalGeneratingUnit = self
  84. CAESPlant = property(getCAESPlant, setCAESPlant)
  85. def getCogenerationPlant(self):
  86. """A thermal generating unit may be a member of a cogeneration plant
  87. """
  88. return self._CogenerationPlant
  89. def setCogenerationPlant(self, value):
  90. if self._CogenerationPlant is not None:
  91. filtered = [x for x in self.CogenerationPlant.ThermalGeneratingUnits if x != self]
  92. self._CogenerationPlant._ThermalGeneratingUnits = filtered
  93. self._CogenerationPlant = value
  94. if self._CogenerationPlant is not None:
  95. if self not in self._CogenerationPlant._ThermalGeneratingUnits:
  96. self._CogenerationPlant._ThermalGeneratingUnits.append(self)
  97. CogenerationPlant = property(getCogenerationPlant, setCogenerationPlant)
  98. def getShutdownCurve(self):
  99. """A thermal generating unit may have a shutdown curve
  100. """
  101. return self._ShutdownCurve
  102. def setShutdownCurve(self, value):
  103. if self._ShutdownCurve is not None:
  104. self._ShutdownCurve._ThermalGeneratingUnit = None
  105. self._ShutdownCurve = value
  106. if self._ShutdownCurve is not None:
  107. self._ShutdownCurve.ThermalGeneratingUnit = None
  108. self._ShutdownCurve._ThermalGeneratingUnit = self
  109. ShutdownCurve = property(getShutdownCurve, setShutdownCurve)
  110. def getFossilFuels(self):
  111. """A thermal generating unit may have one or more fossil fuels
  112. """
  113. return self._FossilFuels
  114. def setFossilFuels(self, value):
  115. for x in self._FossilFuels:
  116. x.ThermalGeneratingUnit = None
  117. for y in value:
  118. y._ThermalGeneratingUnit = self
  119. self._FossilFuels = value
  120. FossilFuels = property(getFossilFuels, setFossilFuels)
  121. def addFossilFuels(self, *FossilFuels):
  122. for obj in FossilFuels:
  123. obj.ThermalGeneratingUnit = self
  124. def removeFossilFuels(self, *FossilFuels):
  125. for obj in FossilFuels:
  126. obj.ThermalGeneratingUnit = None
  127. def getHeatRateCurve(self):
  128. """A thermal generating unit may have a heat rate curve
  129. """
  130. return self._HeatRateCurve
  131. def setHeatRateCurve(self, value):
  132. if self._HeatRateCurve is not None:
  133. self._HeatRateCurve._ThermalGeneratingUnit = None
  134. self._HeatRateCurve = value
  135. if self._HeatRateCurve is not None:
  136. self._HeatRateCurve.ThermalGeneratingUnit = None
  137. self._HeatRateCurve._ThermalGeneratingUnit = self
  138. HeatRateCurve = property(getHeatRateCurve, setHeatRateCurve)
  139. def getFuelAllocationSchedules(self):
  140. """A thermal generating unit may have one or more fuel allocation schedules
  141. """
  142. return self._FuelAllocationSchedules
  143. def setFuelAllocationSchedules(self, value):
  144. for x in self._FuelAllocationSchedules:
  145. x.ThermalGeneratingUnit = None
  146. for y in value:
  147. y._ThermalGeneratingUnit = self
  148. self._FuelAllocationSchedules = value
  149. FuelAllocationSchedules = property(getFuelAllocationSchedules, setFuelAllocationSchedules)
  150. def addFuelAllocationSchedules(self, *FuelAllocationSchedules):
  151. for obj in FuelAllocationSchedules:
  152. obj.ThermalGeneratingUnit = self
  153. def removeFuelAllocationSchedules(self, *FuelAllocationSchedules):
  154. for obj in FuelAllocationSchedules:
  155. obj.ThermalGeneratingUnit = None
  156. def getEmissionCurves(self):
  157. """A thermal generating unit may have one or more emission curves
  158. """
  159. return self._EmissionCurves
  160. def setEmissionCurves(self, value):
  161. for x in self._EmissionCurves:
  162. x.ThermalGeneratingUnit = None
  163. for y in value:
  164. y._ThermalGeneratingUnit = self
  165. self._EmissionCurves = value
  166. EmissionCurves = property(getEmissionCurves, setEmissionCurves)
  167. def addEmissionCurves(self, *EmissionCurves):
  168. for obj in EmissionCurves:
  169. obj.ThermalGeneratingUnit = self
  170. def removeEmissionCurves(self, *EmissionCurves):
  171. for obj in EmissionCurves:
  172. obj.ThermalGeneratingUnit = None
  173. def getHeatInputCurve(self):
  174. """A thermal generating unit may have a heat input curve
  175. """
  176. return self._HeatInputCurve
  177. def setHeatInputCurve(self, value):
  178. if self._HeatInputCurve is not None:
  179. self._HeatInputCurve._ThermalGeneratingUnit = None
  180. self._HeatInputCurve = value
  181. if self._HeatInputCurve is not None:
  182. self._HeatInputCurve.ThermalGeneratingUnit = None
  183. self._HeatInputCurve._ThermalGeneratingUnit = self
  184. HeatInputCurve = property(getHeatInputCurve, setHeatInputCurve)
  185. def getCombinedCyclePlant(self):
  186. """A thermal generating unit may be a member of a combined cycle plant
  187. """
  188. return self._CombinedCyclePlant
  189. def setCombinedCyclePlant(self, value):
  190. if self._CombinedCyclePlant is not None:
  191. filtered = [x for x in self.CombinedCyclePlant.ThermalGeneratingUnits if x != self]
  192. self._CombinedCyclePlant._ThermalGeneratingUnits = filtered
  193. self._CombinedCyclePlant = value
  194. if self._CombinedCyclePlant is not None:
  195. if self not in self._CombinedCyclePlant._ThermalGeneratingUnits:
  196. self._CombinedCyclePlant._ThermalGeneratingUnits.append(self)
  197. CombinedCyclePlant = property(getCombinedCyclePlant, setCombinedCyclePlant)
  198. def getIncrementalHeatRateCurve(self):
  199. """A thermal generating unit may have an incremental heat rate curve
  200. """
  201. return self._IncrementalHeatRateCurve
  202. def setIncrementalHeatRateCurve(self, value):
  203. if self._IncrementalHeatRateCurve is not None:
  204. self._IncrementalHeatRateCurve._ThermalGeneratingUnit = None
  205. self._IncrementalHeatRateCurve = value
  206. if self._IncrementalHeatRateCurve is not None:
  207. self._IncrementalHeatRateCurve.ThermalGeneratingUnit = None
  208. self._IncrementalHeatRateCurve._ThermalGeneratingUnit = self
  209. IncrementalHeatRateCurve = property(getIncrementalHeatRateCurve, setIncrementalHeatRateCurve)
  210. def getStartupModel(self):
  211. """A thermal generating unit may have a startup model
  212. """
  213. return self._StartupModel
  214. def setStartupModel(self, value):
  215. if self._StartupModel is not None:
  216. self._StartupModel._ThermalGeneratingUnit = None
  217. self._StartupModel = value
  218. if self._StartupModel is not None:
  219. self._StartupModel.ThermalGeneratingUnit = None
  220. self._StartupModel._ThermalGeneratingUnit = self
  221. StartupModel = property(getStartupModel, setStartupModel)
  222. def getEmmissionAccounts(self):
  223. """A thermal generating unit may have one or more emission allowance accounts
  224. """
  225. return self._EmmissionAccounts
  226. def setEmmissionAccounts(self, value):
  227. for x in self._EmmissionAccounts:
  228. x.ThermalGeneratingUnit = None
  229. for y in value:
  230. y._ThermalGeneratingUnit = self
  231. self._EmmissionAccounts = value
  232. EmmissionAccounts = property(getEmmissionAccounts, setEmmissionAccounts)
  233. def addEmmissionAccounts(self, *EmmissionAccounts):
  234. for obj in EmmissionAccounts:
  235. obj.ThermalGeneratingUnit = self
  236. def removeEmmissionAccounts(self, *EmmissionAccounts):
  237. for obj in EmmissionAccounts:
  238. obj.ThermalGeneratingUnit = None