pterasoftware.geometry.wing_cross_section

Contains the WingCrossSection class.

Classes

WingCrossSection

A class used to contain the wing cross sections of a Wing.

Module Contents

class pterasoftware.geometry.wing_cross_section.WingCrossSection(airfoil: pterasoftware.geometry.airfoil.Airfoil, num_spanwise_panels: int | None, chord: float | int = 1.0, Lp_Wcsp_Lpp: numpy.ndarray | collections.abc.Sequence[float | int] = (0.0, 0.0, 0.0), angles_Wcsp_to_Wcs_ixyz: numpy.ndarray | collections.abc.Sequence[float | int] = (0.0, 0.0, 0.0), control_surface_symmetry_type: str | None = None, control_surface_hinge_point: float = 0.75, control_surface_deflection: float | int = 0.0, spanwise_spacing: str | None = None)[source]

A class used to contain the wing cross sections of a Wing.

Contains the following methods:

__deepcopy__: Creates a deep copy of this WingCrossSection.

T_pas_Wcsp_Lpp_to_Wcs_Lp: Defines a property for the passive transformation matrix which maps in homogeneous coordinates from parent wing cross section axes, relative to the parent leading point, to wing cross section axes, relative to the leading point. Is None if the WingCrossSection hasn’t been fully validated yet.

T_pas_Wcs_Lp_to_Wcsp_Lpp: Defines a property for the passive transformation matrix which maps in homogeneous coordinates from wing cross section axes, relative to the leading point, to parent wing cross section axes, relative to the parent leading point. Is None if the WingCrossSection hasn’t been fully validated yet.

validated: A flag indicating if this WingCrossSection has been fully validated by its parent Wing.

symmetry_type: The symmetry type inherited from the parent Wing.

get_plottable_data: Returns plottable data for this WingCrossSection’s Airfoil’s outline and mean camber line.

validate_root_constraints: Called by the parent Wing to validate constraints specific to root WingCrossSections.

validate_mid_constraints: Called by the parent Wing to validate constraints specific to middle WingCrossSections.

validate_tip_constraints: Called by the parent Wing to validate constraints specific to tip WingCrossSections.

Notes:

Immutable attributes (airfoil, num_spanwise_panels, chord, Lp_Wcsp_Lpp, angles_Wcsp_to_Wcs_ixyz, control_surface_hinge_point, control_surface_deflection, and spanwise_spacing) are set during initialization and cannot be modified afterward. The numpy arrays Lp_Wcsp_Lpp and angles_Wcsp_to_Wcs_ixyz are made read only to prevent in place mutation.

Derived transformation matrices (T_pas_Wcsp_Lpp_to_Wcs_Lp and T_pas_Wcs_Lp_to_Wcsp_Lpp) are lazily evaluated and cached.

The validated and symmetry_type attributes are set once by the parent Wing and cannot be modified after being set.

The control_surface_symmetry_type attribute remains mutable as it may be modified by Airplane.process_wing_symmetry() for type 5 symmetry handling.

The first WingCrossSection in a Wing’s wing_cross_section list is known as the root WingCrossSection. The last is known as the tip WingCrossSection.

Every WingCrossSection has its own wing cross section axes. For root WingCrossSections, their wing cross section axes are identical in position, orientation, and handedness to their Wing’s wing axes. For all other WingCrossSections, their wing cross section axes are defined relative to the axes of the previous WingCrossSection. Locally, the x axis points from a cross section’s leading point to its trailing point, the y axis points spanwise in the general direction of the next WingCrossSection, and the z axis points upwards.

Things can get a little confusing with respect to WingCrossSections for Wings with symmetric or mirror_only set to True. For more details, look in the Wing class’s docstring. Also, remember that WingCrossSections themselves aren’t used by the solvers, they are merely one of the Wing attributes that tell the meshing function how we’d like to generate the Wing’s Panels.

Citation:

Adapted from: geometry.WingXSec in AeroSandbox

Author: Peter Sharpe

Date of retrieval: 04/26/2020

Parameters:
  • airfoil – The Airfoil to be used at this WingCrossSection.

  • num_spanwise_panels – The number of spanwise Panels to be used between this WingCrossSection and the next one. For tip WingCrossSections, it must be None. For all other WingCrossSections, it must be a positive integer.

  • chord – The Wing’s chord at this WingCrossSection. It must be greater than 0.0 and a number (int or float), and will be converted internally to a float. The units are in meters. The default value is 1.0.

  • Lp_Wcsp_Lpp – An array-like object of 3 numbers (int or float) representing the position in meters of this WingCrossSection’s leading edge in parent wing cross section axes, relative to the parent leading edge point. Can be a tuple, list, or ndarray. Values are converted to floats internally. If this is the root WingCrossSection, the parent wing cross section axes are the wing axes and the parent leading point is the Wing’s leading edge root point. If not, the parent axes and point are those of the previous WingCrossSection. If this is the root WingCrossSection, it must be a zero vector. The second component must be non negative. For non root WingCrossSections, the second component must be strictly positive. The units are in meters. The default is (0.0, 0.0, 0.0).

  • angles_Wcsp_to_Wcs_ixyz – An array-like object of 3 numbers (int or float) representing the angle vector of rotation angles that define the orientation of this WingCrossSection’s axes relative to the parent wing cross section axes. Can be a tuple, list, or ndarray. Values are converted to floats internally. If this is a root WingCrossSection, these are the wing axes. If not, the parent axes are the previous WingCrossSection’s axes. For the root WingCrossSection, this must be a zero vector. For other WingCrossSections, all angles must be in the range [-90, 90] degrees. Rotations are intrinsic, and proceed in the xy’z” order. The units are in degrees. The default is (0.0, 0.0, 0.0).

  • control_surface_symmetry_type – Determines how control surfaces behave when the Wing has symmetry. Can be “symmetric”, “asymmetric”, or None. With “symmetric”, mirrored control surfaces have the same deflection (like flaps). With “asymmetric”, mirrored control surfaces have opposite deflections (like ailerons). The default is None. For Wings with type 4 or 5 symmetry, this parameter must be specified. For Wings with type 1, 2, or 3 symmetry, this parameter must be None. This validation is performed by the parent Airplane during Wing processing.

  • control_surface_hinge_point – The location of the control surface hinge from the leading edge as a fraction of chord. It must be a float in the range (0.0, 1.0). The default is 0.75.

  • control_surface_deflection – The control deflection in degrees. Deflection downwards is positive. It must be a number (int or float) in the range [-5.0, 5.0] degrees. It will be converted to a float internally. The default is 0.0 degrees.

  • spanwise_spacing – For non tip WingCrossSections, this can be “cosine” or “uniform”. I highly recommend using cosine spacing. For tip WingCrossSections it must be None. If the parent Wing has explode_into_strips=True, every non tip WingCrossSection must use “uniform” because the explosion distributes parent-relative offsets and twists uniformly across each WingCrossSection’s intermediates.

Returns:

None

property T_pas_Wcsp_Lpp_to_Wcs_Lp: numpy.ndarray | None

Defines a property for the passive transformation matrix which maps in homogeneous coordinates from parent wing cross section axes, relative to the parent leading point, to wing cross section axes, relative to the leading point. Is None if the WingCrossSection hasn’t been fully validated yet.

Returns:

A (4,4) ndarray of floats representing the transformation matrix or None if self.validated=False.

property T_pas_Wcs_Lp_to_Wcsp_Lpp: numpy.ndarray | None

Defines a property for the passive transformation matrix which maps in homogeneous coordinates from wing cross section axes, relative to the leading point, to parent wing cross section axes, relative to the parent leading point. Is None if the WingCrossSection hasn’t been fully validated yet.

Returns:

A (4,4) ndarray of floats representing the transformation matrix or None if self.validated=False.

property validated: bool

A flag indicating if this WingCrossSection has been fully validated by its parent Wing.

Returns:

True if validated, False otherwise.

property symmetry_type: int | None

The symmetry type inherited from the parent Wing.

Returns:

The symmetry type (1, 2, 3, or 4) or None if not yet set.

get_plottable_data(show: bool | numpy.bool_ = False) list[numpy.ndarray] | None[source]

Returns plottable data for this WingCrossSection’s Airfoil’s outline and mean camber line.

Parameters:

show – Determines whether to display the plot. If True, the method displays the plot and returns None. If False, the method returns the data without displaying. Can be a bool or a numpy bool and will be converted internally to a bool. The default is False.

Returns:

None if the WingCrossSection hasn’t been validated, if its symmetry type hasn’t been set, or if show is True. Otherwise, returns a list of two ndarrays. These ndarrays represent points on this WingCrossSection’s Airfoil’s outline and mean camber lines, respectively. The points are in wing cross section axes, relative to the leading point. The units are in meters.

validate_root_constraints() None[source]

Called by the parent Wing to validate constraints specific to root WingCrossSections.

Root WingCrossSections must have Lp_Wcsp_Lpp and angles_Wcsp_to_Wcs_ixyz set to zero vectors. They also must have num_spanwise_panels not None (it’s previously been checked to be None or a positive int).

Returns:

None

validate_mid_constraints() None[source]

Called by the parent Wing to validate constraints specific to middle WingCrossSections.

Middle WingCrossSections must have num_spanwise_panels not None (it’s previously been checked to be None or a positive int). They must also have a strictly positive second component of Lp_Wcsp_Lpp.

Returns:

None

validate_tip_constraints() None[source]

Called by the parent Wing to validate constraints specific to tip WingCrossSections.

Tip WingCrossSections must have num_spanwise_panels and spanwise_spacing set to None. They must also have a strictly positive second component of Lp_Wcsp_Lpp.

Returns:

None