Esempio n. 1
0
 def __init__(self):
     self.sample_inputs = SampleInputs()
     self.coordinates = [
         [0.0, 10.0],   # layout x
         [10.0, 20.0]  # layout y
     ]
     self.turbines = [
         copy.deepcopy(Turbine(self.sample_inputs.turbine)),
         copy.deepcopy(Turbine(self.sample_inputs.turbine))
     ]
     self.instance = self._build_instance()
Esempio n. 2
0
 def _build_input_dict(self):
     wake = Wake(self.sample_inputs.wake)
     turbine = Turbine(self.sample_inputs.turbine)
     turbine_map = TurbineMap(
         [0.0, 100.0], [0.0, 0.0],
         [copy.deepcopy(turbine),
          copy.deepcopy(turbine)])
     return {
         "wind_direction": 270.0,
         "wind_speed": 8.0,
         "wind_shear": 0.0,
         "wind_veer": 0.0,
         "turbulence_intensity": 1.0,
         "air_density": 1.225,
         "wake": wake,
         "turbine_map": turbine_map
     }
Esempio n. 3
0
def flow_field_fixture(sample_inputs_fixture):
    wake = Wake(sample_inputs_fixture.wake)
    turbine = Turbine(sample_inputs_fixture.turbine)
    turbine_map = TurbineMap(
        [0.0, 100.0], [0.0, 0.0], [copy.deepcopy(turbine), copy.deepcopy(turbine)]
    )
    farm_prop = sample_inputs_fixture.farm["properties"]
    wind_map = WindMap(
        wind_speed=farm_prop["wind_speed"],
        layout_array=(farm_prop["layout_x"], farm_prop["layout_y"]),
        wind_layout=(farm_prop["wind_x"], farm_prop["wind_y"]),
        turbulence_intensity=farm_prop["turbulence_intensity"],
        wind_direction=farm_prop["wind_direction"],
    )
    return FlowField(
        farm_prop["wind_shear"],
        farm_prop["wind_veer"],
        farm_prop["air_density"],
        wake,
        turbine_map,
        wind_map,
        farm_prop["specified_wind_height"],
    )
Esempio n. 4
0
def turbine_map_fixture(sample_inputs_fixture):
    return TurbineMap(
        sample_inputs_fixture.farm["properties"]["layout_x"],
        sample_inputs_fixture.farm["properties"]["layout_y"],
        3 * [Turbine(sample_inputs_fixture.turbine)],
    )