Fixing website and API documentation links
[PyCIM.git] / CIM14 / IEC61970 / Generation / Production / HydroPowerPlant.py
blob07e1ca40f4b276c3adb58c469bad7a0b5dbe0536
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 CIM14.IEC61970.Core.PowerSystemResource import PowerSystemResource
23 class HydroPowerPlant(PowerSystemResource):
24 """A hydro power station which can generate or pump. When generating, the generator turbines receive there water from an upper reservoir. When pumping, the pumps receive their water from a lower reservoir.
25 """
27 def __init__(self, hydroPlantType="runOfRiver", penstockType="", surgeTankCode="", plantRatedHead=0.0, plantDischargeCapacity=0.0, surgeTankCrestLevel=0.0, dischargeTravelDelay=0.0, pumpRatedP=0.0, genRatedP=0.0, HydroGeneratingUnits=None, HydroPumps=None, Reservoir=None, GenSourcePumpDischargeReservoir=None, *args, **kw_args):
28 """Initialises a new 'HydroPowerPlant' instance.
30 @param hydroPlantType: The type of hydro power plant. Values are: "runOfRiver", "minorStorage", "majorStorage", "pumpedStorage"
31 @param penstockType: Type and configuration of hydro plant penstock(s)
32 @param surgeTankCode: A code describing the type (or absence) of surge tank that is associated with the hydro power plant
33 @param plantRatedHead: The plant's rated gross head
34 @param plantDischargeCapacity: Total plant discharge capacity in cubic meters per second
35 @param surgeTankCrestLevel: The level at which the surge tank spills
36 @param dischargeTravelDelay: Water travel delay from tailbay to next downstream hydro power station
37 @param pumpRatedP: The hydro plant's pumping rating active power for rated head conditions
38 @param genRatedP: The hydro plant's generating rating active power for rated head conditions
39 @param HydroGeneratingUnits: The hydro generating unit belongs to a hydro power plant
40 @param HydroPumps: The hydro pump may be a member of a pumped storage plant or a pump for distributing water
41 @param Reservoir: Generators discharge water to or pumps are supplied water from a downstream reservoir
42 @param GenSourcePumpDischargeReservoir: Generators are supplied water from or pumps discharge water to an upstream reservoir
43 """
44 #: The type of hydro power plant. Values are: "runOfRiver", "minorStorage", "majorStorage", "pumpedStorage"
45 self.hydroPlantType = hydroPlantType
47 #: Type and configuration of hydro plant penstock(s)
48 self.penstockType = penstockType
50 #: A code describing the type (or absence) of surge tank that is associated with the hydro power plant
51 self.surgeTankCode = surgeTankCode
53 #: The plant's rated gross head
54 self.plantRatedHead = plantRatedHead
56 #: Total plant discharge capacity in cubic meters per second
57 self.plantDischargeCapacity = plantDischargeCapacity
59 #: The level at which the surge tank spills
60 self.surgeTankCrestLevel = surgeTankCrestLevel
62 #: Water travel delay from tailbay to next downstream hydro power station
63 self.dischargeTravelDelay = dischargeTravelDelay
65 #: The hydro plant's pumping rating active power for rated head conditions
66 self.pumpRatedP = pumpRatedP
68 #: The hydro plant's generating rating active power for rated head conditions
69 self.genRatedP = genRatedP
71 self._HydroGeneratingUnits = []
72 self.HydroGeneratingUnits = [] if HydroGeneratingUnits is None else HydroGeneratingUnits
74 self._HydroPumps = []
75 self.HydroPumps = [] if HydroPumps is None else HydroPumps
77 self._Reservoir = None
78 self.Reservoir = Reservoir
80 self._GenSourcePumpDischargeReservoir = None
81 self.GenSourcePumpDischargeReservoir = GenSourcePumpDischargeReservoir
83 super(HydroPowerPlant, self).__init__(*args, **kw_args)
85 _attrs = ["hydroPlantType", "penstockType", "surgeTankCode", "plantRatedHead", "plantDischargeCapacity", "surgeTankCrestLevel", "dischargeTravelDelay", "pumpRatedP", "genRatedP"]
86 _attr_types = {"hydroPlantType": str, "penstockType": str, "surgeTankCode": str, "plantRatedHead": float, "plantDischargeCapacity": float, "surgeTankCrestLevel": float, "dischargeTravelDelay": float, "pumpRatedP": float, "genRatedP": float}
87 _defaults = {"hydroPlantType": "runOfRiver", "penstockType": "", "surgeTankCode": "", "plantRatedHead": 0.0, "plantDischargeCapacity": 0.0, "surgeTankCrestLevel": 0.0, "dischargeTravelDelay": 0.0, "pumpRatedP": 0.0, "genRatedP": 0.0}
88 _enums = {"hydroPlantType": "HydroPlantType", "penstockType": "PenstockType", "surgeTankCode": "SurgeTankCode"}
89 _refs = ["HydroGeneratingUnits", "HydroPumps", "Reservoir", "GenSourcePumpDischargeReservoir"]
90 _many_refs = ["HydroGeneratingUnits", "HydroPumps"]
92 def getHydroGeneratingUnits(self):
93 """The hydro generating unit belongs to a hydro power plant
94 """
95 return self._HydroGeneratingUnits
97 def setHydroGeneratingUnits(self, value):
98 for x in self._HydroGeneratingUnits:
99 x.HydroPowerPlant = None
100 for y in value:
101 y._HydroPowerPlant = self
102 self._HydroGeneratingUnits = value
104 HydroGeneratingUnits = property(getHydroGeneratingUnits, setHydroGeneratingUnits)
106 def addHydroGeneratingUnits(self, *HydroGeneratingUnits):
107 for obj in HydroGeneratingUnits:
108 obj.HydroPowerPlant = self
110 def removeHydroGeneratingUnits(self, *HydroGeneratingUnits):
111 for obj in HydroGeneratingUnits:
112 obj.HydroPowerPlant = None
114 def getHydroPumps(self):
115 """The hydro pump may be a member of a pumped storage plant or a pump for distributing water
117 return self._HydroPumps
119 def setHydroPumps(self, value):
120 for x in self._HydroPumps:
121 x.HydroPowerPlant = None
122 for y in value:
123 y._HydroPowerPlant = self
124 self._HydroPumps = value
126 HydroPumps = property(getHydroPumps, setHydroPumps)
128 def addHydroPumps(self, *HydroPumps):
129 for obj in HydroPumps:
130 obj.HydroPowerPlant = self
132 def removeHydroPumps(self, *HydroPumps):
133 for obj in HydroPumps:
134 obj.HydroPowerPlant = None
136 def getReservoir(self):
137 """Generators discharge water to or pumps are supplied water from a downstream reservoir
139 return self._Reservoir
141 def setReservoir(self, value):
142 if self._Reservoir is not None:
143 filtered = [x for x in self.Reservoir.HydroPowerPlants if x != self]
144 self._Reservoir._HydroPowerPlants = filtered
146 self._Reservoir = value
147 if self._Reservoir is not None:
148 if self not in self._Reservoir._HydroPowerPlants:
149 self._Reservoir._HydroPowerPlants.append(self)
151 Reservoir = property(getReservoir, setReservoir)
153 def getGenSourcePumpDischargeReservoir(self):
154 """Generators are supplied water from or pumps discharge water to an upstream reservoir
156 return self._GenSourcePumpDischargeReservoir
158 def setGenSourcePumpDischargeReservoir(self, value):
159 if self._GenSourcePumpDischargeReservoir is not None:
160 filtered = [x for x in self.GenSourcePumpDischargeReservoir.UpstreamFromHydroPowerPlants if x != self]
161 self._GenSourcePumpDischargeReservoir._UpstreamFromHydroPowerPlants = filtered
163 self._GenSourcePumpDischargeReservoir = value
164 if self._GenSourcePumpDischargeReservoir is not None:
165 if self not in self._GenSourcePumpDischargeReservoir._UpstreamFromHydroPowerPlants:
166 self._GenSourcePumpDischargeReservoir._UpstreamFromHydroPowerPlants.append(self)
168 GenSourcePumpDischargeReservoir = property(getGenSourcePumpDischargeReservoir, setGenSourcePumpDischargeReservoir)