pfh.glidersim.foil#
Models that combine a 3D foil geometry with an aerodynamics estimator.
Classes
|
A foil geometry that applies a constant airfoil along a chord surface. |
- class pfh.glidersim.foil.SimpleFoil(layout: FoilLayout, sections: FoilSections, b: float | None = None, b_flat: float | None = None, aerodynamics_method: type[FoilAerodynamics] | None = None, aerodynamics_config: dict = {})#
Bases:
object
A foil geometry that applies a constant airfoil along a chord surface.
These are idealized foils that exactly match the scaled chord surface and profiles. Such an idealized shape is only possible for rigid foils that can enforce absolute geometry, unlike flexible foils, which can only attempt to create the target shape through internal structure.
- Parameters
- layoutFoilLayout
Provides the scale, position, and orientation of the section profiles.
- sectionsFoilSections
The geometry and coefficients for the section profiles.
- b, b_flatfloat
The arched and flattened spans of the chords. Specify only one. These function as scaling factors for the FoilLayout.
- aerodynamics_methodFoilAerodynamics, optional
Estimator for the aerodynamic forces and moments.
- aerodynamics_configdictionary, optional
Keyword arguments for instantiating aerodynamics_method
- Attributes
AR
The aspect ratio of the foil.
AR_flat
The aspect ratio of the foil with section dihedral removed.
S
The projected area of the surface.
S_flat
The projected area of the surface with section dihedral removed.
b
The projected span of the foil.
b_flat
The projected span of the foil with section dihedral removed.
Methods
chord_length
(s)Compute section chord lengths.
mass_properties
([N_s, N_r])Compute the quantities that control inertial behavior.
section_orientation
(s[, flatten])Compute section coordinate axes as rotation matrices.
section_thickness
(s, ai, r)Compute section thicknesses.
surface_xyz
(s, ai, r, surface[, flatten])Sample points on section surfaces in foil frd.
r_CP2LE
- __init__(layout: FoilLayout, sections: FoilSections, b: float | None = None, b_flat: float | None = None, aerodynamics_method: type[FoilAerodynamics] | None = None, aerodynamics_config: dict = {}) None #
- property b: float#
The projected span of the foil.
- property b_flat: float#
The projected span of the foil with section dihedral removed.
- property AR: float#
The aspect ratio of the foil.
- property AR_flat: float#
The aspect ratio of the foil with section dihedral removed.
- property S: float#
The projected area of the surface.
This is the conventional definition using the area traced out by the section chords projected onto the xy-plane.
- property S_flat: float#
The projected area of the surface with section dihedral removed.
This is the conventional definition using the area traced out by the section chords projected onto the xy-plane.
- chord_length(s)#
Compute section chord lengths.
- Parameters
- sarray_like of float, shape (N,)
Section index
- Returns
- array_like of float, shape (N,)
The length of the section chord.
- section_orientation(s, flatten: bool = False)#
Compute section coordinate axes as rotation matrices.
- Parameters
- sarray_like of float, shape (N,)
Section index
- flattenbool, optional
Whether to ignore dihedral. Default: False
- Returns
- array of float, shape (N,3)
Rotation matrices encoding section orientation, where the columns are the section (local) x, y, and z coordinate axes.
- section_thickness(s, ai, r)#
Compute section thicknesses.
Note that the thickness is determined by the airfoil convention, so this value may be measured perpendicular to either the chord line or to the camber line. Be careful relying on these values.
NOTE: the airfoil thickness “convention” can dramatically affect this value. For normalized and derotated airfoils with relatively mild camber the convention does not dramatically affect the thickness, but for airfoils with deflected trailing edges it can vary quite a lot. For now, the ai parameter is included to establish the API, but is constrained to zero-indexed profiles (which assumes the ai=0 airfoil is normalized and derotated). Section thickness is in serious need of a design review.
- Parameters
- sarray_like of float
Section index.
- ai
Airfoil index. Must be zero. (See NOTE above.)
- rfloat
Position along the chord or camber line as a percentage, where r = 0 is the leading edge, and r = 1 is the trailing edge.
- surface_xyz(s, ai, r, surface: str, flatten: bool = False)#
Sample points on section surfaces in foil frd.
- Parameters
- sarray_like of float
Section index.
- aifloat
Airfoil index.
- rarray_like of float
Surface coordinate (normalized arc length). Meaning depends on the value of surface.
- surface{“chord”, “camber”, “upper”, “lower”, “airfoil”}
How to interpret the coordinates in r. If “upper” or “lower”, then r is treated as surface coordinates, which range from 0 to 1, and specify points on the upper or lower surfaces, as defined by the intakes. If “airfoil”, then r is treated as raw airfoil coordinates, which must range from -1 to +1, and map from the lower surface trailing edge to the upper surface trailing edge.
- flattenboolean
Whether to flatten the foil by disregarding dihedral (curvature in the yz-plane). This is useful for inflatable wings, such as parafoils. Default: False.
- Returns
- array of float
Coordinates on the section surface in foil frd. The shape is determined by standard numpy broadcasting of s, ai, and r.
- mass_properties(N_s: int = 301, N_r: int = 301)#
Compute the quantities that control inertial behavior.
The inertia matrices returned by this function are proportional to the values for a physical wing, and do not have standard units. They must be scaled by the wing materials and air density to get their physical values. See “Notes” for a thorough description.
- Parameters
- N_sint
The grid resolution over the section index.
- N_rint
The grid resolution over the surface coordinates.
- Returns
- dictionary
- upper_area: float [m^2]
foil upper surface area
- upper_centroid: ndarray of float, shape (3,) [m]
center of mass of the upper surface material in foil frd
- upper_inertia: ndarray of float, shape (3, 3) [m^4]
The inertia matrix of the upper surface
- volume: float [m^3]
internal volume of the inflated foil
- volume_centroid: ndarray of float, shape (3,) [m]
centroid of the internal air mass in foil frd
- volume_inertia: ndarray of float, shape (3, 3) [m^5]
The inertia matrix of the internal volume
- lower_area: float [m^2]
foil lower surface area
- lower_centroid: ndarray of float, shape (3,) [m]
center of mass of the lower surface material in foil frd
- lower_inertia: ndarray of float, shape (3, 3) [m^4]
The inertia matrix of the upper surface
Notes
The foil is treated as a composite of three components: the upper surface, internal volume, and lower surface. Because this class only defines the geometry of the foil, not the physical properties, each component is treated as having unit densities, and the results are proportional to the values for a physical wing. To compute the values for a physical wing, the upper and lower surface inertia matrices must be scaled by the aerial densities [kg/m^2] of the upper and lower wing surface materials, and the volumetric inertia matrix must be scaled by the volumetric density [kg/m^3] of air.
Keeping these components separate allows a user to simply multiply them by different wing material densities and air densities to compute the values for the physical wing.
The volume calculation requires a closed surface mesh, so it ignores air intakes and assumes a closed trailing edge (which is fine for inflatable foils like a paraglider). The concept of using a summation of signed tetrahedron volumes is developed in [1]. This implementation of that idea is from [2], which first computes the inertia tensor of a “canonical tetrahedron” then applies an affine transformation to compute the inertia tensors of each individual tetrahedron.
References
Efficient feature extraction for 2D/3D objects in mesh representation, Zhang and Chen, 2001(?)
How to find the inertia tensor (or other mass properties) of a 3D solid body represented by a triangle mesh, Jonathan Blow, 2004. http://number-none.com/blow/inertia/index.html
- r_CP2LE()#