drag_polar.py

class openconcept.aerodynamics.openaerostruct.drag_polar.VLMDragPolar(**kwargs)

Bases: Group

Drag polar generated using OpenAeroStruct’s vortex lattice method and a surrogate model to decrease the computational cost. It allows for three planform definitions. The first is a trapezoidal planform defined by aspect ratio, taper, and sweep. The second builds a planform from sections definitions, each defined by a streamwise offset of the leading edge, spanwise position, and chord length. The mesh is linearly lofted between the sections. Finally, this component can take in a mesh directly to enable more flexibility. This component enables twisting of the mesh as well.

Notes

Twist is ordered starting at the tip and moving to the root; a twist of [-1, 0, 1] would have a tip twist of -1 deg and root twist of 1 deg. This is the same ordering as for the section definitions if the geometry option is set to “section”.

Set the OMP_NUM_THREADS environment variable to 1 for much better parallel training performance!

Make sure that the wing reference area provided to this group is consistent both with the reference area used by OpenAeroStruct (projected area by default) AND the reference area used by OpenConcept to compute the lift coefficient it provides.

Inputs:
  • fltcond|CL (float) – Lift coefficient (vector, dimensionless)

  • fltcond|M (float) – Mach number (vector, dimensionless)

  • fltcond|h (float) – Altitude (vector, m)

  • fltcond|q (float) – Dynamic pressure (vector, Pascals)

  • ac|geom|wing|S_ref (float) – Full planform area (scalar, m^2)

  • ac|aero|CD_nonwing (float) – Drag coefficient of components other than the wing; e.g. fuselage, tail, interference drag, etc.; this value is simply added to the drag coefficient computed by OpenAeroStruct (vector if vec_CD_nonwing option is set to True and scalar otherwise, dimensionless)

  • fltcond|TempIncrement (float) – Temperature increment for non-standard day (scalar, degC) NOTE: fltcond|TempIncrement is a scalar in this component but a vector in OC. This is the case because of the way the VLMDataGen component is set up. To make it work, TempIncrement would need to be an input to the surrogate, which is not worth the extra training cost (at minimum a 2x increase).

    If geometry option is “trapezoidal” (the default)
    • ac|geom|wing|AR (float) - Aspect ratio (scalar, dimensionless)

    • ac|geom|wing|taper (float) - Taper ratio (must be >0 and <=1); tip chord / root chord (scalar, dimensionless)

    • ac|geom|wing|c4sweep (float) - Quarter chord sweep angle (scalar, degrees)

    • ac|geom|wing|toverc (float) - Wing tip and wing root airfoil thickness to chord ratio in that order; panel thickness to chord ratios are linearly interpolated between the tip and root (vector of length 2, dimensionless)

    • ac|geom|wing|twist (float) - Twist at spline control points, ordered from tip to root (vector of length num_twist, degrees)

    If geometry option is “section” (despite inputs in m, they are scaled to provided planform area)
    • ac|geom|wing|x_LE_sec (float) - Streamwise offset of the section’s leading edge, starting with the outboard section (wing tip) and moving inboard toward the root (vector of length num_sections, m)

    • ac|geom|wing|y_sec (float) - Spanwise location of each section, starting with the outboard section (wing tip) at the MOST NEGATIVE y value and moving inboard (increasing y value) toward the root; the user does not provide a value for the root because it is always 0.0 (vector of length num_sections - 1, m)

    • ac|geom|wing|chord_sec (float) - Chord of each section, starting with the outboard section (wing tip) and moving inboard toward the root (vector of length num_sections, m)

    • ac|geom|wing|toverc (float) - Thickness to chord ratio of the airfoil at each defined section starting at the wing tip and moving wing root airfoil; panel thickness to chord ratios is linearly interpolated (vector of length num_sections, m)

    • ac|geom|wing|twist (float) - Twist at each section, ordered from tip to root (vector of length num_sections, degrees)

    If geometry option is “mesh”
    • ac|geom|wing|OAS_mesh (float) - OpenAeroStruct 3D mesh (num_x + 1 x num_y + 1 x 3 vector, m)

    • ac|geom|wing|toverc (float) - Thickness to chord ratio of each streamwise strip of panels ordered from wing tip to wing root (vector of length num_y, dimensionless)

Outputs:
  • drag (float) – Drag force (vector, Newtons)

  • twisted_mesh (float) – OpenAeroStruct mesh that has been twisted according to twist inputs; only an output if geometry options is set to “trapezoidal” or “section” (num_x + 1 x num_y + 1 x 3 vector, m)

Options:
  • num_nodes (int) – Number of analysis points per mission segment (scalar, dimensionless)

  • geometry (float) –

    Choose the geometry parameterization from the following options (by default trapezoidal):

    • “trapezoidal”: Create a trapezoidal mesh based on apsect ratio, taper, and sweep

    • “section”: Create a mesh lofted between defined sections

    • “mesh”: Pass in a mesh directly to this component

  • num_x (int) – Number of panels in x (streamwise) direction (scalar, dimensionless)

  • num_y (int) – Number of panels in y (spanwise) direction for half wing. If geometry option is set to “section”, this value represents the number of panels between each pair of sections. In that case, it can also be a vector with potentially a different number of panels between each pair of sections (scalar or vector, dimensionless)

  • num_sections (int) – Only if geometry option is “section”, this represents the number of spanwise sections to define planform shape. This parameter is ignored for other geometry options (scalar, dimensionless)

  • num_twist (int) – Number of spline control points for twist, only used if geometry is set to “trapezoidal” because “mesh” linearly interpolates twist between sections and “mesh” does not provide twist functionality (scalar, dimensionless)

  • vec_CD_nonwing (bool) – Set to True if ac|aero|CD_nonwing is passed in as a vector of length num_nodes, otherwise set to False and it will be set as a scalar value, by default False

  • alpha_train (list or ndarray) – List of angle of attack values at which to train the model (ndarray, degrees)

  • Mach_train (list or ndarray) – List of Mach numbers at which to train the model (ndarray, dimensionless)

  • alt_train (list or ndarray) – List of altitude values at which to train the model (ndarray, m)

  • surf_options (dict) – Dictionary of OpenAeroStruct surface options; any options provided here will override the default ones; see the OpenAeroStruct documentation for more information. Because the geometry transformations are excluded in this model (to simplify the interface), the <transformation>_cp options are not supported. The t_over_c option is also removed since it is provided instead as an input.

class openconcept.aerodynamics.openaerostruct.drag_polar.VLMDataGen(**kwargs)

Bases: ExplicitComponent

Generates a grid of OpenAeroStruct lift and drag data to train a surrogate model. The grid is defined by the options and the mesh geometry by the input. This component will only recalculate the lift and drag grid when the mesh changes. All VLMDataGen components in the model must use the same training points and surf_options.

Inputs:
  • ac|geom|wing|OAS_mesh (float) – OpenAeroStruct 3D mesh (num_x + 1 x num_y + 1 x 3 vector, m)

  • ac|geom|wing|toverc (float) – Thickness to chord ratio of each streamwise strip of panels ordered from wing tip to wing root; used for the viscous and wave drag calculations (vector of length num_y, dimensionless)

  • fltcond|TempIncrement (float) – Temperature increment for non-standard day (scalar, degC)

Outputs:
  • CL_train (3-dim ndarray) – Grid of lift coefficient data to train structured surrogate model

  • CD_train (3-dim ndarray) – Grid of drag coefficient data to train structured surrogate model

Options:
  • num_x (int) – Number of panels in x (streamwise) direction (scalar, dimensionless)

  • num_y (int) – Number of panels in y (spanwise) direction for one wing because uses symmetry (scalar, dimensionless)

  • Mach_train (list or ndarray) – List of Mach numbers at which to train the model (ndarray, dimensionless)

  • alpha_train (list or ndarray) – List of angle of attack values at which to train the model (ndarray, degrees)

  • alt_train (list or ndarray) – List of altitude values at which to train the model (ndarray, m)

  • surf_options (dict) – Dictionary of OpenAeroStruct surface options; any options provided here will override the default ones; see the OpenAeroStruct documentation for more information. Because the geometry transformations are excluded in this model (to simplify the interface), the <transformation>_cp options are not supported. The t_over_c option is also removed since it is provided instead as an input.

class openconcept.aerodynamics.openaerostruct.drag_polar.VLM(**kwargs)

Bases: Group

Computes lift, drag, and other forces using OpenAeroStruct’s vortex lattice implementation. This group contains a Reynolds number calculation that uses a linear approximation of dynamic viscosity. It is accurate up through ~33k ft and probably ok up to 40k ft, but not much further.

Thickness to chord ratio of the airfoils is taken from the input, not the value in the surf_options dict (which is ignored).

Inputs:
  • fltcond|alpha (float) – Angle of attack (scalar, degrees)

  • fltcond|M (float) – Mach number (scalar, dimensionless)

  • fltcond|h (float) – Altitude (scalar, m)

  • fltcond|TempIncrement (float) – Temperature increment for non-standard day (scalar, degC)

  • ac|geom|wing|OAS_mesh (float) – OpenAeroStruct 3D mesh (num_x + 1 x num_y + 1 x 3 vector, m)

  • ac|geom|wing|toverc (float) – Thickness to chord ratio of each streamwise strip of panels ordered from wing tip to wing root; used for the viscous and wave drag calculations (vector of length num_y, dimensionless)

Outputs:
  • fltcond|CL (float) – Lift coefficient of wing (scalar, dimensionless)

  • fltcond|CD (float) – Drag coefficient of wing (scalar, dimensionless)

  • fltcond|CDi (float) – Induced drag component (scalar, dimensionless)

  • fltcond|CDv (float) – Viscous drag component (scalar, dimensionless)

  • fltcond|CDw (float) – Wave drag component (scalar, dimensionless)

  • sectional_CL (float) – Sectional lift coefficient for each chordwise panel strip (vector of length num_y, dimensionless)

  • panel_forces (float) – Force from VLM for each panel (vector of size (num_x x num_y x 3), N)

Options:
  • num_x (int) – Number of panels in x (streamwise) direction (scalar, dimensionless)

  • num_y (int) – Number of panels in y (spanwise) direction for one wing because uses symmetry (scalar, dimensionless)

  • surf_options (dict) – Dictionary of OpenAeroStruct surface options; any options provided here will override the default ones; see the OpenAeroStruct documentation for more information. Because the geometry transformations are excluded in this model (to simplify the interface), the <transformation>_cp options are not supported. The t_over_c option is also removed since it is provided instead as an input.