pterasoftware.movements.aeroelastic_wing_movement

Contains the AeroelasticWingMovement class.

Classes

AeroelasticWingMovement

A class used to contain a Wing’s movement in an aeroelastic simulation.

Module Contents

class pterasoftware.movements.aeroelastic_wing_movement.AeroelasticWingMovement(base_wing: pterasoftware.geometry.wing.Wing, wing_cross_section_movements: list[pterasoftware.movements.aeroelastic_wing_cross_section_movement.AeroelasticWingCrossSectionMovement], ampLer_Gs_Cgs: numpy.ndarray | collections.abc.Sequence[float | int] = (0.0, 0.0, 0.0), periodLer_Gs_Cgs: numpy.ndarray | collections.abc.Sequence[float | int] = (0.0, 0.0, 0.0), spacingLer_Gs_Cgs: numpy.ndarray | collections.abc.Sequence[str | collections.abc.Callable[[float], float]] = ('sine', 'sine', 'sine'), phaseLer_Gs_Cgs: numpy.ndarray | collections.abc.Sequence[float | int] = (0.0, 0.0, 0.0), ampAngles_Gs_to_Wn_ixyz: numpy.ndarray | collections.abc.Sequence[float | int] = (0.0, 0.0, 0.0), periodAngles_Gs_to_Wn_ixyz: numpy.ndarray | collections.abc.Sequence[float | int] = (0.0, 0.0, 0.0), spacingAngles_Gs_to_Wn_ixyz: numpy.ndarray | collections.abc.Sequence[str | collections.abc.Callable[[float], float]] = ('sine', 'sine', 'sine'), phaseAngles_Gs_to_Wn_ixyz: numpy.ndarray | collections.abc.Sequence[float | int] = (0.0, 0.0, 0.0), rotationPointOffset_Gs_Ler: numpy.ndarray | collections.abc.Sequence[float | int] = (0.0, 0.0, 0.0), spacingAnglesSecondDerivative_Gs_to_Wn_ixyz: collections.abc.Sequence[collections.abc.Callable[[float], float] | None] | None = None)[source]

A class used to contain a Wing’s movement in an aeroelastic simulation.

In aeroelastic simulations, wing geometry is prescribed via oscillation parameters (the same oscillation based generation as WingMovement), but the solver adds structural deformation at each time step. This class overrides generate_wing_at_time_step to accept per WingCrossSection deformation angles that are threaded down to its AeroelasticWingCrossSectionMovement children.

Contains the following methods:

__deepcopy__: Creates a deep copy of this AeroelasticWingMovement.

all_periods: All unique non zero periods from this AeroelasticWingMovement and its AeroelasticWingCrossSectionMovements.

max_period: The longest period of AeroelasticWingMovement’s own motion and that of its sub movement objects.

generate_wing_at_time_step: Creates the Wing at a single time step, optionally applying structural deformation to each WingCrossSection.

generate_wings: Creates the Wing at each time step, and returns them in a list.

Notes:

Wings cannot undergo motion that causes them to switch symmetry types. A transition between types could change the number of Wings and the Panel structure, which is incompatible with the unsteady solver. This happens when an AeroelasticWingMovement defines motion that causes its base Wing’s wing axes’ yz plane and its symmetry plane to transition from coincident to non coincident, or vice versa. This is checked by this AeroelasticWingMovement’s parent AeroelasticAirplaneMovement’s parent AeroelasticMovement.

Parameters:
  • base_wing – The base Wing from which the Wing at each time step will be created.

  • wing_cross_section_movements – A list of AeroelasticWingCrossSectionMovements associated with each of the base Wing’s WingCrossSections. It must have the same length as the base Wing’s list of WingCrossSections.

  • ampLer_Gs_Cgs – An array-like object of non negative numbers (int or float) with shape (3,) representing the amplitudes of the AeroelasticWingMovement’s changes in its Wings’ Ler_Gs_Cgs parameters. Can be a tuple, list, or ndarray. Values are converted to floats internally. Each amplitude must be low enough that it doesn’t drive its base value out of the range of valid values. Otherwise, this AeroelasticWingMovement will try to create Wings with invalid parameters values. The units are in meters. The default is (0.0, 0.0, 0.0).

  • periodLer_Gs_Cgs – An array-like object of non negative numbers (int or float) with shape (3,) representing the periods of the AeroelasticWingMovement’s changes in its Wings’ Ler_Gs_Cgs parameters. Can be a tuple, list, or ndarray. Values are converted to floats internally. Each element must be 0.0 if the corresponding element in ampLer_Gs_Cgs is 0.0 and non zero if not. The units are in seconds. The default is (0.0, 0.0, 0.0).

  • spacingLer_Gs_Cgs – An array-like object of strs or callables with shape (3,) representing the spacing of the AeroelasticWingMovement’s change in its Wings’ Ler_Gs_Cgs parameters. Can be a tuple, list, or ndarray. Each element can be the string “sine”, the string “uniform”, or a callable custom spacing function. Custom spacing functions are for advanced users and must start at 0.0, return to 0.0 after one period of 2.0 * pi radians, have amplitude of 1.0, be periodic, return finite values only, and accept a float as input and return a float. The custom function is scaled by ampLer_Gs_Cgs, shifted horizontally and vertically by phaseLer_Gs_Cgs and the base value, and have a period set by periodLer_Gs_Cgs. The default is (“sine”, “sine”, “sine”).

  • phaseLer_Gs_Cgs – An array-like object of numbers (int or float) with shape (3,) representing the phase offsets of the elements in the first time step’s Wing’s Ler_Gs_Cgs parameter relative to the base Wing’s Ler_Gs_Cgs parameter. Can be a tuple, list, or ndarray. Values must lie in the range (-180.0, 180.0] and will be converted to floats internally. Each element must be 0.0 if the corresponding element in ampLer_Gs_Cgs is 0.0 and non zero if not. The units are in degrees. The default is (0.0, 0.0, 0.0).

  • ampAngles_Gs_to_Wn_ixyz – An array-like object of numbers (int or float) with shape (3,) representing the amplitudes of the AeroelasticWingMovement’s changes in its Wings’ angles_Gs_to_Wn_ixyz parameters. Can be a tuple, list, or ndarray. Values must lie in the range [0.0, 180.0] and will be converted to floats internally. Each amplitude must be low enough that it doesn’t drive its base value out of the range of valid values. Otherwise, this AeroelasticWingMovement will try to create Wings with invalid parameters values. The units are in degrees. The default is (0.0, 0.0, 0.0).

  • periodAngles_Gs_to_Wn_ixyz – An array-like object of numbers (int or float) with shape (3,) representing the periods of the AeroelasticWingMovement’s changes in its Wings’ angles_Gs_to_Wn_ixyz parameters. Can be a tuple, list, or ndarray. Values are converted to floats internally. Each element must be 0.0 if the corresponding element in ampAngles_Gs_to_Wn_ixyz is 0.0 and non zero if not. The units are in seconds. The default is (0.0, 0.0, 0.0).

  • spacingAngles_Gs_to_Wn_ixyz – An array-like object of strs or callables with shape (3,) representing the spacing of the AeroelasticWingMovement’s change in its Wings’ angles_Gs_to_Wn_ixyz parameters. Can be a tuple, list, or ndarray. Each element can be the string “sine”, the string “uniform”, or a callable custom spacing function. Custom spacing functions are for advanced users and must start at 0.0, return to 0.0 after one period of 2.0 * pi radians, have amplitude of 1.0, be periodic, return finite values only, and accept a float as input and return a float. The custom function is scaled by ampAngles_Gs_to_Wn_ixyz, shifted horizontally and vertically by phaseAngles_Gs_to_Wn_ixyz and the base value, with the period set by periodAngles_Gs_to_Wn_ixyz. A component set to a custom callable must be paired with a matching spacingAnglesSecondDerivative_Gs_to_Wn_ixyz component, and a “sine” or “uniform” component must not be; see that parameter for the full pairing rule. The default is (“sine”, “sine”, “sine”).

  • phaseAngles_Gs_to_Wn_ixyz – An array-like object of numbers (int or float) with shape (3,) representing the phase offsets of the elements in the first time step’s Wing’s angles_Gs_to_Wn_ixyz parameter relative to the base Wing’s angles_Gs_to_Wn_ixyz parameter. Can be a tuple, list, or ndarray. Values must lie in the range (-180.0, 180.0] and will be converted to floats internally. Each element must be 0.0 if the corresponding element in ampAngles_Gs_to_Wn_ixyz is 0.0 and non zero if not. The units are in degrees. The default is (0.0, 0.0, 0.0).

  • rotationPointOffset_Gs_Ler – An array-like object of 3 numbers (int or float) representing the position of the rotation point for the Wing’s angular motion (in geometry axes after accounting for symmetry, relative to the leading edge root point). Can be a tuple, list, or ndarray. Values are converted to floats internally. This offset defines where the Wing rotates about when angles_Gs_to_Wn_ixyz oscillates. When set to (0, 0, 0), rotation occurs about the leading edge root point (default behavior). The units are in meters. The default is (0.0, 0.0, 0.0).

  • spacingAnglesSecondDerivative_Gs_to_Wn_ixyz – An optional sequence with shape (3,) holding the analytical second time derivative of each spacingAngles_Gs_to_Wn_ixyz component, used by the aeroelastic solver to compute the inertial torque from the prescribed flapping acceleration. Each element is either a callable that accepts a time (in seconds) and returns the second derivative (in radians per second squared, before amplitude scaling), or None when the corresponding spacing component does not have one. Under the current model only the x (flap) component is consulted. Each component must agree with its matching spacingAngles_Gs_to_Wn_ixyz component: a custom (callable) spacing must have a non-None derivative here, and a “sine” or “uniform” spacing must have None here (their derivatives are handled analytically or rejected as non-differentiable when the torque is generated, so a supplied derivative would be ignored). Either mismatch raises a ValueError. When None, every component is None, which is valid only when no spacingAngles_Gs_to_Wn_ixyz component is a custom callable. The default is None.

Returns:

None

generate_wing_at_time_step(step: int, delta_time: float | int, deformation_angles_ixyz: numpy.ndarray | None = None) pterasoftware.geometry.wing.Wing[source]

Creates the Wing at a single time step, optionally applying structural deformation to each WingCrossSection.

Computes the prescribed Wing using the inherited oscillation logic, then threads per WingCrossSection deformation angles down to each AeroelasticWingCrossSectionMovement child.

Parameters:
  • step – The time step index. Must be a non negative int.

  • delta_time – The time between each time step in seconds. Must be a positive number (int or float).

  • deformation_angles_ixyz – A (N, 3) ndarray of floats where N is the number of WingCrossSections in this Wing. Each row is a (3,) deformation angle vector using an intrinsic xy’z” sequence that is added to the corresponding WingCrossSection’s prescribed angles_Wcsp_to_Wcs_ixyz. The units are in degrees. When None, no deformation is applied. The default is None.

Returns:

The Wing at this time step, with structural deformation applied to each WingCrossSection if provided.

property all_periods: tuple[float, Ellipsis]

All unique non zero periods of motion from this Wing and each WingCrossSection’s movement class.

Returns:

A tuple of all unique non zero periods in seconds. If all motion is static, this will be an empty tuple.

property max_period: float

The longest period of motion across this Wing and each WingCrossSection’s movement class.

Returns:

The longest period in seconds. If all the motion is static, this will be 0.0.

generate_wings(num_steps: int, delta_time: float | int) list[pterasoftware.geometry.wing.Wing]

Creates the Wing at each time step, and returns them in a list.

Parameters:
  • num_steps – The number of time steps in this movement. It must be a positive int.

  • delta_time – The time between each time step. It must be a positive number (int or float), and will be converted internally to a float. The units are in seconds.

Returns:

The list of Wings associated with this CoreWingMovement.