split 'add_web' into creator for coords and evaluator for math

Commit
0658183612f39bae5cf0083befa226de5a2653d9
Author
Marius Peter <blendoit@gmail.com>
Author date
Committer
Marius Peter <blendoit@gmail.com>
Committer date
Changed files
creator.py
index 40a25bc7..df714a8b 100644..100644
@@ -232,6 +232,11 @@
232 232
233 233 def __init__(self):
234 234 super().__init__(parent.chord, parent.semi_span)
235 Added: self.x_start = []
236 Added: self.x_end = []
237 Added: self.thickness = float()
238 Added: self.z_start = []
239 Added: self.z_end = []
235 240
236 241 def add_coord(self, airfoil, x_loc_percent):
237 242 '''
@@ -269,7 +274,18 @@
269 274 self.mass = len(self.x) * mass
270 275 return None
271 276
277 Added: def add_webs(self, skin_thickness):
278 Added: '''Add webs to spars.'''
272 279
280 Added: for _ in range(len(self.x)):
281 Added: self.x_start.append(self.x[_][0])
282 Added: self.x_end.append(self.x[_][1])
283 Added: self.thickness = skin_thickness
284 Added: self.z_start.append(self.z[_][0])
285 Added: self.z_end.append(self.z[_][1])
286 Added: return None
287 Added:
288 Added:
273 289 class Stringer(Coordinates):
274 290 '''Contains the coordinates of all stringers.'''
275 291 global parent
@@ -346,6 +362,9 @@
346 362 def add_mass(self, mass):
347 363 self.mass = len(self.x) * mass + len(self.x) * mass
348 364 return None
365 Added:
366 Added: def add_webs(self, thickness):
367 Added: pass
349 368
350 369 def info_print(self, round):
351 370 super().info_print(round)
evaluator.py
index d5e5ee30..c2429d15 100644..100644
@@ -222,7 +222,12 @@
222 222 plt.plot(evaluator.chord / 4, 0, '.', color='g',
223 223 markersize=24, label='Quarter-chord')
224 224 # Plot airfoil surfaces
225 Removed: plt.fill(evaluator.x, evaluator.z, color='b', linewidth='1', fill=False)
225 Added: x = [0.98 * x for x in evaluator.x]
226 Added: y = [0.98 * z for z in evaluator.z]
227 Added: plt.fill(x, y, color='w', linewidth='1', fill=False)
228 Added: x = [1.02 * x for x in evaluator.x]
229 Added: y = [1.02 * z for z in evaluator.z]
230 Added: plt.fill(x, y, color='b', linewidth='1', fill=False)
226 231
227 232 # Plot spars
228 233 try:
main.py
index 0a5dc7fb..b015f6fd 100644..100644
@@ -27,9 +27,9 @@
27 27 CHORD_LENGTH = 68 # inches
28 28 SEMI_SPAN = 150 # inches
29 29
30 Removed: # Airfoil thickness
31 Removed: T_UPPER = 0.1
32 Removed: T_LOWER = 0.1
30 Added: # Thicknesses
31 Added: SPAR_THICKNESS = 0.4
32 Added: SKIN_THICKNESS = 0.1
33 33
34 34 # Component masses
35 35 AIRFOIL_MASS = 10 # lbs
@@ -78,9 +78,10 @@
78 78 # Define the spar coordinates and mass, stored in single spar object
79 79 af.spar.add_coord(af, 0.20)
80 80 af.spar.add_coord(af, 0.65)
81 Removed: # Automatically adds spar caps for all spars previously defined
81 Added: # Automatically adds spar caps for every previously defined
82 82 af.spar.add_spar_caps(SPAR_CAP_AREA)
83 83 af.spar.add_mass(SPAR_MASS)
84 Added: af.spar.add_webs(SPAR_THICKNESS)
84 85 # af.spar.info_print(2)
85 86 af.spar.info_save(SAVE_PATH, _)
86 87
@@ -94,6 +95,7 @@
94 95 BOTTOM_STRINGERS)
95 96 af.stringer.add_area(STRINGER_AREA)
96 97 af.stringer.add_mass(STRINGER_MASS)
98 Added: af.stringer.add_webs(SKIN_THICKNESS)
97 99 # af.stringer.info_print(2)
98 100 af.stringer.info_save(SAVE_PATH, _)
99 101