*ARCHIVED* development moved to aircraft-studio.
various inconsistency fix
Changed files
creator.py
@@ -91,13 +91,13 @@
91
91
print('z_l the lower z-coordinates:\n', np.around(self.z_l, round))
92
92
return None
93
93
94
Removed:
def info_save(self, save_dir_path, number):
94
Added:
def info_save(self, save_path, number):
95
95
'''
96
96
Save all the object's coordinates (must be full path).
97
97
'''
98
98
99
99
file_name = '{}_{}.txt'.format(str(self).lower(), number)
100
Removed:
full_path = os.path.join(save_dir_path, file_name)
100
Added:
full_path = os.path.join(save_path, file_name)
101
101
try:
102
102
with open(full_path, 'w') as sys.stdout:
103
103
self.info_print(6)
evaluator.py
@@ -60,7 +60,7 @@
60
60
This function's output is piped to the 'save_data' function below.
61
61
'''
62
62
63
Removed:
name = ' CREATOR DATA '
63
Added:
name = ' EVALUATOR DATA '
64
64
num_of_dashes = len(name)
65
65
66
66
print(num_of_dashes * '-')
@@ -142,13 +142,13 @@
142
142
(len(x_stringers) * area)
143
143
return(x_centroid, z_centroid)
144
144
145
Removed:
def get_I_x():
145
Added:
def get_I_x(self):
146
146
pass
147
147
148
Removed:
def get_I_z():
148
Added:
def get_I_z(self):
149
149
pass
150
150
151
Removed:
def get_I_xz():
151
Added:
def get_I_xz(self):
152
152
pass
153
153
154
154
def analysis(self):
@@ -216,6 +216,4 @@
216
216
plt.gca().set_aspect('equal', adjustable='box')
217
217
plt.grid(axis='both', linestyle=':', linewidth=1)
218
218
plt.show()
219
Removed:
# plt.pause(1)
220
Removed:
# plt.close()
221
219
return None
main.py
@@ -23,8 +23,8 @@
23
23
24
24
# Airfoil dimensions
25
25
NACA_NUM = 2412
26
Removed:
CHORD_LENGTH = 20
27
Removed:
SEMI_SPAN = 20
26
Added:
CHORD_LENGTH = 40
27
Added:
SEMI_SPAN = 50
28
28
29
29
# Component masses
30
30
AIRFOIL_MASS = 10 # lbs
@@ -33,7 +33,7 @@
33
33
34
34
# Area
35
35
STRINGER_AREA = 0.1 # sqin
36
Removed:
TOP_STRINGERS = 4
36
Added:
TOP_STRINGERS = 8
37
37
BOTTOM_STRINGERS = 6
38
38
NOSE_TOP_STRINGERS = 4
39
39
NOSE_BOTTOM_STRINGERS = 7
@@ -62,8 +62,8 @@
62
62
# Define NACA airfoil coordinates and mass
63
63
af.add_naca(NACA_NUM)
64
64
af.add_mass(AIRFOIL_MASS)
65
Removed:
# af.info_print(2)
66
Removed:
# af.info_save(SAVE_PATH, _)
65
Added:
af.info_print(2)
66
Added:
af.info_save(SAVE_PATH, _)
67
67
68
68
# Create spar instance
69
69
af.spar = creator.Spar()
@@ -71,8 +71,8 @@
71
71
af.spar.add_coord(af.coord, 0.15)
72
72
af.spar.add_coord(af.coord, 0.55)
73
73
af.spar.add_mass(SPAR_MASS)
74
Removed:
# af.spar.info_print(2)
75
Removed:
# af.spar.info_save(SAVE_PATH, _)
74
Added:
af.spar.info_print(2)
75
Added:
af.spar.info_save(SAVE_PATH, _)
76
76
77
77
# Create stringer instance
78
78
af.stringer = creator.Stringer()
@@ -84,19 +84,19 @@
84
84
BOTTOM_STRINGERS)
85
85
af.stringer.add_area(STRINGER_AREA)
86
86
af.stringer.add_mass(STRINGER_MASS)
87
Removed:
# af.stringer.info_print(2)
88
Removed:
# af.stringer.info_save(SAVE_PATH, _)
87
Added:
af.stringer.info_print(2)
88
Added:
af.stringer.info_save(SAVE_PATH, _)
89
89
90
90
# Plot components with matplotlib
91
Removed:
# af.plot()
91
Added:
af.plot()
92
92
93
93
# evaluator.Evaluator instance contains airfoil analysis results.
94
94
eval = evaluator.Airfoil(af)
95
95
# The analysis is performed in the evaluator.py module.
96
96
eval.analysis()
97
97
eval.info_print(2)
98
Removed:
# eval.info_save(SAVE_PATH, _)
99
Removed:
# eval.plot()
98
Added:
eval.info_save(SAVE_PATH, _)
99
Added:
eval.plot()
100
100
101
101
# Print final execution time
102
102
print("--- %s seconds ---" % (time.time() - start_time))