In [1]:
import numpy as np
import collections as col
from wingstructure import structure

Define materials


In [2]:
Material = col.namedtuple('Material', ['ρ'])

fabric = Material(ρ=0.3e3)
foam = Material(ρ=0.18e3)

Define structure

import dat file


In [3]:
# load airfoil.dat file
coords = np.loadtxt('airfoils/ah93157.dat', skiprows=1)*1.2

# initialize base for section analysis
secbase = structure.SectionBase(coords)
secbase


Out[3]:

add structure elements


In [5]:
# create an outer layer from fabric with thickness 0.003 m
out = structure.Layer(secbase, fabric, 3e-3)
# create sandwich core from foam, thickness 0.01
core = structure.Layer(out, foam, 1e-2)
# create another fabric layer
inner = structure.Layer(core, fabric, 3e-3)
# create spar
spar = structure.ISpar(inner, {'flange': fabric, 'web': fabric}, 0.5, 0.300, 3e-2, 0.8, 1e-3)
spar


Out[5]:

In [6]:
with open('section.svg','w') as afile:
    afile.write(spar._repr_svg_())

Analyse mass


In [7]:
massana = structure.MassAnalysis(spar)
massana.massproperties


Out[7]:
(array([0.54128247, 0.0346968 ]), 13.748299126744147)