File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -110,3 +110,14 @@ def test_wrongly_defined_to_group_method(self):
110110 "parameter are mutually exclusive." ,
111111 ):
112112 e_t_1 .to_group (5 , 3000 )
113+
114+ def test_create_unphysical_turbine (self ):
115+ err_msg = "1/2rotor_diameter cannot be greater than hub_height"
116+ char = {
117+ 'hub_height' : 80 ,
118+ 'rotor_diameter' : 160 ,
119+ 'turbine_type' : 'DUMMY 3' ,
120+ 'path' : self .source
121+ }
122+ with pytest .raises (ValueError , match = err_msg ):
123+ WindTurbine (** char )
Original file line number Diff line number Diff line change @@ -175,6 +175,11 @@ def __init__(
175175 if self .rotor_diameter is None and turbine_data is not None :
176176 self .rotor_diameter = float (turbine_data ["rotor_diameter" ])
177177
178+ if self .rotor_diameter :
179+ if self .hub_height <= 0.5 * self .rotor_diameter :
180+ msg = "1/2rotor_diameter cannot be greater than hub_height"
181+ raise ValueError (msg )
182+
178183 if self .power_curve is None and self .power_coefficient_curve is None :
179184 msg = (
180185 "The WindTurbine has been initialised without a power curve"
You can’t perform that action at this time.
0 commit comments