pfh.glidersim.foil_layout#

Models that specify the scale, position, and orientation of foil sections.

Classes

EllipticalArc(mean_anhedral[, tip_anhedral])

Elliptical arc as a function of the section index.

EllipticalChord(root, tip)

Build an elliptical chord distribution as a function of the section index.

FlatYZ()

Helper class for completely flat wings (no dihedral anywhere).

FoilLayout(r_x, x, r_yz, yz, c[, theta, center])

FIXME: docstring.

PolynomialTorsion(start, exponent, peak)

A functor that encodes geometric torsion as a polynomial.

class pfh.glidersim.foil_layout.EllipticalChord(root: float, tip: float)#

Bases: object

Build an elliptical chord distribution as a function of the section index.

Parameters
rootfloat [length]

The length of the central chord

tipfloat [length]

The length of the wing tips

Methods

__call__(s)

Call self as a function.

__init__(root: float, tip: float) None#
__call__(s)#

Call self as a function.

class pfh.glidersim.foil_layout.EllipticalArc(mean_anhedral: float, tip_anhedral: Optional[float] = None)#

Bases: object

Elliptical arc as a function of the section index.

In this context the name is confusing because “arc” has two meanings: one for the traditional “elliptical arc segment”, and one for the “arc” of a foil geometry (which is being modeled by an “elliptical arc segment”).

Expects the section index to be defined as the linear distance along the yz curve (that is, s = y_flat / (b_flat / 2)).

This model scales the curve to a total length of 2, making it suitable for use with FoilLayout which will scale the curve length to b_flat.

Parameters
mean_anhedralfloat [degrees]

The average anhedral angle of the wing sections, measured as the angle between the xy-plane and the line from the central section to the wing tip projected onto the yz-plane.

tip_anhedralfloat [degrees], optional

The anhedral angle of the right wing tip section, measured as the angle between the xy-plane and the section y-axis projected onto the yz-plane. The wing is symmetric, so the left wing tip anhedral is the negative of this value. This optional value must satisfy 2 * mean_anhedral <= tip_anhedral <= 90. If no value is specified the default is 2 * mean_anhedral, which results in a circular arc.

Methods

__call__(s)

Call self as a function.

derivative

__init__(mean_anhedral: float, tip_anhedral: Optional[float] = None) None#
__call__(s)#

Call self as a function.

derivative(s)#
class pfh.glidersim.foil_layout.PolynomialTorsion(start: float, exponent: float, peak: float)#

Bases: object

A functor that encodes geometric torsion as a polynomial.

The domain is [-1, 1], and the range is symmetric about the origin. Inputs 0 <= abs(s) <= start are zero; inputs start < abs(s) <= 1 grow from 0 to peak at a rate controlled by exponent.

For example, if start = 0.5, and exponent = 2, then inputs s between [-0.5, 0.5] are zero, and 0.5 < abs(s) <= 1 grow quadratically to the peak value peak at abs(s) == 1.

Parameters
start: float

Absolute value section index where the curve begins.

exponentfloat

The growth rate. Controls the steepness of the curve.

peakfloat

The peak value of the curve at s = 1.

Methods

__call__(s)

Call self as a function.

__init__(start: float, exponent: float, peak: float) None#
__call__(s)#

Call self as a function.

class pfh.glidersim.foil_layout.FlatYZ#

Bases: object

Helper class for completely flat wings (no dihedral anywhere).

Methods

__call__(s)

Define (y, z) = (s, 0) for all sections.

derivative(s)

Define (dyds, dzds) = (1, 0) for all sections.

__call__(s)#

Define (y, z) = (s, 0) for all sections.

derivative(s)#

Define (dyds, dzds) = (1, 0) for all sections.

class pfh.glidersim.foil_layout.FoilLayout(r_x: Union[float, Callable], x: Union[float, Callable], r_yz: Union[float, Callable], yz, c: Union[float, Callable], theta: Union[float, Callable] = 0, center: bool = True)#

Bases: object

FIXME: docstring. Describe the geometry.

All input values must be normalized by b_flat = 2. Output values can be scaled as needed to achieve a given b, b_flat, S, or S_flat.

Conceptually, this specifies a design target: an idealized goal to produce with a physical foil. Rigid foils can create this surface exactly, but flexible wings, like parafoils, can only approximate this shape through the internal structure of cells.

Parameters
r_xfloat or callable

A ratio from 0 to 1 that defines what location on each chord is located at the x-coordinate defined by x. This can be a constant or a function of the section index. For example, r_x = 1 says that x is specifying the x-coordinate of the trailing edge.

xfloat or callable

The x-coordinates of each section as a function of the section index. Each chord is shifted forward until the x-coordinate of its leading edge is at c * r_x.

r_yzfloat or callable

A ratio from 0 to 1 that defines the chord position of the yz curve. This can be a constant or a function of the section index. For example, r_yz = 0.25 says that the yz curve is specifying the yz-coordinates of the quarter-chord.

yzcallable

The yz-coordinates of each section as a function of the section index. This curve shapes the yz-plane view of the inflated wing. Must be a functor with a derivative method.

cfloat or callable

The section chord lengths as a function of section index.

thetafloat or callable, optional

Geometric torsion as a function of the section index. These angles specify a positive rotation about the local (section) y-axis. Values must be in radians. Default: 0 at all sections.

centerbool, optional

Whether to center the surface such that the leading edge of the central section defines the origin. Default: True

Notes

Normalizing everything by b_flat = 2 simplifies the equations since section indices s are on the same scale as the spatial coordinates. (If you flatten yz, then y is just s.)

Attributes
AR

Compute the projected aspect ratio of the foil.

AR_flat

Compute the flattened aspect ratio of the foil.

S

Compute the projected area of the surface.

S_flat

Compute the projected area of the flattened surface.

Methods

orientation(s[, flatten])

Compute section coordinate axes as rotation matrices.

xyz(s, r[, flatten])

Compute the coordinates of points on section chords in canopy frd.

__init__(r_x: Union[float, Callable], x: Union[float, Callable], r_yz: Union[float, Callable], yz, c: Union[float, Callable], theta: Union[float, Callable] = 0, center: bool = True) None#
property AR: float#

Compute the projected aspect ratio of the foil.

property AR_flat: float#

Compute the flattened aspect ratio of the foil.

property S: float#

Compute 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#

Compute the projected area of the flattened surface.

This is the conventional definition using the area traced out by the section chords projected onto the xy-plane.

orientation(s, flatten: bool = False)#

Compute section coordinate axes as rotation matrices.

Parameters
sarray_like of float, shape (N,)

Section index

flattenbool

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.

xyz(s, r, flatten: bool = False)#

Compute the coordinates of points on section chords in canopy frd.

Parameters
sarray_like of float, shape (N,)

Section index

rfloat

Position on the chords as a percentage, where r = 0 is the leading edge, and r = 1 is the trailing edge.

flattenboolean

Whether to flatten the chord surface by disregarding dihedral (curvature in the yz-plane). This is useful for inflatable wings, such as parafoils. Default: False.