StNode module

Classes for generation of structural nodes.

Revision:

1.0.0 $Date: 26/01/2023 10:59$

History:
  1. 1.0.0 - Initial Class Creation

Todo

The currenct cod has a limited number of cross sections. Extension to “n” section is highly recommended.

Todo

This code is complicated and should be rewritten much simply.

class StNode.StNode[source]

Bases: object

Class for generation of structural model. Conctivity, material, geometrical boundary conditions.

Input files:
  • ‘winggeom.ini’ (ASCII): information of Outer Mold Line.

  • ‘stlayout.ini’ (ASCII): information of structural layout.

Output files:
  • ‘Nodes.pickle’ (binary): coordinates of structural nodes.

Examples:

Example of modle generation

>>> NodeGen = StNode()
>>> NodeGen.Run_main()

Todo

This code is complicated and should be rewritten much simply.

__init__()[source]

StNode Class Initialization.

Input files:
  • ‘winggeom.ini’ (ASCII): information of Outer Mold Line.

  • ‘stlayout.ini’ (ASCII): information of structural layout.

  • ‘dict_airfoil.csv’ (ASCII): key -> “airfoil name”, value -> “airfoil path”

Parameters

None

Returns

None

Documentation last updated: Jan. 23, 2023 - Shugo Date

Get_df_LoadNodes()[source]

export coordinate on wingbox surface

Parameters

None

Returns

nodal coordinates on wingbox surface

Return type

self.df_LoadNodes (pd.DataFrame)

Documentation last updated: Jan. 26, 2023 - Shugo Date

Get_df_FEMNodes()[source]

export coordinate of wingbox

Parameters

None

Returns

nodal coordinates of wingbox

Return type

self.df_FEMNodes (pd.DataFrame)

Documentation last updated: Jan. 26, 2023 - Shugo Date

GetNodes()[source]

Administrator of node generation

Procedure:
  • arrange airfoil section based on Outer Mold Line info.

  • generate spar points on 3 section

  • generate skin points (= rib points)

  • generate carry through points

Parameters

None

Returns

None

Documentation last updated: Jan. 26, 2023 - Shugo Date

__TransformAirfoilData(Airfoil, Length, Chord, Dihedral, SweepBack, WashOut)

Arrange airfoil section according to OML info.

Procedure:
  • read airfoil

  • make transform matrix (T: translation, S: scaling, R: rotation)

  • matrix operation

Parameters
  • Airfoil (string) – path to the airfoil file

  • Length (float) – length in spanwise direction

  • Chord (float) – length in chordwise direction

  • Dihedral (float) – dihedral angle from horizontal plane

  • SweebBack (float) – sweepback angle from spanwise axis

  • WashOut (float) – washout angle from horizoutal plane

Returns

coordinate of upper airfoil AFLower (ndarray): coordinate of lower airfoil

Return type

AFUpper (ndarray)

Documentation last updated: Jan. 26, 2023 - Shugo Date

__read_airfoil(file, type)

airfoil reader

Parameters
  • file (string) – path to the airfoil file

  • type (string) – format of airfoil file (Selig, Bezier, Plain, Labeled, etc.)

Returns

coordinate of upper airfoil AFLower (ndarray): coordinate of lower airfoil

Return type

AFUpper (ndarray)

Todo

This module is recommended to be generalized in another python program, and used as like >>> import airfoil_reader

Todo

Extension to another file format is recommended. Add if sentence according to your format.

Documentation last updated: Jan. 26, 2023 - Shugo Date

__Planform2TS(Length, Chord, Dihedral, SweepBack, WashOut)

generate transformation matrix of airfoil

Parameters
  • Length (float) – length in spanwise direction

  • Chord (float) – length in chordwise direction

  • Dihedral (float) – dihedral angle from horizontal plane

  • SweebBack (float) – sweepback angle from spanwise axis

  • WashOut (float) – washout angle from horizoutal plane

Returns

translation matrix S (ndarray): scaling matrix R (nadrray): rotation matrix

Return type

T (ndarray)

Documentation last updated: Jan. 26, 2023 - Shugo Date

__TransformAF(AF, S, T, R)

generate transformation matrix of airfoil

Parameters
  • AF (ndarray) – airfoil coordinate before tranformation

  • T (ndarray) – translation matrix

  • S (ndarray) – scaling matrix

  • R (nadrray) – rotation matrix

Returns

airfoil coordinate after transformation

Return type

Points_Output (ndarray)

Documentation last updated: Jan. 26, 2023 - Shugo Date

__GetSparPoints(AFUpper, AFLower, Length, Chord, Dihedral, SweepBack, FrontSparPosition, RearSparPosition, FrontSparPositionW1, RearSparPositionW1, SparType)

generate nodes of spars on root, kink, tip plane

Parameters
  • AFUpper (ndarray) – airfoil coordinates on upper surface

  • AFLpper (ndarray) – airfoil coordinates on lower surface

  • Length (float) – length in spanwise direction

  • Chord (float) – length in chordwise direction

  • Dihedral (float) – dihedral angle from horizontal plane

  • SweebBack (float) – sweepback angle from spanwise axis

  • Position (RearSpar) – 0 to 1 value of front spar on kink and tip plane

  • Position – 0 to 1 value of rear spar on kink and tip plane

  • PositionW1 (RearSpar) – 0 to 1 value of front spar on root plane

  • PositionW1 – 0 to 1 value of rear spar on root plane

Returns

coordinates of spar nodes on root, kink, and tip plane

Return type

points (ndarray)

Documentation last updated: Jan. 26, 2023 - Shugo Date

__InterpSparPoint(AF, SparPosition, Chord, Length, SweepBack)

calculate spar coordinate on a plane

Parameters
  • AF (ndarray) – airfoil coordinates on upper or lower surface

  • Length (float) – length in spanwise direction

  • Chord (float) – length in chordwise direction

  • SweebBack (float) – sweepback angle from spanwise axis

Returns

coordinates of spar nodes on a plane

Return type

points (ndarray)

Documentation last updated: Jan. 26, 2023 - Shugo Date

__GetPoint(AF, xnew)

calculate coordinate on airfoil at a specific coordinate x

Parameters
  • AF (ndarray) – airfoil coordinates on upper or lower surface

  • xnew (float) – x coordinate to calculate y

Returns

y coordinate corresponding to x

Return type

ynew (float)

Todo

It’s better to use higher order interpolation.

Documentation last updated: Jan. 26, 2023 - Shugo Date

__FrontSparIntersection(x1, x2, z1, z2)

interpolate spar line if front spar layout is straight

Parameters
  • x1 (float) – coordinate of spar in chord wise axis on kink plane

  • x2 (float) – coordinate of spar in chord wise axis on tiop plane

  • z1 (float) – coordinate of spar in span wise axis on kink plane

  • z2 (float) – coordinate of spar in span wise axis on tiop plane

Returns

coordinate of spar in chord wise axis on root plane

Return type

x (float)

Todo

It’s better to use higher order interpolation.

Documentation last updated: Jan. 26, 2023 - Shugo Date

__AFScaled2Rib(AFScaled, n, SparRearPoint, SparFrontPoint, Length)

gererate grid by a node number in a chordwise direction

Parameters
  • AFScaled (ndarray) – coordinate of node in chord wise axis

  • n (float) – number of mesh in chord wised direction

  • SparRearPoint (float) – coordinate of rear spar in chord wise direction

  • SparFrontPoint (float) – coordinate of front spar in chord wise direction

  • Length (float) – length in spanwise direction

Returns

coordinates of skin points (=rib points)

Return type

AF_Output (ndarray)

Documentation last updated: Jan. 26, 2023 - Shugo Date

GetRibPoints(NumberOfRibsInner, NumberOfRibsOuter, AFUpper_new, AFLower_new, Accuracy, Length, Chord, SweepBack, RearSparPosition, RearSparPositionW1, RibType)[source]

generated skin (=rib) points corresponding to ribs

Rib type

Definition

1

all ribs are parallel to flow (aerodynamic chord)

2

innter ribs are parallel to flow and outer ribs are vertical to front spar

3

all ribs are vertical to rear spar + the first rib is modified in natural

4

innter ribs are parallel to flow and outer ribs are vertical to front spar and ribs are change naturally in kink

Parameters
  • NumberOfRibInner (int) – number of rib from root to kink

  • NumberOfRibOuter (int) – number of rib from kink to tip

  • AFUpper_new (ndarray) – nodal coordinates of upper surface on root, kink, and tip plane

  • AFLower_new (ndarray) – nodal coordinates of lower surface on root, kink, and tip plane

  • Length (float) – length in spanwise direction

  • Chord (float) – length in chordwise direction

  • SweebBack (float) – sweepback angle from spanwise axis

  • RearSparPosition (float) – 0 to 1 value of rear spar on kink and tip plane

  • RearSparPositionW1 (float) – 0 to 1 value of rear spar on root plane

  • RibType (int) – type of rib

Returns

nodal coordinates of upper ribs (=skins) SkinLower (ndarray): nodal coordinates of lower ribs (=skins)

Return type

SkinUpper (ndarray)

Documentation last updated: Jan. 26, 2023 - Shugo Date

MakeRibPoints(NumberOfRibs, AF1, AF2, Accuracy, l1, l2, c1, c2, SweepBack, RearSparPosition, RibType)[source]

generated skin (=rib) points between plane 1 and plane 2

Parameters
  • NumberOfRibInner (int) – number of rib from root to kink

  • AF1 (ndarray) – airfoil coordinate on root side plane

  • AF2 (ndarray) – airfoil coordinate on tip side plane

  • Accuracy (int) – number of mesh in chord wised direction

  • l1 (float) – semispan length on root side plane

  • l2 (float) – semispan length on tip side plane

  • c1 (float) – chord length on root side plane

  • c2 (float) – chord length on tip side plane

  • SweebBack (float) – sweepback angle from spanwise axis

  • RearSparPosition (float) – 0 to 1 value of rear spar

  • RibType (int) – type of methods to generate rib

Returns:

Documentation last updated: Jan. 26, 2023 - Shugo Date

GetRib(PlaneRib, AF1, AF2)[source]

generate rib (=skin) nodes

Parameters
  • PlaneRib (sympy.Plane) – a plane of a rib

  • AF1 (ndarray) – a plane of a rib

  • AF2 (sympy.Plane object) – a plane of a rib

Returns

coordinates of a rib

Return type

Rib (ndarray)

Documentation last updated: Jan. 26, 2023 - Shugo Date

AFPoints2Line(AF1, AF2)[source]

generate line between 2 airfoil sections

Parameters
  • AF1 (ndarray) – airfoil coordinate on root side plane

  • AF2 (ndarray) – airfoil coordinate on tip side plane

Returns

line between 2 airfoil sections

Return type

Length (sympy.Line3D)

Documentation last updated: Jan. 26, 2023 - Shugo Date

Plane2Rib(PlaneRib, Length)[source]

generate rib nodes

Parameters
  • PlaneRib (sympy.Plane) – a plane of a rib

  • Length (sympy.Line3D) – line between 2 airfoil sections

Returns

coordinates of a rib

Return type

Rib_Output (ndarray)

Documentation last updated: Jan. 26, 2023 - Shugo Date

GetCenterWing(Accuracy, NumberOfRibs, AFUpper, AFLower, Length, Chord, Dihedral, SweepBack, RearSparPosition, RibType)[source]

generate rib nodes of carry through

Parameters
  • Accuracy (int) – number of mesh in chord wised direction

  • NumberOfRibs (int) – number of rib in carry through

  • AFUpper (ndarray) – coordinate of upper airfoil

  • AFLower (ndarray) – coordinate of lower airfoil

  • Length (float) – length in spanwise direction

  • Chord (float) – length in chordwise direction

  • Dihedral (float) – dihedral angle from horizontal plane

  • SweebBack (float) – sweepback angle from spanwise axis

  • RearSparPosition (float) – 0 to 1 value of rear spar

  • Ribtype (int) – type of ribs

Returns

coordinates of upper skins (=ribs) in carry through CenterWingboxLower (ndarray): coordinates of lower skins (=ribs) in carry through AFCenterUpper (ndarray): coordinates of upper airfoil on plane of symmetry AFCenterLower (ndarray): coordinates of lower airfoil on plane of symmetry

Return type

CenterWingboxUpper (ndarray)

Documentation last updated: Jan. 26, 2023 - Shugo Date

MakeCenterWing(Accuracy, NumberOfRibs, AF, l1, l2, c1, c2, Dihedral, SweepBack, RearSparPosition, RibType)[source]

generate rib nodes of carry through

Parameters
  • Accuracy (int) – number of mesh in chord wised direction

  • NumberOfRibs (int) – number of rib in carry through

  • AF (ndarray) – coordinate of airfoil on root plane

  • l1 (float) – semispan length on root side plane (plane of symmetry)

  • l2 (float) – semispan length on tip side plane (root plane)

  • c1 (float) – chord length on root side plane (plane of symmetry)

  • c2 (float) – chord length on tip side plane (root plane)

  • SweebBack (float) – sweepback angle from spanwise axis

  • RearSparPosition (float) – 0 to 1 value of rear spar

  • RibType (int) – type of methods to generate rib

Returns

coordinates skins (=ribs) in carry through AFCenter (ndarray): coordinates of airfoil on plane of symmetry

Return type

CenterWingbox (ndarray)

Documentation last updated: Jan. 26, 2023 - Shugo Date

__MakeLoadNodes4CFD()

generate DataFrame of nodal coordinates on surface

Parameters

None

Returns

None

Documentation last updated: Jan. 26, 2023 - Shugo Date

__TransformLoadNodes()

convert coordinate system

(chord-span-vetical) before (x, z, -y) -> after (x, y, z)

Parameters

None

Returns

None

Documentation last updated: Jan. 26, 2023 - Shugo Date

__MakeNodes4FEM()

generate DataFrame of nodal coordinates of wingbox

Parameters

None

Returns

None

Documentation last updated: Jan. 26, 2023 - Shugo Date

__TransformFEMNodes()

convert coordinate system

(chord-span-vetical) before (x, z, -y) -> after (x, y, z)

Parameters

None

Returns

None

Documentation last updated: Jan. 26, 2023 - Shugo Date

Export_gridStruct()[source]

Export normalized surface nodes as dat

Parameters

None

Returns

None

Note

coordinates are normalized by root chord

Documentation last updated: Jan. 26, 2023 - Shugo Date

Export_df_LoadNodes()[source]

Export DataFrame of surface nodes as csv

Parameters

None

Returns

None

Documentation last updated: Jan. 26, 2023 - Shugo Date

Export_df_FEMNodes()[source]

Export DataFrame of nodes as csv

Parameters

None

Returns

None

Documentation last updated: Jan. 26, 2023 - Shugo Date

ExportNodesAsPickle()[source]

Export DataFrame of nodes as pickle

Parameters

None

Returns

None

Documentation last updated: Jan. 26, 2023 - Shugo Date

Run_main()[source]

main sequence

Procedure:
  1. set airfoil sections based on Outer Mold Line geometry

  2. get spar line based on spar position and spar type

  3. get rib plane based on rib type

  4. get points by calculating intersection between spar lines and rib planes

  5. get points of carrythrough

  6. export

Parameters

None

Returns

None

Documentation last updated: Jan. 26, 2023 - Shugo Date