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
.IEC61970
.Generation
.Production
.GeneratingUnit
import GeneratingUnit
23 class HydroGeneratingUnit(GeneratingUnit
):
24 """A generating unit whose prime mover is a hydraulic turbine (e.g., Francis, Pelton, Kaplan)
27 def __init__(self
, energyConversionCapability
="generator", hydroUnitWaterCost
=0.0, HydroPowerPlant
=None, PenstockLossCurve
=None, HydroGeneratingEfficiencyCurves
=None, TailbayLossCurve
=None, *args
, **kw_args
):
28 """Initialises a new 'HydroGeneratingUnit' instance.
30 @param energyConversionCapability: Energy conversion capability for generating. Values are: "generator", "pumpAndGenerator"
31 @param hydroUnitWaterCost: The equivalent cost of water that drives the hydro turbine, expressed as cost per volume.
32 @param HydroPowerPlant: The hydro generating unit belongs to a hydro power plant
33 @param PenstockLossCurve: A hydro generating unit has a penstock loss curve
34 @param HydroGeneratingEfficiencyCurves: A hydro generating unit has an efficiency curve
35 @param TailbayLossCurve: A hydro generating unit has a tailbay loss curve
37 #: Energy conversion capability for generating. Values are: "generator", "pumpAndGenerator"
38 self
.energyConversionCapability
= energyConversionCapability
40 #: The equivalent cost of water that drives the hydro turbine, expressed as cost per volume.
41 self
.hydroUnitWaterCost
= hydroUnitWaterCost
43 self
._HydroPowerPlant
= None
44 self
.HydroPowerPlant
= HydroPowerPlant
46 self
._PenstockLossCurve
= None
47 self
.PenstockLossCurve
= PenstockLossCurve
49 self
._HydroGeneratingEfficiencyCurves
= []
50 self
.HydroGeneratingEfficiencyCurves
= [] if HydroGeneratingEfficiencyCurves
is None else HydroGeneratingEfficiencyCurves
52 self
._TailbayLossCurve
= []
53 self
.TailbayLossCurve
= [] if TailbayLossCurve
is None else TailbayLossCurve
55 super(HydroGeneratingUnit
, self
).__init
__(*args
, **kw_args
)
57 _attrs
= ["energyConversionCapability", "hydroUnitWaterCost"]
58 _attr_types
= {"energyConversionCapability": str, "hydroUnitWaterCost": float}
59 _defaults
= {"energyConversionCapability": "generator", "hydroUnitWaterCost": 0.0}
60 _enums
= {"energyConversionCapability": "HydroEnergyConversionKind"}
61 _refs
= ["HydroPowerPlant", "PenstockLossCurve", "HydroGeneratingEfficiencyCurves", "TailbayLossCurve"]
62 _many_refs
= ["HydroGeneratingEfficiencyCurves", "TailbayLossCurve"]
64 def getHydroPowerPlant(self
):
65 """The hydro generating unit belongs to a hydro power plant
67 return self
._HydroPowerPlant
69 def setHydroPowerPlant(self
, value
):
70 if self
._HydroPowerPlant
is not None:
71 filtered
= [x
for x
in self
.HydroPowerPlant
.HydroGeneratingUnits
if x
!= self
]
72 self
._HydroPowerPlant
._HydroGeneratingUnits
= filtered
74 self
._HydroPowerPlant
= value
75 if self
._HydroPowerPlant
is not None:
76 if self
not in self
._HydroPowerPlant
._HydroGeneratingUnits
:
77 self
._HydroPowerPlant
._HydroGeneratingUnits
.append(self
)
79 HydroPowerPlant
= property(getHydroPowerPlant
, setHydroPowerPlant
)
81 def getPenstockLossCurve(self
):
82 """A hydro generating unit has a penstock loss curve
84 return self
._PenstockLossCurve
86 def setPenstockLossCurve(self
, value
):
87 if self
._PenstockLossCurve
is not None:
88 self
._PenstockLossCurve
._HydroGeneratingUnit
= None
90 self
._PenstockLossCurve
= value
91 if self
._PenstockLossCurve
is not None:
92 self
._PenstockLossCurve
.HydroGeneratingUnit
= None
93 self
._PenstockLossCurve
._HydroGeneratingUnit
= self
95 PenstockLossCurve
= property(getPenstockLossCurve
, setPenstockLossCurve
)
97 def getHydroGeneratingEfficiencyCurves(self
):
98 """A hydro generating unit has an efficiency curve
100 return self
._HydroGeneratingEfficiencyCurves
102 def setHydroGeneratingEfficiencyCurves(self
, value
):
103 for x
in self
._HydroGeneratingEfficiencyCurves
:
104 x
.HydroGeneratingUnit
= None
106 y
._HydroGeneratingUnit
= self
107 self
._HydroGeneratingEfficiencyCurves
= value
109 HydroGeneratingEfficiencyCurves
= property(getHydroGeneratingEfficiencyCurves
, setHydroGeneratingEfficiencyCurves
)
111 def addHydroGeneratingEfficiencyCurves(self
, *HydroGeneratingEfficiencyCurves
):
112 for obj
in HydroGeneratingEfficiencyCurves
:
113 obj
.HydroGeneratingUnit
= self
115 def removeHydroGeneratingEfficiencyCurves(self
, *HydroGeneratingEfficiencyCurves
):
116 for obj
in HydroGeneratingEfficiencyCurves
:
117 obj
.HydroGeneratingUnit
= None
119 def getTailbayLossCurve(self
):
120 """A hydro generating unit has a tailbay loss curve
122 return self
._TailbayLossCurve
124 def setTailbayLossCurve(self
, value
):
125 for x
in self
._TailbayLossCurve
:
126 x
.HydroGeneratingUnit
= None
128 y
._HydroGeneratingUnit
= self
129 self
._TailbayLossCurve
= value
131 TailbayLossCurve
= property(getTailbayLossCurve
, setTailbayLossCurve
)
133 def addTailbayLossCurve(self
, *TailbayLossCurve
):
134 for obj
in TailbayLossCurve
:
135 obj
.HydroGeneratingUnit
= self
137 def removeTailbayLossCurve(self
, *TailbayLossCurve
):
138 for obj
in TailbayLossCurve
:
139 obj
.HydroGeneratingUnit
= None