diff options
Diffstat (limited to 'creator/wing.py')
-rw-r--r-- | creator/wing.py | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/creator/wing.py b/creator/wing.py index cc7d29a..472e928 100644 --- a/creator/wing.py +++ b/creator/wing.py @@ -40,13 +40,20 @@ class Airfoil(base.Component): semi_span=150, material=mt.aluminium): super().__init__(parent, name) + parent.wing = self if chord > 20: self.chord = chord else: self.chord = 20 logging.debug('Chord too small, using minimum value of 20.') + parent self.semi_span = semi_span self.material = material + self.spars = [] + self.stringers = [] + + def __str__(self): + return self.name def add_naca(self, naca_num): """Generate surface geometry for a NACA airfoil. @@ -139,7 +146,8 @@ class Spar(base.Component): def __init__(self, parent, name, loc_percent=0.30, material=mt.aluminium): """Set spar location as percent of chord length.""" super().__init__(parent, name) - super().set_material(material) + parent.spars.append(self) + self.material = material self.cap_area = float() # bi.bisect_left: returns index of first value in parent.x > loc # This ensures that spar geom intersects with airfoil geom. @@ -165,8 +173,17 @@ class Spar(base.Component): class Stringer(base.Component): """Contains the coordinates of all stringers.""" - def __init__(self): + def __init__(self, parent, name, den_u, den_l, den_un, den_ul): + """ + parameters: + + den_u: upper stringer density + den_l: lower stringer density + den_un: upper nose stringer density + den_ul: upper nose stringer density + """ super().__init__() + parent.stringers.append(self) self.x_start = [] self.x_end = [] self.z_start = [] |