From 0658183612f39bae5cf0083befa226de5a2653d9 Mon Sep 17 00:00:00 2001 From: Marius Peter Date: Mon, 24 Jun 2019 20:20:15 -0700 Subject: split 'add_web' into creator for coords and evaluator for math --- creator.py | 19 +++++++++++++++++++ evaluator.py | 7 ++++++- main.py | 10 ++++++---- 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/creator.py b/creator.py index 40a25bc..df714a8 100644 --- a/creator.py +++ b/creator.py @@ -232,6 +232,11 @@ class Spar(Coordinates): def __init__(self): super().__init__(parent.chord, parent.semi_span) + self.x_start = [] + self.x_end = [] + self.thickness = float() + self.z_start = [] + self.z_end = [] def add_coord(self, airfoil, x_loc_percent): ''' @@ -269,6 +274,17 @@ class Spar(Coordinates): self.mass = len(self.x) * mass return None + def add_webs(self, skin_thickness): + '''Add webs to spars.''' + + for _ in range(len(self.x)): + self.x_start.append(self.x[_][0]) + self.x_end.append(self.x[_][1]) + self.thickness = skin_thickness + self.z_start.append(self.z[_][0]) + self.z_end.append(self.z[_][1]) + return None + class Stringer(Coordinates): '''Contains the coordinates of all stringers.''' @@ -347,6 +363,9 @@ class Stringer(Coordinates): self.mass = len(self.x) * mass + len(self.x) * mass return None + def add_webs(self, thickness): + pass + def info_print(self, round): super().info_print(round) print('Stringer Area:\n', np.around(self.area, round)) diff --git a/evaluator.py b/evaluator.py index d5e5ee3..c2429d1 100644 --- a/evaluator.py +++ b/evaluator.py @@ -222,7 +222,12 @@ def plot_geom(evaluator): plt.plot(evaluator.chord / 4, 0, '.', color='g', markersize=24, label='Quarter-chord') # Plot airfoil surfaces - plt.fill(evaluator.x, evaluator.z, color='b', linewidth='1', fill=False) + x = [0.98 * x for x in evaluator.x] + y = [0.98 * z for z in evaluator.z] + plt.fill(x, y, color='w', linewidth='1', fill=False) + x = [1.02 * x for x in evaluator.x] + y = [1.02 * z for z in evaluator.z] + plt.fill(x, y, color='b', linewidth='1', fill=False) # Plot spars try: diff --git a/main.py b/main.py index 0a5dc7f..b015f6f 100644 --- a/main.py +++ b/main.py @@ -27,9 +27,9 @@ NACA_NUM = 2412 CHORD_LENGTH = 68 # inches SEMI_SPAN = 150 # inches -# Airfoil thickness -T_UPPER = 0.1 -T_LOWER = 0.1 +# Thicknesses +SPAR_THICKNESS = 0.4 +SKIN_THICKNESS = 0.1 # Component masses AIRFOIL_MASS = 10 # lbs @@ -78,9 +78,10 @@ def main(): # Define the spar coordinates and mass, stored in single spar object af.spar.add_coord(af, 0.20) af.spar.add_coord(af, 0.65) - # Automatically adds spar caps for all spars previously defined + # Automatically adds spar caps for every previously defined af.spar.add_spar_caps(SPAR_CAP_AREA) af.spar.add_mass(SPAR_MASS) + af.spar.add_webs(SPAR_THICKNESS) # af.spar.info_print(2) af.spar.info_save(SAVE_PATH, _) @@ -94,6 +95,7 @@ def main(): BOTTOM_STRINGERS) af.stringer.add_area(STRINGER_AREA) af.stringer.add_mass(STRINGER_MASS) + af.stringer.add_webs(SKIN_THICKNESS) # af.stringer.info_print(2) af.stringer.info_save(SAVE_PATH, _) -- cgit v1.2.3