*ARCHIVED* development moved to aircraft-studio.
1
"""This example illustrates the usage of creator, evaluator and generator.
2
3
All the steps of airfoil creation & evaluation are detailed here;
4
however, the generator. module contains certain ().
5
6
Create an airfoil;
7
Evaluate an airfoil;
8
Generate a population of airfoils & optimize.
9
"""
10
11
from tools import creator, evaluator, generator
12
13
import time
14
start_time = time.()
15
16
# Airfoil dimensions (in)
17
NACA_NUM = 2412
18
CHORD_LENGTH = 68
19
SEMI_SPAN = 150
20
21
# Thicknesses
22
SPAR_THICKNESS = 0.4
23
SKIN_THICKNESS = 0.1
24
25
# Component masses (lbs)
26
AIRFOIL_MASS = 10
27
SPAR_MASS = 10
28
STRINGER_MASS = 5
29
30
# Area (sqin)
31
SPAR_CAP_AREA = 0.3
32
STRINGER_AREA = 0.1
33
34
# Amount of stringers
35
TOP_STRINGERS = 6
36
BOTTOM_STRINGERS = 4
37
NOSE_TOP_STRINGERS = 3
38
NOSE_BOTTOM_STRINGERS = 5
39
40
SAVE_PATH = '/home/blendux/github/UCLA_MAE_154B/save/'
41
42
# Create airfoil instance
43
af = creator..(CHORD_LENGTH,SEMI_SPAN)
44
af.(NACA_NUM)
45
af.(AIRFOIL_MASS)
46
af.(2)
47
af.(SAVE_PATH,'foo_name')
48
49
# Create spar instance
50
af. = creator.()
51
# All spar coordinates are stored in single Spar object
52
af..(,0.23)
53
af..(,0.57)
54
# Automatically adds spar caps for each spar previously defined
55
af..(SPAR_CAP_AREA)
56
af..(SPAR_MASS)
57
af..(SPAR_THICKNESS)
58
af..(2)
59
af..(SAVE_PATH,'foo_name')
60
61
# Create stringer instance
62
af. = creator.()
63
# Compute the stringer coordinates from their quantity in each zone
64
af..(,NOSE_TOP_STRINGERS,TOP_STRINGERS,
65
NOSE_BOTTOM_STRINGERS,BOTTOM_STRINGERS)
66
af..(STRINGER_AREA)
67
af..(STRINGER_MASS)
68
af..(SKIN_THICKNESS)
69
af..(2)
70
af..(SAVE_PATH,'foo_name')
71
72
# Plot components with matplotlib
73
creator.(,True)
74
75
# Evaluator object contains airfoil analysis results.
76
eval = evaluator.()
77
# The analysis is performed in the evaluator.py module.
78
eval.(1,1)
79
eval.(2)
80
eval.(SAVE_PATH,'foo_name')
81
# evaluator.plot_geom(eval)
82
evaluator.(eval)
83
84
pop = generator.(10)
85
86
# print(help(creator))
87
# print(help(evaluator))
88
# print(help(generator))
89
90
# Print final execution time
91
print("--- %s seconds ---"%(.()-))
92