Skip to content

Commit eedf553

Browse files
committed
Raise ValueError for unphysical WindTrubine
1 parent 80019f7 commit eedf553

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

windpowerlib/wind_turbine.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,11 @@ def __init__(self, hub_height, nominal_power=None, path='oedb',
163163
if self.rotor_diameter is None and turbine_data is not None:
164164
self.rotor_diameter = float(turbine_data['rotor_diameter'])
165165

166+
if self.rotor_diameter:
167+
if self.hub_height <= 0.5*self.rotor_diameter:
168+
msg = "1/2*rotor_diameter cannot be higher than hub_height"
169+
raise ValueError(msg)
170+
166171
if self.power_curve is None and self.power_coefficient_curve is None:
167172
msg = ("The WindTurbine has been initialised without a power curve"
168173
" and without a power coefficient curve.\nYou will not be"

0 commit comments

Comments
 (0)