-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_velocity_deficit_look_up.py
More file actions
37 lines (25 loc) · 1.08 KB
/
build_velocity_deficit_look_up.py
File metadata and controls
37 lines (25 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import os
import os.path
from miniwake.velocity_deficit_look_up import VelocityDeficitLookUpBuilder
from miniwake.velocity_deficit_look_up import VelocityDeficitLookUp
from miniwake.velocity_deficit import calculate_velocity_deficit
if __name__ == "__main__":
rebuild = False
lookup_path = os.path.join(os.path.dirname(__file__), "look_up")
if not os.path.isdir(lookup_path):
rebuild = True
os.mkdir(lookup_path)
if rebuild:
look_up_builder = VelocityDeficitLookUpBuilder(
dist_downwind_step=0.1,
thrust_coefficient_step=0.1,
turbulence_intensity_step=0.1,
max_dist_downwind=1000.0,
max_turbulence_intensity=0.4,
max_thrust_coefficient=1.0,
print_messages=True)
look_up_builder.save(lookup_path)
look_up = VelocityDeficitLookUp(lookup_path)
print(look_up(0.4, 10, 0.2))
print(calculate_velocity_deficit(0.4, 10, 0.2))
print("Done")