*ARCHIVED* development moved to aircraft-studio.
deleted redundant camber x_c (same as local list x_chord)
creator.py
@@ -99,7 +99,7 @@
99
99
# This line required to reset behavior of sys.stdout
100
100
sys.stdout = sys.__stdout__
101
101
print('Successfully wrote to file {}'.format(full_path))
102
Removed:
except:
102
Added:
except IOError:
103
103
print('Unable to write {} to specified directory.\n'
104
104
.format(file_name),
105
105
'Was the full path passed to the function?')
@@ -150,9 +150,8 @@
150
150
151
151
def get_camber(x):
152
152
"""
153
Removed:
Returns 1 camber y-coordinate from 1 'x' along the airfoil chord.
153
Added:
Returns camber y-coordinate from 1 'x' along the airfoil chord.
154
154
"""
155
Removed:
x_c = x
156
155
y_c = float()
157
156
if 0 <= x < p_c:
158
157
y_c = (m / (p**2)) * (2 * p * (x / self.chord)
@@ -161,7 +160,7 @@
161
160
y_c = (m / ((1 - p)**2)) * ((1 - 2 * p)
162
161
+ 2 * p * (x / self.chord)
163
162
- (x / self.chord)**2)
164
Removed:
return (x_c, y_c * self.chord)
163
Added:
return (y_c * self.chord)
165
164
166
165
def get_thickness(x):
167
166
"""
@@ -185,25 +184,13 @@
185
184
return theta
186
185
187
186
def get_upper_coordinates(x):
188
Removed:
x_u = float()
189
Removed:
z_u = float()
190
Removed:
if 0 <= x < self.chord:
191
Removed:
x_u = x - get_thickness(x) * sin(get_theta(x))
192
Removed:
z_u = get_camber(x)[1] + get_thickness(x) * cos(get_theta(x))
193
Removed:
elif x == self.chord:
194
Removed:
x_u = x - get_thickness(x) * sin(get_theta(x))
195
Removed:
z_u = 0 # Make upper curve finish at y = 0
187
Added:
x_u = x - get_thickness(x) * sin(get_theta(x))
188
Added:
z_u = get_camber(x) + get_thickness(x) * cos(get_theta(x))
196
189
return (x_u, z_u)
197
190
198
191
def get_lower_coordinates(x):
199
Removed:
x_l = float()
200
Removed:
z_l = float()
201
Removed:
if 0 <= x < self.chord:
202
Removed:
x_l = (x + get_thickness(x) * sin(get_theta(x)))
203
Removed:
z_l = (get_camber(x)[1] - get_thickness(x) * cos(get_theta(x)))
204
Removed:
elif x == self.chord:
205
Removed:
x_l = (x + get_thickness(x) * sin(get_theta(x)))
206
Removed:
z_l = 0 # Make lower curve finish at y = 0
192
Added:
x_l = x + get_thickness(x) * sin(get_theta(x))
193
Added:
z_l = get_camber(x) - get_thickness(x) * cos(get_theta(x))
207
194
return (x_l, z_l)
208
195
209
196
# Generate our airfoil geometry from previous sub-functions.
@@ -212,11 +199,10 @@
212
199
# Densify x-coordinates 10 times for first 10% of the chord length
213
200
x_chord = [x / 10 for x in range(x_chord_10_percent * 10)]
214
201
x_chord.extend([x for x in range(x_chord_10_percent, self.chord + 1)])
215
Removed:
print(x_chord)
216
202
217
203
for x in x_chord:
218
Removed:
self.x_c.append(get_camber(x)[0])
219
Removed:
self.y_c.append(get_camber(x)[1])
204
Added:
self.x_c.append(x)
205
Added:
self.y_c.append(get_camber(x))
220
206
self.x_u.append(get_upper_coordinates(x)[0])
221
207
self.z_u.append(get_upper_coordinates(x)[1])
222
208
self.x_l.append(get_lower_coordinates(x)[0])