wingstructure.structure package

Submodules

wingstructure.structure.beammechanics module

class wingstructure.structure.beammechanics.Crosssection(geometries_orig, youngsmoduli, shearmoduli, thickness)

Bases: object

c4_point()
deformation_element(forces)
deformation_vec(forces)
dist_c4_shearcenter()
integrate_nsGt(shearforce)
integrate_sGt()
moment_shearflow(shearforce)
plot_around_profil(shearflow)
shearcenter()
shearflow_cell(shearforce)
shearflow_open(shearforce)
shearflow_shearforce(shearforce)
shearflow_torsion(torsionalmoment)
shearflow_total(shearforce, torsionalmoment)
shearforce_and_torsionalmoment(shearforce, torsionalmoment)
stress_element(forces)
test_continuity(shearflow)
transform_shearforce(shearforce)
twist(shearforce, torsionalmoment)
wingstructure.structure.beammechanics.EA(geometry, youngsmoduli, thickness)
wingstructure.structure.beammechanics.EI(geometry, youngsmoduli, thickness)
wingstructure.structure.beammechanics.ES(geometry, youngsmoduli, thickness)
wingstructure.structure.beammechanics.ES_circulate(geometry, youngsmoduli, thickness)
wingstructure.structure.beammechanics.lift(ρ, v, c_l, c)
wingstructure.structure.beammechanics.moment(ρ, v, c_m, c)
wingstructure.structure.beammechanics.polygonarea(polygon)
wingstructure.structure.beammechanics.transform(vec, Θ)

wingstructure.structure.internalreactions module

wingstructure.structure.internalreactions.calc_lineloadresultants(ys, q)

Calculate resultants of line loads acting on individual segments

wingstructure.structure.internalreactions.calc_moments(coords, discrete_loads)

Calculates cummulated forces and moments

wingstructure.structure.internalreactions.combine_loads(loadslist)

wingstructure.structure.mass module

This module contains the Masspoint class for center of gravity calculations

class wingstructure.structure.mass.Masspoint(mass: float, point: tuple)

Bases: object

Masspoints can be added to get the sum of masses and the common center of gravity

wingstructure.structure.material module

class wingstructure.structure.material.IsotropicMaterial(ρ, E, G)

Bases: wingstructure.structure.material._AbstractMaterial

wingstructure.structure.polygon module

Module for structural section analysis based on polygon geometry definition.

Inside this module basis formulas for calculation of area, static moments and moments of inertia based on polygon geometry are defined. Furthermore functions for calculation of the derived quanities neutral center and principal axis angle are included. For a simplified application to sections defined with section module the class StructuralAnalysis is also included.

Hint

All coordinate sequences passed directly to the low level functions (not the class) have to be defined in a clockwise manner.

class wingstructure.structure.polygon.StructuralAnalysis(structure)

Bases: object

Class for structural analysis of Sections or Features

Parameters:structure (SectionBase or Feature) – structure element to be analysed
nc

Neutralcenter of structure, available after calling update

Type:np.array
area

Overall Area of structure, available after calling update

Type:float
bendingstiffness

bending stiffness of structure, available after calling update

Type:np.array
update()
wingstructure.structure.polygon.calcarea(outline)

Calculate area within polygon

Parameters:outline (np.array) – 2D coordinates of a polygon area
Returns:area within outline
Return type:float
wingstructure.structure.polygon.calcinertiamoments(outline)

Calculate moment of inertia for given polygon

Parameters:outline (np.array) – 2D coordinates of a polygon area
Returns:moments of inertia (I_xx, I_yy, I_xy)
Return type:tuple(float)
wingstructure.structure.polygon.calcneutralcenter(outline)

Calculate the neutral center of polygon

Parameters:outline (np.array) – 2D coordinates of a polygon area
Returns:(x_n, y_n)
Return type:tuple(float)
wingstructure.structure.polygon.calcprincipalaxis(I_xx, I_yy, I_xy)

Calculates angle of first principal axis

Parameters:
  • I_xx (float) – area moment of inertia
  • I_yy (float) – area moment of inertia
  • I_xy (float) – area moment of inertia
Returns:

principal axis angle

Return type:

float

wingstructure.structure.polygon.calcstaticmoments(outline)

Calculate the static moment of a polygon

Parameters:outline (np.array) – 2D coordinates of a polygon area
Returns:static moments
Return type:tuple(float)
wingstructure.structure.polygon.transform_intertiamoments(I_xx, I_yy, I_xy, φ)

Transform moments of inertia from into rotated coordinate system

Parameters:
  • I_xx (float) – area moment of inertia
  • I_yy (float) – area moment of inertia
  • I_xy (float) – area moment of inertia
  • φ (float) – angle to roatet
Returns:

moment of inertia in rotated coordinate system

Return type:

tuple of floats

wingstructure.structure.section module

Module for representation of wing section’s structure

This module defines classes which allow definition of a wing section as chain of multiple structure elements. Definition of a structure starts with SectionBase, which stores airfoil coordinates. Beginning with this exterior geometry structure elements can be added from out to inside. Possible Elements are Layers, covering the whole surface, Reinforcements for higher stiffness locally and Spar elements (ISpar and BoxSpar).

Example

import numpy as np
from wingstructure import structure

# Load cooardinates
coords = np.loadtxt('ah93157.dat', skiprows=1) * 1.2
sectionbase = structure.SectionBase(coords)

# Define Material
import collections
Material = collections.namedtuple('Material', ['ρ'])

carbonfabric = Material(1.225)
foam = Material(1.225)
sandwich = Material(1.225)

# create layers
outerlayer = structure.Layer(carbonfabric, 5e-4)
core = structure.Layer(foam, 1e-2)
innerlayer = structure.Layer(carbonfabric, 5e-4)

# create Spar
spar = structure.ISpar(material={'flange': carbonfabric, 'web': sandwich},
                       midpos=0.45,
                       flangewidth=0.2,
                       flangethickness=0.03,
                       webpos=0.5,
                       webthickness=0.02)

 # add to sectionbase
 sectionbase.extend([outerlayer, core, innerlayer, spar])

# Analyse Mass
massana = structure.MassAnalysis(sectionbase)
cg, mass = massana.massproperties()
wingstructure.structure.section.ArrayStruc

alias of wingstructure.structure.section.ArrayGeom

class wingstructure.structure.section.BoxSpar(material, midpos: float, width: float, flangeheigt, webwidth)

Bases: wingstructure.structure.section._AbstractBaseStructure

Representation for box spar

Parameters:
  • parent – Parent structure element.
  • material – Material defintion.
  • midpos (float) – Chord position of spar (absolute)
  • width (float) – width of spar
  • flangeheight (float) – thickness of flanges (symmetric)
  • webwidth (float) – thickness of web
interior

shapely geometry representation of interior

flangeheight
massproperties
midpos
webwidth
width
class wingstructure.structure.section.ISpar(material, midpos: float, flangewidth: float, flangethickness: float, webpos: float, webthickness: float)

Bases: wingstructure.structure.section._AbstractBaseStructure

Representation for I or double-T Spar

Parameters:
  • parent – Parent structure element.
  • material – Material defintion.
  • midpos (float) – Chord position of spar (absolute)
  • flangewidth (float) – width of flanges
  • flangethickness (float) – thickness of flanges (symmetric)
  • webpos (float) – position of web at flange (relative, 0 - left, 1 - right)
  • webthickness (float) – thickness of wepropertyb
interior

shapely geometry representation of interior

Raises:Exception – when geometry cannot be created with choosen parameters
flangethickness
flangewidth
massproperties
midpos
webpos
webpos_abs()
webthickness
class wingstructure.structure.section.Layer(material, thickness=0.0)

Bases: wingstructure.structure.section._AbstractBaseStructure

Layer of constant thickness representation

Parameters:
  • parent – Structure Element
  • material – Material definition
  • thickness (float) – The Layers geometric thickness
interior

shapely geometry representation of interior

enclosed_area()

Calculate area enclosed by centerline

Returns:ecnlosed area
Return type:float
middle_circumference()

Calculate circumference of centerline

Returns:circumference value
Return type:float
thickness
class wingstructure.structure.section.LineIdealisation(sectionbase)

Bases: object

Idealisation of section for structural analysis

Currently only section consisting of a I-Spar and one Layer can be idealized.

Parameters:parent – last element of structure feature chain to be analysed
export()
geometry
class wingstructure.structure.section.MassAnalysis(sectionbase)

Bases: object

Analyse Mass of Structure

Parameters:parent – last element of structure elment chain to be analysed
massproperties
class wingstructure.structure.section.Reinforcement(material, thickness=0.0, limits=None)

Bases: wingstructure.structure.section.Layer

Local reinforcement structure

Parameters:
  • parent – Parent structure Element
  • material – Material Defintion
  • thickness – reinforcement thickness
  • limits – bounds for reinforcement in chordwise direction
interior

shapely geometry representation of interior

class wingstructure.structure.section.SectionBase(airfoil_coordinates)

Bases: object

Foundation for section’s wing structure description

Parameters:airfoil_coordinates (np.ndarray) – airfoils coordinates from dat file
interior

representation of airfoil as shapely geometry

Type:shapely.geometry.LinearRing
append(newfeature)
exportgeometry(refpoint=array([0., 0.]))
extend(newfeatures)
insert(index, newfeature)
pop()
remove(feature)
wingstructure.structure.section.geom2array(geometry, refpoint=array([0., 0.]))

Helper function to export polygon geometry from shapely to numpy arrays based format

Parameters:
  • geometry (shapely.Polygon) – Geometrie to be exported (must be a Polygon)
  • refpoint (np.array, optional) – reference point (2D), will be substracted from coordinates (the default is np.zeros(2)
Raises:

ValueError – Wrong geometry type given..

Returns:

Custom geometry and material container

Return type:

ArrayStruc

wingstructure.structure.section.rework_svg(svg: str, width: float, height: float = 100.0, stroke_width: float = None) → str

Prettify svgs generated by shapely

Parameters:
  • svg (str) – svg definitiom
  • width (float) – with of returned svg
  • height (int, optional) – height of returned svg (the default is 100)
  • stroke_width (float, optional) – width of lines in svg (the default is None, which [default_description])
Raises:

Exception – raised when input svg string is invalid

Returns:

prettified svg string

Return type:

str

Module contents