pytornado.aero package¶
Submodules¶
pytornado.aero.vlm module¶
Functions for the discretisation of the aircraft geometry into panels.
Developed for AIRINNOVA AB, Stockholm, Sweden.
-
pytornado.aero.vlm.calc_boundary(lattice, state, vlmdata)¶ Generate boundary conditions (RHS term) for VLM.
Pre-allocate memory for the (num_p x 1) right-hand-side array. The right-hand side terms are computed in C, directly into this memory.
- Args:
lattice: (object) data structure for VLM lattice state: (object) data structure for flight state vlmdata: (object) data structure for VLM input and output
-
pytornado.aero.vlm.calc_downwash(lattice, vlmdata)¶ Generate downwash factors for aircraft lattice.
Pre-allocate memory for the (num_p x num_p) downwash factor matrix. The downwash calculations are performed in C, directly into this matrix.
Display matrix condition number in console and log file.
- Args:
lattice: (object) data structure for VLM lattice vlmdata: (object) data structure for VLM input and output
-
pytornado.aero.vlm.calc_results(lattice, state, vlmdata)¶ Calculate inwash at collocation points
- Args:
lattice: (object) data structure for VLM lattice state: (object) data structure for flight state vlmdata: (object) data structure for VLM input and output
-
pytornado.aero.vlm.gen_lattice(aircraft, state, settings, make_new_subareas=True)¶ Generate aircraft lattice
Perform count of number of wings, segments, controls, panels and strips. Pre-allocate memory for lattice data, which is directly operated on in C.
The function py2c_lattice is called which generates the VLM lattice. The following lattice data (for all panel) is generated:
lattice.p: panel corner points lattice.v: panel vortex filament endpoints lattice.c: panel collocation point lattice.n: panel normal vector lattice.a: panel surface area
When py2c_lattice is called it takes the following input arguments:
lattice: pre-allocated memory for the struct described above array_segments: segment corner points (N*4*3) array_airfoils: file names for airfoils at inner and outer segment (N*2) array_symmetry: segment symmetry information (N) array_panels: number of chordwise and spanwise panels for each segment (N*2)
Display lattice metrics in console and log file.
- Args:
aircraft: (object) data structure for aircraft geometry state: (object) data structure for flight state settings: (object) data structure for execution settings make_new_subareas: Flag - Returns:
lattice: (object) data structure for VLM lattice
-
pytornado.aero.vlm.pre_panelling(aircraft)¶ Create subdivisions and subareas for all aircraft wings
- Note:
- This routine divides the wing into subdivisions and subareas in order to generate a suitable mesh for wing with control surfaces.
- In a first step “mandatory” subdivisions are made: The wing is divided into a minimum amount of subareas according to the leading and trailing edge control surfaces.
- In a second step further spanwise subdivisions are added.
- Args:
aircraft: (obj) aircraft object
-
pytornado.aero.vlm.set_autopanels(aircraft, settings)¶ Automatically set chord- and spanwise discretisation settings
- Args:
aircraft: (object) data structure for aircraft geometry autopanels_c: (int) number of chordwise panels on the main wing autopanels_s: (int) number of spanwise panels on the main wing
-
pytornado.aero.vlm.solver(vlmdata)¶ Solve linear system for vortex strengths
- Args:
vlmdata: (object) data structure for VLM input and output
Module contents¶
The aero package contains the Python modules and C/C++ libraries used in the calculation of aerodynamic loads using the Vortex-Lattice Method.
The aero.vlm module contains the Python functions that prepare and pre-allocate the aircraft, state and lattice data for the C wrapper functions contained in aero.c_vlm.
The aero.c_vlm file contains the wrapper functions required to interpret and operate on incoming data from Python and NumPy, using the native APIs. From here, calls are made to the pure-C subroutines for the Vortex-Lattice Method calculations. These are contained in separate files:
aero.c_lattice: lattice generation
aero.c_downwash: calculation of the downwash coefficients
aero.c_boundary: calculation of the right-hand side terms
aero.c_results: calculation of velocities, forces, coefficients
The .cpp and .h files must be compiled to a dynamic library c_vlm.so or c_vlm.dll, manually or using the provided Makefile.