aerosandbox.aerodynamics
Submodules
Classes
AirfoilInviscid | An implicit analysis for inviscid analysis of an airfoil (or family of airfoils). |
XFoil | An interface to XFoil, a 2D airfoil analysis tool developed by Mark Drela at MIT. |
MSES | An interface to MSES, MSET, and MPLOT, a 2D airfoil analysis system developed by Mark Drela at MIT. |
VortexLatticeMethod | An explicit (linear) vortex-lattice-method aerodynamics analysis. |
LiftingLine | An implicit aerodynamics analysis based on lifting line theory, with modifications for nonzero sweep |
NonlinearLiftingLine | An implicit aerodynamics analysis based on lifting line theory, with modifications for nonzero sweep |
AeroBuildup | A workbook-style aerodynamics buildup. |
AVL | An interface to AVL, a 3D vortex lattice aerodynamics code developed by Mark Drela at MIT. |
Package Contents
class aerosandbox.aerodynamics.AirfoilInviscid(airfoil, op_point, ground_effect=False)
: Bases: aerosandbox.common.ImplicitAnalysis
An implicit analysis for inviscid analysis of an airfoil (or family of airfoils).
Key outputs:
> - AirfoilInviscid.Cl
Parameters:
: - **airfoil** (*Union**[*[*aerosandbox.geometry.Airfoil*](/u/b315363d35db77b2#aerosandbox-geometry-airfoil)*,* *List**[*[*aerosandbox.geometry.Airfoil*](/u/b315363d35db77b2#aerosandbox-geometry-airfoil)*]**]*) –
- **op\_point** ([*aerosandbox.performance.OperatingPoint*](/u/ef68b15c282639e3#aerosandbox-performance-operatingpoint)) –
- **ground\_effect** (*bool*) –
op\_point
ground\_effect *= False*
\_\_repr\_\_()
\_setup\_unknowns()
calculate\_velocity(*x\_field*, *y\_field*)
: Return type:
: [aerosandbox.numpy.ndarray, aerosandbox.numpy.ndarray]
\_enforce\_governing\_equations()
\_calculate\_forces()
draw\_streamlines(*res=200*, *show=True*)
draw\_cp(*show=True*) class aerosandbox.aerodynamics.XFoil(airfoil, Re=0.0, mach=0.0, n_crit=9.0, xtr_upper=1.0, xtr_lower=1.0, hinge_point_x=0.75, full_potential=False, max_iter=100, xfoil_command='xfoil', xfoil_repanel=True, xfoil_repanel_n_points=279, include_bl_data=False, verbose=False, timeout=30, working_directory=None)
: Bases: aerosandbox.common.ExplicitAnalysis
An interface to XFoil, a 2D airfoil analysis tool developed by Mark Drela at MIT.
Requires XFoil to be on your computer; XFoil is available here: <https://web.mit.edu/drela/Public/web/xfoil/>
It is recommended (but not required) that you add XFoil to your system PATH environment variable such that it can
be called with the command xfoil. If this is not the case, you need to specify the path to your XFoil
executable using the xfoil\_command argument of the constructor.
Usage example:
```defaultxf = XFoil( airfoil=Airfoil("naca2412").repanel(n_points_per_side=100), Re=1e6, )
result_at_single_alpha = xf.alpha(5) result_at_several_CLs = xf.cl([0.5, 0.7, 0.8, 0.9]) result_at_multiple_alphas = xf.alpha([3, 5, 60]) # Note: if a result does not converge (such as the 60 degree case here), it will not be included in the results.
Parameters:
: - **airfoil** ([*aerosandbox.geometry.Airfoil*](/u/b315363d35db77b2#aerosandbox-geometry-airfoil)) –
- **Re** (*float*) –
- **mach** (*float*) –
- **n\_crit** (*float*) –
- **xtr\_upper** (*float*) –
- **xtr\_lower** (*float*) –
- **hinge\_point\_x** (*float*) –
- **full\_potential** (*bool*) –
- **max\_iter** (*int*) –
- **xfoil\_command** (*str*) –
- **xfoil\_repanel** (*bool*) –
- **xfoil\_repanel\_n\_points** (*int*) –
- **include\_bl\_data** (*bool*) –
- **verbose** (*bool*) –
- **timeout** (*Union**[**float**,* *int**,* *None**]*) –
- **working\_directory** (*Union**[**pathlib.Path**,* *str**]*) –
*exception* XFoilError
: Bases: `Exception`
Common base class for all non-exit exceptions.
airfoil
Re *= 0.0*
mach *= 0.0*
n\_crit *= 9.0*
xtr\_upper *= 1.0*
xtr\_lower *= 1.0*
hinge\_point\_x *= 0.75*
full\_potential *= False*
max\_iter *= 100*
xfoil\_command *= 'xfoil'*
xfoil\_repanel *= True*
xfoil\_repanel\_n\_points *= 279*
include\_bl\_data *= False*
verbose *= False*
timeout *= 30*
\_\_repr\_\_()
\_default\_keystrokes(*airfoil\_filename*, *output\_filename*)
: Returns a list of XFoil keystrokes that are common to all XFoil runs.
Returns:
: A list of strings, each of which is a single XFoil keystroke to be followed by <enter>.
Parameters:
: - **airfoil\_filename** (*str*) –
- **output\_filename** (*str*) –
Return type:
: List[str]
\_run\_xfoil(*run\_command*, *read\_bl\_data\_from=None*)
: Private function to run XFoil.
Args: run\_command: A string with any XFoil keystroke inputs that you’d like. By default, you start off within the OPER
menu. All of the inputs indicated in the constructor have been set already, but you can override them here (for
this run only) if you want.
Returns: A dictionary containing all converged solutions obtained with your inputs.
Parameters:
: - **run\_command** (*str*) –
- **read\_bl\_data\_from** (*str*) –
Return type:
: Dict[str, aerosandbox.numpy.ndarray]
open\_interactive()
: Opens a new terminal window and runs XFoil interactively. This is useful for detailed analysis or debugging.
Returns: None
Return type:
: None
alpha(*alpha*, *start\_at=0*)
: Execute XFoil at a given angle of attack, or at a sequence of angles of attack.
Parameters:
: - **alpha** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) – The angle of attack [degrees]. Can be either a float or an iterable of floats, such as an array.
- **start\_at** (*Union**[**float**,* *None**]*) – Chooses whether to split a large sweep into two runs that diverge away from some central value,
- **example** (*to improve convergence. As an*) –
- **alpha=20** (*if you wanted to sweep from alpha=-20 to*) –
- **want** (*you might*) –
- **together** (*to instead do two sweeps and stitch them*) –
0 to 20, and 0 to -20. start\_at can be either:
- None, in which case the alpha inputs are run as a single sequence in the order given.
- A float that corresponds to an angle of attack (in degrees), in which case the alpha inputs are
split into two sequences that diverge from the start\_at value. Successful runs are then sorted by
alpha before returning.
Return type:
: Dict[str, aerosandbox.numpy.ndarray]
Returns: A dictionary with the XFoil results. Dictionary values are arrays; they may not be the same shape as
your input array if some points did not converge.
cl(*cl*, *start\_at=0*)
: Execute XFoil at a given lift coefficient, or at a sequence of lift coefficients.
Parameters:
: - **cl** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) – The lift coefficient [-]. Can be either a float or an iterable of floats, such as an array.
- **start\_at** (*Union**[**float**,* *None**]*) – Chooses whether to split a large sweep into two runs that diverge away from some central value,
- **example** (*to improve convergence. As an*) –
- **cl=1.5** (*if you wanted to sweep from cl=-1.5 to*) –
- **to** (*you might want*) –
- **together** (*instead do two sweeps and stitch them*) –
0 to 1.5, and 0 to -1.5. start\_at can be either:
- None, in which case the cl inputs are run as a single sequence in the order given.
- A float that corresponds to an lift coefficient, in which case the cl inputs are
split into two sequences that diverge from the start\_at value. Successful runs are then sorted by
alpha before returning.
Return type:
: Dict[str, aerosandbox.numpy.ndarray]
Returns: A dictionary with the XFoil results. Dictionary values are arrays; they may not be the same shape as
your input array if some points did not converge.
<a id="aerosandbox.aerodynamics.MSES"></a> *class* aerosandbox.aerodynamics.MSES(*airfoil*, *n\_crit=9.0*, *xtr\_upper=1.0*, *xtr\_lower=1.0*, *max\_iter=100*, *mset\_command='mset'*, *mses\_command='mses'*, *mplot\_command='mplot'*, *use\_xvfb=None*, *xvfb\_command='xvfb-run -a'*, *verbosity=1*, *timeout\_mset=10*, *timeout\_mses=60*, *timeout\_mplot=10*, *working\_directory=None*, *behavior\_after\_unconverged\_run='reinitialize'*, *mset\_alpha=0*, *mset\_n=141*, *mset\_e=0.4*, *mset\_io=37*, *mset\_x=0.85*, *mses\_mcrit=0.99*, *mses\_mucon=-1.0*)
: Bases: [`aerosandbox.common.ExplicitAnalysis`](/u/6d3330afd901bed5#aerosandbox-common-explicitanalysis)
An interface to MSES, MSET, and MPLOT, a 2D airfoil analysis system developed by Mark Drela at MIT.
Requires compiled binaries for all the programs to be on your computer;
MSES is available here: <https://web.mit.edu/drela/Public/web/mses/>
Academics can get a copy by emailing the MIT Tech. Licensing Office;
MIT affiliates can find a copy on Athena.
It is recommended (but not required) that you add MSES, MSET, and MPLOT to your system PATH environment variable
such that they can be called with the commands mses, mset, and mplot. If this is not the case, you need to
specify the path to these executables using the command arguments of the constructor.
Note that MSES, MSET, and MPLOT by default open up X11 windows on your computer. If you prefer that this doesn’t
happen (for extra speed), or if you cannot have this happen (e.g., you are computing in an environment without
proper X11 support, like Windows Subsystem for Linux), you should use XVFB. <https://en.wikipedia.org/wiki/Xvfb>
XVFB is a virtual “display” server that can receive X11 output and safely dump it. (If you don’t use XVFB and you
don’t have proper X11 support on your computer, this AeroSandbox MSES module will simply error out during the
MSET call - probably not what you want.)
To install XVFB on a Linux machine, use:
``bash
sudo apt-get install xvfb
``
Then, when instantiating this MSES instance in AeroSandbox, pass the use\_xvfb flag to be True. Default behavior
here is that this class will look for the XVFB executable, xvfb-run, on your machine. If it finds it,
it will run with XVFB enabled. If it does not, it will run without XVFB.
---
Usage example:
```default
>>> ms = MSES(
>>> airfoil=Airfoil("naca2412").repanel(n_points_per_side=100),
>>> Re=1e6,
>>> mach=0.2,
>>> )
>>>
>>> result_at_single_alpha = ms.alpha(5)
>>> #result_at_several_CLs = ms.cl([0.5, 0.7, 0.8, 0.9])
>>> result_at_multiple_alphas = ms.alpha([3, 5, 60]) # Note: if a result does not converge (such as the 60 degree case here), it will not be included in the results.Parameters:
: - **airfoil** ([*aerosandbox.geometry.Airfoil*](/u/b315363d35db77b2#aerosandbox-geometry-airfoil)) –
- **n\_crit** (*float*) –
- **xtr\_upper** (*float*) –
- **xtr\_lower** (*float*) –
- **max\_iter** (*int*) –
- **mset\_command** (*str*) –
- **mses\_command** (*str*) –
- **mplot\_command** (*str*) –
- **use\_xvfb** (*bool*) –
- **xvfb\_command** (*str*) –
- **verbosity** (*int*) –
- **timeout\_mset** (*Union**[**float**,* *int**,* *None**]*) –
- **timeout\_mses** (*Union**[**float**,* *int**,* *None**]*) –
- **timeout\_mplot** (*Union**[**float**,* *int**,* *None**]*) –
- **working\_directory** (*str*) –
- **behavior\_after\_unconverged\_run** (*str*) –
- **mset\_alpha** (*float*) –
- **mset\_n** (*int*) –
- **mset\_e** (*float*) –
- **mset\_io** (*int*) –
- **mset\_x** (*float*) –
- **mses\_mcrit** (*float*) –
- **mses\_mucon** (*float*) –
airfoil
n\_crit *= 9.0*
xtr\_upper *= 1.0*
xtr\_lower *= 1.0*
max\_iter *= 100*
mset\_command *= 'mset'*
mses\_command *= 'mses'*
mplot\_command *= 'mplot'*
use\_xvfb *= None*
xvfb\_command *= 'xvfb-run -a'*
verbosity *= 1*
timeout\_mses *= 60*
timeout\_mset *= 10*
timeout\_mplot *= 10*
working\_directory *= None*
behavior\_after\_unconverged\_run *= 'reinitialize'*
mset\_alpha *= 0*
mset\_n *= 141*
mset\_e *= 0.4*
mset\_io *= 37*
mset\_x *= 0.85*
mses\_mcrit *= 0.99*
mses\_mucon *= -1.0*
run(*alpha=0.0*, *Re=0.0*, *mach=0.01*)
: Parameters:
: - **alpha** (*Union**[**float**,* *aerosandbox.numpy.ndarray**,* *List**]*) –
- **Re** (*Union**[**float**,* *aerosandbox.numpy.ndarray**,* *List**]*) –
- **mach** (*Union**[**float**,* *aerosandbox.numpy.ndarray**,* *List**]*) – class aerosandbox.aerodynamics.VortexLatticeMethod(airplane, op_point, xyz_ref=None, run_symmetric_if_possible=False, verbose=False, spanwise_resolution=10, spanwise_spacing_function=np.cosspace, chordwise_resolution=10, chordwise_spacing_function=np.cosspace, vortex_core_radius=1e-08, align_trailing_vortices_with_wind=False)
: Bases: aerosandbox.ExplicitAnalysis
An explicit (linear) vortex-lattice-method aerodynamics analysis.
Usage example:
: ```defaultanalysis = asb.VortexLatticeMethod( airplane=my_airplane, op_point=asb.OperatingPoint( velocity=100, # m/s alpha=5, # deg beta=4, # deg p=0.01, # rad/sec q=0.02, # rad/sec r=0.03, # rad/sec ) ) aero_data = analysis.run() analysis.draw()
Parameters:
: - **airplane** ([*aerosandbox.geometry.Airplane*](/u/b315363d35db77b2#aerosandbox-geometry-airplane)) –
- **op\_point** ([*aerosandbox.performance.OperatingPoint*](/u/ef68b15c282639e3#aerosandbox-performance-operatingpoint)) –
- **xyz\_ref** (*List**[**float**]*) –
- **run\_symmetric\_if\_possible** (*bool*) –
- **verbose** (*bool*) –
- **spanwise\_resolution** (*int*) –
- **spanwise\_spacing\_function** (*Callable**[**[**float**,* *float**,* *float**]**,* *aerosandbox.geometry.np.ndarray**]*) –
- **chordwise\_resolution** (*int*) –
- **chordwise\_spacing\_function** (*Callable**[**[**float**,* *float**,* *float**]**,* *aerosandbox.geometry.np.ndarray**]*) –
- **vortex\_core\_radius** (*float*) –
- **align\_trailing\_vortices\_with\_wind** (*bool*) –
airplane
op\_point
xyz\_ref *= None*
verbose *= False*
spanwise\_resolution *= 10*
spanwise\_spacing\_function
chordwise\_resolution *= 10*
chordwise\_spacing\_function
vortex\_core\_radius *= 1e-08*
align\_trailing\_vortices\_with\_wind *= False*
run\_symmetric *= False*
\_\_repr\_\_()
run()
: Computes the aerodynamic forces.
Returns a dictionary with keys:
> - ‘F\_g’ : an [x, y, z] list of forces in geometry axes [N]
> - ‘F\_b’ : an [x, y, z] list of forces in body axes [N]
> - ‘F\_w’ : an [x, y, z] list of forces in wind axes [N]
> - ‘M\_g’ : an [x, y, z] list of moments about geometry axes [Nm]
> - ‘M\_b’ : an [x, y, z] list of moments about body axes [Nm]
> - ‘M\_w’ : an [x, y, z] list of moments about wind axes [Nm]
> - ‘L’ : the lift force [N]. Definitionally, this is in wind axes.
> - ‘Y’ : the side force [N]. This is in wind axes.
> - ‘D’ : the drag force [N]. Definitionally, this is in wind axes.
> - ‘l\_b’, the rolling moment, in body axes [Nm]. Positive is roll-right.
> - ‘m\_b’, the pitching moment, in body axes [Nm]. Positive is pitch-up.
> - ‘n\_b’, the yawing moment, in body axes [Nm]. Positive is nose-right.
> - ‘CL’, the lift coefficient [-]. Definitionally, this is in wind axes.
> - ‘CY’, the sideforce coefficient [-]. This is in wind axes.
> - ‘CD’, the drag coefficient [-]. Definitionally, this is in wind axes.
> - ‘Cl’, the rolling coefficient [-], in body axes
> - ‘Cm’, the pitching coefficient [-], in body axes
> - ‘Cn’, the yawing coefficient [-], in body axes
Nondimensional values are nondimensionalized using reference values in the VortexLatticeMethod.airplane object.
Return type:
: Dict[str, Any]
run\_with\_stability\_derivatives(*alpha=True*, *beta=True*, *p=True*, *q=True*, *r=True*)
: Computes the aerodynamic forces and moments on the airplane, and the stability derivatives.
Arguments essentially determine which stability derivatives are computed. If a stability derivative is not
needed, leaving it False will speed up the computation.
Parameters:
: - **alpha** (*-*) – If True, compute the stability derivatives with respect to the angle of attack (alpha).
- **beta** (*-*) – If True, compute the stability derivatives with respect to the sideslip angle (beta).
- **p** (*-*) – If True, compute the stability derivatives with respect to the body-axis roll rate (p).
- **q** (*-*) – If True, compute the stability derivatives with respect to the body-axis pitch rate (q).
- **r** (*-*) – If True, compute the stability derivatives with respect to the body-axis yaw rate (r).
Returns: a dictionary with keys:
> - ‘F\_g’ : an [x, y, z] list of forces in geometry axes [N]
> - ‘F\_b’ : an [x, y, z] list of forces in body axes [N]
> - ‘F\_w’ : an [x, y, z] list of forces in wind axes [N]
> - ‘M\_g’ : an [x, y, z] list of moments about geometry axes [Nm]
> - ‘M\_b’ : an [x, y, z] list of moments about body axes [Nm]
> - ‘M\_w’ : an [x, y, z] list of moments about wind axes [Nm]
> - ‘L’ : the lift force [N]. Definitionally, this is in wind axes.
> - ‘Y’ : the side force [N]. This is in wind axes.
> - ‘D’ : the drag force [N]. Definitionally, this is in wind axes.
> - ‘l\_b’, the rolling moment, in body axes [Nm]. Positive is roll-right.
> - ‘m\_b’, the pitching moment, in body axes [Nm]. Positive is pitch-up.
> - ‘n\_b’, the yawing moment, in body axes [Nm]. Positive is nose-right.
> - ‘CL’, the lift coefficient [-]. Definitionally, this is in wind axes.
> - ‘CY’, the sideforce coefficient [-]. This is in wind axes.
> - ‘CD’, the drag coefficient [-]. Definitionally, this is in wind axes.
> - ‘Cl’, the rolling coefficient [-], in body axes
> - ‘Cm’, the pitching coefficient [-], in body axes
> - ‘Cn’, the yawing coefficient [-], in body axes
>
> Along with additional keys, depending on the value of the alpha, beta, p, q, and r arguments. For
> example, if alpha=True, then the following additional keys will be present:
>
> > - ‘CLa’, the lift coefficient derivative with respect to alpha [1/rad]
> > - ‘CDa’, the drag coefficient derivative with respect to alpha [1/rad]
> > - ‘CYa’, the sideforce coefficient derivative with respect to alpha [1/rad]
> > - ‘Cla’, the rolling moment coefficient derivative with respect to alpha [1/rad]
> > - ‘Cma’, the pitching moment coefficient derivative with respect to alpha [1/rad]
> > - ‘Cna’, the yawing moment coefficient derivative with respect to alpha [1/rad]
> > - ‘x\_np’, the neutral point location in the x direction [m]
>
> Nondimensional values are nondimensionalized using reference values in the
> VortexLatticeMethod.airplane object.
>
> Data types:
> : - The “L”, “Y”, “D”, “l\_b”, “m\_b”, “n\_b”, “CL”, “CY”, “CD”, “Cl”, “Cm”, and “Cn” keys are:
>
> > - floats if the OperatingPoint object is not vectorized (i.e., if all attributes of OperatingPoint
> >
> > are floats, not arrays).
> >
> > - arrays if the OperatingPoint object is vectorized (i.e., if any attribute of OperatingPoint is an
> >
> > array).
> - The “F\_g”, “F\_b”, “F\_w”, “M\_g”, “M\_b”, and “M\_w” keys are always lists, which will contain either
>
> floats or arrays, again depending on whether the OperatingPoint object is vectorized or not.
get\_induced\_velocity\_at\_points(*points*)
: Computes the induced velocity at a set of points in the flowfield.
Parameters:
: **points** (*aerosandbox.geometry.np.ndarray*) – A Nx3 array of points that you would like to know the induced velocities at. Given in geometry axes.
Return type:
: aerosandbox.geometry.np.ndarray
Returns: A Nx3 of the induced velocity at those points. Given in geometry axes.
get\_velocity\_at\_points(*points*)
: Computes the velocity at a set of points in the flowfield.
Parameters:
: **points** (*aerosandbox.geometry.np.ndarray*) – A Nx3 array of points that you would like to know the velocities at. Given in geometry axes.
Return type:
: aerosandbox.geometry.np.ndarray
Returns: A Nx3 of the velocity at those points. Given in geometry axes.
calculate\_streamlines(*seed\_points=None*, *n\_steps=300*, *length=None*)
: Computes streamlines, starting at specific seed points.
After running this function, a new instance variable VortexLatticeFilaments.streamlines is computed
Uses simple forward-Euler integration with a fixed spatial stepsize (i.e., velocity vectors are normalized
before ODE integration). After investigation, it’s not worth doing fancier ODE integration methods (adaptive
schemes, RK substepping, etc.), due to the near-singular conditions near vortex filaments.
Parameters:
: - **seed\_points** (*aerosandbox.geometry.np.ndarray*) – A Nx3 ndarray that contains a list of points where streamlines are started. Will be
- **specified.** (*not*) –
- **n\_steps** (*int*) – The number of individual streamline steps to trace. Minimum of 2.
- **length** (*float*) – The approximate total length of the streamlines desired, in meters. Will be auto-calculated if
- **specified.** –
Returns:
: a 3D array with dimensions: (n\_seed\_points) x (3) x (n\_steps).
Consists of streamlines data.
Result is also saved as an instance variable, VortexLatticeMethod.streamlines.
Return type:
: streamlines
draw(*c=None*, *cmap=None*, *colorbar\_label=None*, *show=True*, *show\_kwargs=None*, *draw\_streamlines=True*, *recalculate\_streamlines=False*, *backend='pyvista'*)
: Draws the solution. Note: Must be called on a SOLVED AeroProblem object.
To solve an AeroProblem, use opti.solve(). To substitute a solved solution, use ap = sol(ap).
:return:
Parameters:
: - **c** (*aerosandbox.geometry.np.ndarray*) –
- **cmap** (*str*) –
- **colorbar\_label** (*str*) –
- **show** (*bool*) –
- **show\_kwargs** (*Dict*) –
- **backend** (*str*) –
<a id="aerosandbox.aerodynamics.LiftingLine"></a> *class* aerosandbox.aerodynamics.LiftingLine(*airplane*, *op\_point*, *xyz\_ref=None*, *model\_size='medium'*, *run\_symmetric\_if\_possible=False*, *verbose=False*, *spanwise\_resolution=4*, *spanwise\_spacing\_function=np.cosspace*, *vortex\_core\_radius=1e-08*, *align\_trailing\_vortices\_with\_wind=False*)
: Bases: [`aerosandbox.ExplicitAnalysis`](/u/e98c1a890dad6c0c#aerosandbox-explicitanalysis)
An implicit aerodynamics analysis based on lifting line theory, with modifications for nonzero sweep
and dihedral + multiple wings.
Nonlinear, and includes viscous effects based on 2D data.
Usage example:
: ```default
>>> analysis = asb.LiftingLine(
>>> airplane=my_airplane,
>>> op_point=asb.OperatingPoint(
>>> velocity=100, # m/s
>>> alpha=5, # deg
>>> beta=4, # deg
>>> p=0.01, # rad/sec
>>> q=0.02, # rad/sec
>>> r=0.03, # rad/sec
>>> )
>>> )
>>> outputs = analysis.run()Parameters:
: - **airplane** ([*aerosandbox.geometry.Airplane*](/u/b315363d35db77b2#aerosandbox-geometry-airplane)) –
- **op\_point** ([*aerosandbox.performance.OperatingPoint*](/u/ef68b15c282639e3#aerosandbox-performance-operatingpoint)) –
- **xyz\_ref** (*List**[**float**]*) –
- **model\_size** (*str*) –
- **run\_symmetric\_if\_possible** (*bool*) –
- **verbose** (*bool*) –
- **spanwise\_resolution** (*int*) –
- **spanwise\_spacing\_function** (*Callable**[**[**float**,* *float**,* *float**]**,* *aerosandbox.geometry.np.ndarray**]*) –
- **vortex\_core\_radius** (*float*) –
- **align\_trailing\_vortices\_with\_wind** (*bool*) –
airplane
op\_point
xyz\_ref *= None*
model\_size *= 'medium'*
verbose *= False*
spanwise\_resolution *= 4*
spanwise\_spacing\_function
vortex\_core\_radius *= 1e-08*
align\_trailing\_vortices\_with\_wind *= False*
run\_symmetric *= False*
\_\_repr\_\_()
<a id="aerosandbox.aerodynamics.LiftingLine.AeroComponentResults"></a> *class* AeroComponentResults
: s\_ref*: float*
c\_ref*: float*
b\_ref*: float*
op\_point*: [aerosandbox.performance.OperatingPoint](/u/ef68b15c282639e3#aerosandbox-performance-operatingpoint)*
F\_g*: List[float | aerosandbox.geometry.np.ndarray]*
M\_g*: List[float | aerosandbox.geometry.np.ndarray]*
\_\_repr\_\_()
*property* F\_b*: List[float | aerosandbox.geometry.np.ndarray]*
: An [x, y, z] list of forces in body axes [N]
Return type:
: List[Union[float, aerosandbox.geometry.np.ndarray]]
*property* F\_w*: List[float | aerosandbox.geometry.np.ndarray]*
: An [x, y, z] list of forces in wind axes [N]
Return type:
: List[Union[float, aerosandbox.geometry.np.ndarray]]
*property* M\_b*: List[float | aerosandbox.geometry.np.ndarray]*
: An [x, y, z] list of moments about body axes [Nm]
Return type:
: List[Union[float, aerosandbox.geometry.np.ndarray]]
*property* M\_w*: List[float | aerosandbox.geometry.np.ndarray]*
: An [x, y, z] list of moments about wind axes [Nm]
Return type:
: List[Union[float, aerosandbox.geometry.np.ndarray]]
*property* L*: float | aerosandbox.geometry.np.ndarray*
: The lift force [N]. Definitionally, this is in wind axes.
Return type:
: Union[float, aerosandbox.geometry.np.ndarray]
*property* Y*: float | aerosandbox.geometry.np.ndarray*
: The side force [N]. Definitionally, this is in wind axes.
Return type:
: Union[float, aerosandbox.geometry.np.ndarray]
*property* D*: float | aerosandbox.geometry.np.ndarray*
: The drag force [N]. Definitionally, this is in wind axes.
Return type:
: Union[float, aerosandbox.geometry.np.ndarray]
*property* l\_b*: float | aerosandbox.geometry.np.ndarray*
: The rolling moment [Nm] in body axes. Positive is roll-right.
Return type:
: Union[float, aerosandbox.geometry.np.ndarray]
*property* m\_b*: float | aerosandbox.geometry.np.ndarray*
: The pitching moment [Nm] in body axes. Positive is nose-up.
Return type:
: Union[float, aerosandbox.geometry.np.ndarray]
*property* n\_b*: float | aerosandbox.geometry.np.ndarray*
: The yawing moment [Nm] in body axes. Positive is nose-right.
Return type:
: Union[float, aerosandbox.geometry.np.ndarray]
run()
: Computes the aerodynamic forces.
Returns a dictionary with keys:
> - ‘F\_g’ : an [x, y, z] list of forces in geometry axes [N]
> - ‘F\_b’ : an [x, y, z] list of forces in body axes [N]
> - ‘F\_w’ : an [x, y, z] list of forces in wind axes [N]
> - ‘M\_g’ : an [x, y, z] list of moments about geometry axes [Nm]
> - ‘M\_b’ : an [x, y, z] list of moments about body axes [Nm]
> - ‘M\_w’ : an [x, y, z] list of moments about wind axes [Nm]
> - ‘L’ : the lift force [N]. Definitionally, this is in wind axes.
> - ‘Y’ : the side force [N]. This is in wind axes.
> - ‘D’ : the drag force [N]. Definitionally, this is in wind axes.
> - ‘l\_b’, the rolling moment, in body axes [Nm]. Positive is roll-right.
> - ‘m\_b’, the pitching moment, in body axes [Nm]. Positive is pitch-up.
> - ‘n\_b’, the yawing moment, in body axes [Nm]. Positive is nose-right.
> - ‘CL’, the lift coefficient [-]. Definitionally, this is in wind axes.
> - ‘CY’, the sideforce coefficient [-]. This is in wind axes.
> - ‘CD’, the drag coefficient [-]. Definitionally, this is in wind axes.
> - ‘Cl’, the rolling coefficient [-], in body axes
> - ‘Cm’, the pitching coefficient [-], in body axes
> - ‘Cn’, the yawing coefficient [-], in body axes
Nondimensional values are nondimensionalized using reference values in the LiftingLine.airplane object.
Data types:
: - The “L”, “Y”, “D”, “l\_b”, “m\_b”, “n\_b”, “CL”, “CY”, “CD”, “Cl”, “Cm”, and “Cn” keys are:
> - floats if the OperatingPoint object is not vectorized (i.e., if all attributes of OperatingPoint
>
> are floats, not arrays).
>
> - arrays if the OperatingPoint object is vectorized (i.e., if any attribute of OperatingPoint is an
>
> array).
- The “F\_g”, “F\_b”, “F\_w”, “M\_g”, “M\_b”, and “M\_w” keys are always lists, which will contain either
floats or arrays, again depending on whether the OperatingPoint object is vectorized or not.
Return type:
: Dict
run\_with\_stability\_derivatives(*alpha=True*, *beta=True*, *p=True*, *q=True*, *r=True*)
: Computes the aerodynamic forces and moments on the airplane, and the stability derivatives.
Arguments essentially determine which stability derivatives are computed. If a stability derivative is not
needed, leaving it False will speed up the computation.
Parameters:
: - **alpha** (*-*) – If True, compute the stability derivatives with respect to the angle of attack (alpha).
- **beta** (*-*) – If True, compute the stability derivatives with respect to the sideslip angle (beta).
- **p** (*-*) – If True, compute the stability derivatives with respect to the body-axis roll rate (p).
- **q** (*-*) – If True, compute the stability derivatives with respect to the body-axis pitch rate (q).
- **r** (*-*) – If True, compute the stability derivatives with respect to the body-axis yaw rate (r).
Return type:
: Dict[str, Union[Union[float, aerosandbox.geometry.np.ndarray], List[Union[float, aerosandbox.geometry.np.ndarray]]]]
Returns: a dictionary with keys:
> - ‘F\_g’ : an [x, y, z] list of forces in geometry axes [N]
> - ‘F\_b’ : an [x, y, z] list of forces in body axes [N]
> - ‘F\_w’ : an [x, y, z] list of forces in wind axes [N]
> - ‘M\_g’ : an [x, y, z] list of moments about geometry axes [Nm]
> - ‘M\_b’ : an [x, y, z] list of moments about body axes [Nm]
> - ‘M\_w’ : an [x, y, z] list of moments about wind axes [Nm]
> - ‘L’ : the lift force [N]. Definitionally, this is in wind axes.
> - ‘Y’ : the side force [N]. This is in wind axes.
> - ‘D’ : the drag force [N]. Definitionally, this is in wind axes.
> - ‘l\_b’ : the rolling moment, in body axes [Nm]. Positive is roll-right.
> - ‘m\_b’ : the pitching moment, in body axes [Nm]. Positive is pitch-up.
> - ‘n\_b’ : the yawing moment, in body axes [Nm]. Positive is nose-right.
> - ‘CL’ : the lift coefficient [-]. Definitionally, this is in wind axes.
> - ‘CY’ : the sideforce coefficient [-]. This is in wind axes.
> - ‘CD’ : the drag coefficient [-]. Definitionally, this is in wind axes.
> - ‘Cl’ : the rolling coefficient [-], in body axes
> - ‘Cm’ : the pitching coefficient [-], in body axes
> - ‘Cn’ : the yawing coefficient [-], in body axes
>
> Along with additional keys, depending on the value of the alpha, beta, p, q, and r arguments. For
> example, if alpha=True, then the following additional keys will be present:
>
> > - ‘CLa’ : the lift coefficient derivative with respect to alpha [1/rad]
> > - ‘CDa’ : the drag coefficient derivative with respect to alpha [1/rad]
> > - ‘CYa’ : the sideforce coefficient derivative with respect to alpha [1/rad]
> > - ‘Cla’ : the rolling moment coefficient derivative with respect to alpha [1/rad]
> > - ‘Cma’ : the pitching moment coefficient derivative with respect to alpha [1/rad]
> > - ‘Cna’ : the yawing moment coefficient derivative with respect to alpha [1/rad]
> > - ‘x\_np’: the neutral point location in the x direction [m]
>
> Nondimensional values are nondimensionalized using reference values in the AeroBuildup.airplane object.
>
> Data types:
> : - The “L”, “Y”, “D”, “l\_b”, “m\_b”, “n\_b”, “CL”, “CY”, “CD”, “Cl”, “Cm”, and “Cn” keys are:
>
> > - floats if the OperatingPoint object is not vectorized (i.e., if all attributes of OperatingPoint
> >
> > are floats, not arrays).
> >
> > - arrays if the OperatingPoint object is vectorized (i.e., if any attribute of OperatingPoint is an
> >
> > array).
> - The “F\_g”, “F\_b”, “F\_w”, “M\_g”, “M\_b”, and “M\_w” keys are always lists, which will contain either
>
> floats or arrays, again depending on whether the OperatingPoint object is vectorized or not.
wing\_aerodynamics()
: Return type:
: [AeroComponentResults](#aerosandbox.aerodynamics.LiftingLine.AeroComponentResults)
get\_induced\_velocity\_at\_points(*points*, *vortex\_strengths=None*)
: Computes the induced velocity at a set of points in the flowfield.
Parameters:
: - **points** (*aerosandbox.geometry.np.ndarray*) – A Nx3 array of points that you would like to know the induced velocities at. Given in geometry axes.
- **vortex\_strengths** (*aerosandbox.geometry.np.ndarray*) –
Return type:
: aerosandbox.geometry.np.ndarray
Returns: A Nx3 of the induced velocity at those points. Given in geometry axes.
get\_velocity\_at\_points(*points*, *vortex\_strengths=None*)
: Computes the velocity at a set of points in the flowfield.
Parameters:
: - **points** (*aerosandbox.geometry.np.ndarray*) – A Nx3 array of points that you would like to know the velocities at. Given in geometry axes.
- **vortex\_strengths** (*aerosandbox.geometry.np.ndarray*) –
Return type:
: aerosandbox.geometry.np.ndarray
Returns: A Nx3 of the velocity at those points. Given in geometry axes.
calculate\_fuselage\_influences(*points*)
: Parameters:
: **points** (*aerosandbox.geometry.np.ndarray*) –
Return type:
: aerosandbox.geometry.np.ndarray
calculate\_streamlines(*seed\_points=None*, *n\_steps=300*, *length=None*)
: Computes streamlines, starting at specific seed points.
After running this function, a new instance variable VortexLatticeFilaments.streamlines is computed
Uses simple forward-Euler integration with a fixed spatial stepsize (i.e., velocity vectors are normalized
before ODE integration). After investigation, it’s not worth doing fancier ODE integration methods (adaptive
schemes, RK substepping, etc.), due to the near-singular conditions near vortex filaments.
Parameters:
: - **seed\_points** (*aerosandbox.geometry.np.ndarray*) – A Nx3 ndarray that contains a list of points where streamlines are started. Will be
- **specified.** (*not*) –
- **n\_steps** (*int*) – The number of individual streamline steps to trace. Minimum of 2.
- **length** (*float*) – The approximate total length of the streamlines desired, in meters. Will be auto-calculated if
- **specified.** –
Returns:
: a 3D array with dimensions: (n\_seed\_points) x (3) x (n\_steps).
Consists of streamlines data.
Result is also saved as an instance variable, VortexLatticeMethod.streamlines.
Return type:
: streamlines
draw(*c=None*, *cmap=None*, *colorbar\_label=None*, *show=True*, *show\_kwargs=None*, *draw\_streamlines=True*, *recalculate\_streamlines=False*, *backend='pyvista'*)
: Draws the solution. Note: Must be called on a SOLVED AeroProblem object.
To solve an AeroProblem, use opti.solve(). To substitute a solved solution, use ap = sol(ap).
:return:
Parameters:
: - **c** (*aerosandbox.geometry.np.ndarray*) –
- **cmap** (*str*) –
- **colorbar\_label** (*str*) –
- **show** (*bool*) –
- **show\_kwargs** (*Dict*) –
- **backend** (*str*) – class aerosandbox.aerodynamics.NonlinearLiftingLine(airplane, op_point, xyz_ref=None, run_symmetric_if_possible=False, verbose=False, spanwise_resolution=8, spanwise_spacing_function=np.cosspace, vortex_core_radius=1e-08, align_trailing_vortices_with_wind=False)
: Bases: aerosandbox.ImplicitAnalysis
An implicit aerodynamics analysis based on lifting line theory, with modifications for nonzero sweep
and dihedral + multiple wings.
Nonlinear, and includes viscous effects based on 2D data.
Usage example:
: ```defaultanalysis = asb.NonlinearLiftingLine( airplane=my_airplane, op_point=asb.OperatingPoint( velocity=100, # m/s alpha=5, # deg beta=4, # deg p=0.01, # rad/sec q=0.02, # rad/sec r=0.03, # rad/sec ) ) outputs = analysis.run()
Parameters:
: - **airplane** ([*aerosandbox.geometry.Airplane*](/u/b315363d35db77b2#aerosandbox-geometry-airplane)) –
- **op\_point** ([*aerosandbox.performance.OperatingPoint*](/u/ef68b15c282639e3#aerosandbox-performance-operatingpoint)) –
- **xyz\_ref** (*List**[**float**]*) –
- **run\_symmetric\_if\_possible** (*bool*) –
- **verbose** (*bool*) –
- **spanwise\_spacing\_function** (*Callable**[**[**float**,* *float**,* *float**]**,* *aerosandbox.numpy.ndarray**]*) –
- **vortex\_core\_radius** (*float*) –
- **align\_trailing\_vortices\_with\_wind** (*bool*) –
airplane
op\_point
xyz\_ref *= None*
verbose *= False*
spanwise\_resolution *= 8*
spanwise\_spacing\_function
vortex\_core\_radius *= 1e-08*
align\_trailing\_vortices\_with\_wind *= False*
run\_symmetric *= False*
\_\_repr\_\_()
run(*solve=True*)
: Computes the aerodynamic forces.
Returns a dictionary with keys:
: - ‘residuals’: a list of residuals for each horseshoe element
- ‘F\_g’ : an [x, y, z] list of forces in geometry axes [N]
- ‘F\_b’ : an [x, y, z] list of forces in body axes [N]
- ‘F\_w’ : an [x, y, z] list of forces in wind axes [N]
- ‘M\_g’ : an [x, y, z] list of moments about geometry axes [Nm]
- ‘M\_b’ : an [x, y, z] list of moments about body axes [Nm]
- ‘M\_w’ : an [x, y, z] list of moments about wind axes [Nm]
- ‘L’ : the lift force [N]. Definitionally, this is in wind axes.
- ‘Y’ : the side force [N]. This is in wind axes.
- ‘D’ : the drag force [N]. Definitionally, this is in wind axes.
- ‘l\_b’, the rolling moment, in body axes [Nm]. Positive is roll-right.
- ‘m\_b’, the pitching moment, in body axes [Nm]. Positive is pitch-up.
- ‘n\_b’, the yawing moment, in body axes [Nm]. Positive is nose-right.
- ‘CL’, the lift coefficient [-]. Definitionally, this is in wind axes.
- ‘CY’, the sideforce coefficient [-]. This is in wind axes.
- ‘CD’, the drag coefficient [-]. Definitionally, this is in wind axes.
- ‘CDi’ the induced drag coefficient
- ‘CDp’ the profile drag coefficient
- ‘Cl’, the rolling coefficient [-], in body axes
- ‘Cm’, the pitching coefficient [-], in body axes
- ‘Cn’, the yawing coefficient [-], in body axes
Nondimensional values are nondimensionalized using reference values in the VortexLatticeMethod.airplane object.
Parameters:
: **solve** (*bool*) –
Return type:
: Dict[str, Any]
get\_induced\_velocity\_at\_points(*points*, *vortex\_strengths=None*)
: Computes the induced velocity at a set of points in the flowfield.
Parameters:
: - **points** (*aerosandbox.numpy.ndarray*) – A Nx3 array of points that you would like to know the induced velocities at. Given in geometry axes.
- **vortex\_strengths** (*aerosandbox.numpy.ndarray*) –
Return type:
: aerosandbox.numpy.ndarray
Returns: A Nx3 of the induced velocity at those points. Given in geometry axes.
get\_velocity\_at\_points(*points*, *vortex\_strengths=None*)
: Computes the velocity at a set of points in the flowfield.
Parameters:
: - **points** (*aerosandbox.numpy.ndarray*) – A Nx3 array of points that you would like to know the velocities at. Given in geometry axes.
- **vortex\_strengths** (*aerosandbox.numpy.ndarray*) –
Return type:
: aerosandbox.numpy.ndarray
Returns: A Nx3 of the velocity at those points. Given in geometry axes.
calculate\_fuselage\_influences(*points*)
: Parameters:
: **points** (*aerosandbox.numpy.ndarray*) –
Return type:
: aerosandbox.numpy.ndarray
calculate\_streamlines(*seed\_points=None*, *n\_steps=300*, *length=None*)
: Computes streamlines, starting at specific seed points.
After running this function, a new instance variable VortexLatticeFilaments.streamlines is computed
Uses simple forward-Euler integration with a fixed spatial stepsize (i.e., velocity vectors are normalized
before ODE integration). After investigation, it’s not worth doing fancier ODE integration methods (adaptive
schemes, RK substepping, etc.), due to the near-singular conditions near vortex filaments.
Parameters:
: - **seed\_points** (*aerosandbox.numpy.ndarray*) – A Nx3 ndarray that contains a list of points where streamlines are started. Will be
- **specified.** (*not*) –
- **n\_steps** (*int*) – The number of individual streamline steps to trace. Minimum of 2.
- **length** (*float*) – The approximate total length of the streamlines desired, in meters. Will be auto-calculated if
- **specified.** –
Returns:
: a 3D array with dimensions: (n\_seed\_points) x (3) x (n\_steps).
Consists of streamlines data.
Result is also saved as an instance variable, VortexLatticeMethod.streamlines.
Return type:
: streamlines
draw(*c=None*, *cmap=None*, *colorbar\_label=None*, *show=True*, *show\_kwargs=None*, *draw\_streamlines=True*, *recalculate\_streamlines=False*, *backend='pyvista'*)
: Draws the solution. Note: Must be called on a SOLVED AeroProblem object.
To solve an AeroProblem, use opti.solve(). To substitute a solved solution, use ap = sol(ap).
:return:
Parameters:
: - **c** (*aerosandbox.numpy.ndarray*) –
- **cmap** (*str*) –
- **colorbar\_label** (*str*) –
- **show** (*bool*) –
- **show\_kwargs** (*Dict*) –
- **backend** (*str*) –
<a id="aerosandbox.aerodynamics.AeroBuildup"></a> *class* aerosandbox.aerodynamics.AeroBuildup(*airplane*, *op\_point*, *xyz\_ref=None*, *model\_size='small'*, *include\_wave\_drag=True*)
: Bases: [`aerosandbox.ExplicitAnalysis`](/u/e98c1a890dad6c0c#aerosandbox-explicitanalysis)
A workbook-style aerodynamics buildup.
Example usage:
```default
>>> import aerosandbox as asb
>>> ab = asb.AeroBuildup( # This sets up the analysis, but doesn't execute calculation
>>> airplane=my_airplane, # type: asb.Airplane
>>> op_point=my_operating_point, # type: asb.OperatingPoint
>>> xyz_ref=[0.1, 0.2, 0.3], # Moment reference and center of rotation.
>>> )
>>> aero = ab.run() # This executes the actual aero analysis.
>>> aero_with_stability_derivs = ab.run_with_stability_derivatives() # Same, but also gets stability derivatives.Parameters:
: - **airplane** ([*aerosandbox.geometry.Airplane*](/u/b315363d35db77b2#aerosandbox-geometry-airplane)) –
- **op\_point** ([*aerosandbox.performance.OperatingPoint*](/u/ef68b15c282639e3#aerosandbox-performance-operatingpoint)) –
- **xyz\_ref** (*Union**[**aerosandbox.aerodynamics.aero\_3D.aero\_buildup\_submodels.fuselage\_aerodynamics\_utilities.np.ndarray**,* *List**[**float**]**]*) –
- **model\_size** (*str*) –
- **include\_wave\_drag** (*bool*) –
default\_analysis\_specific\_options
: This is part of AeroSandbox’s “analysis-specific options” feature, which lets you “tag” geometry objects with
flags that change how different analyses act on them.
This variable, default\_analysis\_specific\_options, allows you to specify default values for options that can be used for
specific problems.
This should be a dictionary, where: \* keys are the geometry-like types that you might be interested in defining
parameters for. \* values are dictionaries, where: \* keys are strings that label a given option \* values are
anything. These are used as the default values, in the event that the associated geometry doesn’t override those.
An example of what this variable might look like, for a vortex-lattice method aerodynamic analysis:
```defaultdefault_analysis_specific_options = { Airplane: dict( profile_drag_coefficient=0 ), Wing : dict( wing_level_spanwise_spacing=True, spanwise_resolution=12, spanwise_spacing="cosine", chordwise_resolution=12, chordwise_spacing="cosine", component=None, # type: int no_wake=False, no_alpha_beta=False, no_load=False, drag_polar=dict( CL1=0, CD1=0, CL2=0, CD2=0, CL3=0, CD3=0, ), ) }
airplane
op\_point
xyz\_ref *= None*
model\_size *= 'small'*
include\_wave\_drag *= True*
\_\_repr\_\_()
<a id="aerosandbox.aerodynamics.AeroBuildup.AeroComponentResults"></a> *class* AeroComponentResults
: s\_ref*: float*
c\_ref*: float*
b\_ref*: float*
op\_point*: [aerosandbox.performance.OperatingPoint](/u/ef68b15c282639e3#aerosandbox-performance-operatingpoint)*
F\_g*: List[float | aerosandbox.aerodynamics.aero\_3D.aero\_buildup\_submodels.fuselage\_aerodynamics\_utilities.np.ndarray]*
M\_g*: List[float | aerosandbox.aerodynamics.aero\_3D.aero\_buildup\_submodels.fuselage\_aerodynamics\_utilities.np.ndarray]*
span\_effective*: float*
oswalds\_efficiency*: float*
\_\_repr\_\_()
*property* F\_b*: List[float | aerosandbox.aerodynamics.aero\_3D.aero\_buildup\_submodels.fuselage\_aerodynamics\_utilities.np.ndarray]*
: An [x, y, z] list of forces in body axes [N]
Return type:
: List[Union[float, aerosandbox.aerodynamics.aero\_3D.aero\_buildup\_submodels.fuselage\_aerodynamics\_utilities.np.ndarray]]
*property* F\_w*: List[float | aerosandbox.aerodynamics.aero\_3D.aero\_buildup\_submodels.fuselage\_aerodynamics\_utilities.np.ndarray]*
: An [x, y, z] list of forces in wind axes [N]
Return type:
: List[Union[float, aerosandbox.aerodynamics.aero\_3D.aero\_buildup\_submodels.fuselage\_aerodynamics\_utilities.np.ndarray]]
*property* M\_b*: List[float | aerosandbox.aerodynamics.aero\_3D.aero\_buildup\_submodels.fuselage\_aerodynamics\_utilities.np.ndarray]*
: An [x, y, z] list of moments about body axes [Nm]
Return type:
: List[Union[float, aerosandbox.aerodynamics.aero\_3D.aero\_buildup\_submodels.fuselage\_aerodynamics\_utilities.np.ndarray]]
*property* M\_w*: List[float | aerosandbox.aerodynamics.aero\_3D.aero\_buildup\_submodels.fuselage\_aerodynamics\_utilities.np.ndarray]*
: An [x, y, z] list of moments about wind axes [Nm]
Return type:
: List[Union[float, aerosandbox.aerodynamics.aero\_3D.aero\_buildup\_submodels.fuselage\_aerodynamics\_utilities.np.ndarray]]
*property* L*: float | aerosandbox.aerodynamics.aero\_3D.aero\_buildup\_submodels.fuselage\_aerodynamics\_utilities.np.ndarray*
: The lift force [N]. Definitionally, this is in wind axes.
Return type:
: Union[float, aerosandbox.aerodynamics.aero\_3D.aero\_buildup\_submodels.fuselage\_aerodynamics\_utilities.np.ndarray]
*property* Y*: float | aerosandbox.aerodynamics.aero\_3D.aero\_buildup\_submodels.fuselage\_aerodynamics\_utilities.np.ndarray*
: The side force [N]. Definitionally, this is in wind axes.
Return type:
: Union[float, aerosandbox.aerodynamics.aero\_3D.aero\_buildup\_submodels.fuselage\_aerodynamics\_utilities.np.ndarray]
*property* D*: float | aerosandbox.aerodynamics.aero\_3D.aero\_buildup\_submodels.fuselage\_aerodynamics\_utilities.np.ndarray*
: The drag force [N]. Definitionally, this is in wind axes.
Return type:
: Union[float, aerosandbox.aerodynamics.aero\_3D.aero\_buildup\_submodels.fuselage\_aerodynamics\_utilities.np.ndarray]
*property* l\_b*: float | aerosandbox.aerodynamics.aero\_3D.aero\_buildup\_submodels.fuselage\_aerodynamics\_utilities.np.ndarray*
: The rolling moment [Nm] in body axes. Positive is roll-right.
Return type:
: Union[float, aerosandbox.aerodynamics.aero\_3D.aero\_buildup\_submodels.fuselage\_aerodynamics\_utilities.np.ndarray]
*property* m\_b*: float | aerosandbox.aerodynamics.aero\_3D.aero\_buildup\_submodels.fuselage\_aerodynamics\_utilities.np.ndarray*
: The pitching moment [Nm] in body axes. Positive is nose-up.
Return type:
: Union[float, aerosandbox.aerodynamics.aero\_3D.aero\_buildup\_submodels.fuselage\_aerodynamics\_utilities.np.ndarray]
*property* n\_b*: float | aerosandbox.aerodynamics.aero\_3D.aero\_buildup\_submodels.fuselage\_aerodynamics\_utilities.np.ndarray*
: The yawing moment [Nm] in body axes. Positive is nose-right.
Return type:
: Union[float, aerosandbox.aerodynamics.aero\_3D.aero\_buildup\_submodels.fuselage\_aerodynamics\_utilities.np.ndarray]
run()
: Computes the aerodynamic forces and moments on the airplane.
Returns: a dictionary with keys:
> - ‘F\_g’ : an [x, y, z] list of forces in geometry axes [N]
> - ‘F\_b’ : an [x, y, z] list of forces in body axes [N]
> - ‘F\_w’ : an [x, y, z] list of forces in wind axes [N]
> - ‘M\_g’ : an [x, y, z] list of moments about geometry axes [Nm]
> - ‘M\_b’ : an [x, y, z] list of moments about body axes [Nm]
> - ‘M\_w’ : an [x, y, z] list of moments about wind axes [Nm]
> - ‘L’ : the lift force [N]. Definitionally, this is in wind axes.
> - ‘Y’ : the side force [N]. This is in wind axes.
> - ‘D’ : the drag force [N]. Definitionally, this is in wind axes.
> - ‘l\_b’, the rolling moment, in body axes [Nm]. Positive is roll-right.
> - ‘m\_b’, the pitching moment, in body axes [Nm]. Positive is pitch-up.
> - ‘n\_b’, the yawing moment, in body axes [Nm]. Positive is nose-right.
> - ‘CL’, the lift coefficient [-]. Definitionally, this is in wind axes.
> - ‘CY’, the sideforce coefficient [-]. This is in wind axes.
> - ‘CD’, the drag coefficient [-]. Definitionally, this is in wind axes.
> - ‘Cl’, the rolling coefficient [-], in body axes
> - ‘Cm’, the pitching coefficient [-], in body axes
> - ‘Cn’, the yawing coefficient [-], in body axes
>
> Nondimensional values are nondimensionalized using reference values in the AeroBuildup.airplane object.
>
> Data types:
> : - The “L”, “Y”, “D”, “l\_b”, “m\_b”, “n\_b”, “CL”, “CY”, “CD”, “Cl”, “Cm”, and “Cn” keys are:
>
> > - floats if the OperatingPoint object is not vectorized (i.e., if all attributes of OperatingPoint
> >
> > are floats, not arrays).
> >
> > - arrays if the OperatingPoint object is vectorized (i.e., if any attribute of OperatingPoint is an
> >
> > array).
> - The “F\_g”, “F\_b”, “F\_w”, “M\_g”, “M\_b”, and “M\_w” keys are always lists, which will contain either
>
> floats or arrays, again depending on whether the OperatingPoint object is vectorized or not.
Return type:
: Dict[str, Union[Union[float, aerosandbox.aerodynamics.aero\_3D.aero\_buildup\_submodels.fuselage\_aerodynamics\_utilities.np.ndarray], List[Union[float, aerosandbox.aerodynamics.aero\_3D.aero\_buildup\_submodels.fuselage\_aerodynamics\_utilities.np.ndarray]]]]
run\_with\_stability\_derivatives(*alpha=True*, *beta=True*, *p=True*, *q=True*, *r=True*)
: Computes the aerodynamic forces and moments on the airplane, and the stability derivatives.
Arguments essentially determine which stability derivatives are computed. If a stability derivative is not
needed, leaving it False will speed up the computation.
Parameters:
: - **alpha** (*-*) – If True, compute the stability derivatives with respect to the angle of attack (alpha).
- **beta** (*-*) – If True, compute the stability derivatives with respect to the sideslip angle (beta).
- **p** (*-*) – If True, compute the stability derivatives with respect to the body-axis roll rate (p).
- **q** (*-*) – If True, compute the stability derivatives with respect to the body-axis pitch rate (q).
- **r** (*-*) – If True, compute the stability derivatives with respect to the body-axis yaw rate (r).
Return type:
: Dict[str, Union[Union[float, aerosandbox.aerodynamics.aero\_3D.aero\_buildup\_submodels.fuselage\_aerodynamics\_utilities.np.ndarray], List[Union[float, aerosandbox.aerodynamics.aero\_3D.aero\_buildup\_submodels.fuselage\_aerodynamics\_utilities.np.ndarray]]]]
Returns: a dictionary with keys:
> - ‘F\_g’ : an [x, y, z] list of forces in geometry axes [N]
> - ‘F\_b’ : an [x, y, z] list of forces in body axes [N]
> - ‘F\_w’ : an [x, y, z] list of forces in wind axes [N]
> - ‘M\_g’ : an [x, y, z] list of moments about geometry axes [Nm]
> - ‘M\_b’ : an [x, y, z] list of moments about body axes [Nm]
> - ‘M\_w’ : an [x, y, z] list of moments about wind axes [Nm]
> - ‘L’ : the lift force [N]. Definitionally, this is in wind axes.
> - ‘Y’ : the side force [N]. This is in wind axes.
> - ‘D’ : the drag force [N]. Definitionally, this is in wind axes.
> - ‘l\_b’ : the rolling moment, in body axes [Nm]. Positive is roll-right.
> - ‘m\_b’ : the pitching moment, in body axes [Nm]. Positive is pitch-up.
> - ‘n\_b’ : the yawing moment, in body axes [Nm]. Positive is nose-right.
> - ‘CL’ : the lift coefficient [-]. Definitionally, this is in wind axes.
> - ‘CY’ : the sideforce coefficient [-]. This is in wind axes.
> - ‘CD’ : the drag coefficient [-]. Definitionally, this is in wind axes.
> - ‘Cl’ : the rolling coefficient [-], in body axes
> - ‘Cm’ : the pitching coefficient [-], in body axes
> - ‘Cn’ : the yawing coefficient [-], in body axes
>
> Along with additional keys, depending on the value of the alpha, beta, p, q, and r arguments. For
> example, if alpha=True, then the following additional keys will be present:
>
> > - ‘CLa’ : the lift coefficient derivative with respect to alpha [1/rad]
> > - ‘CDa’ : the drag coefficient derivative with respect to alpha [1/rad]
> > - ‘CYa’ : the sideforce coefficient derivative with respect to alpha [1/rad]
> > - ‘Cla’ : the rolling moment coefficient derivative with respect to alpha [1/rad]
> > - ‘Cma’ : the pitching moment coefficient derivative with respect to alpha [1/rad]
> > - ‘Cna’ : the yawing moment coefficient derivative with respect to alpha [1/rad]
> > - ‘x\_np’: the neutral point location in the x direction [m]
>
> Nondimensional values are nondimensionalized using reference values in the AeroBuildup.airplane object.
>
> Data types:
> : - The “L”, “Y”, “D”, “l\_b”, “m\_b”, “n\_b”, “CL”, “CY”, “CD”, “Cl”, “Cm”, and “Cn” keys are:
>
> > - floats if the OperatingPoint object is not vectorized (i.e., if all attributes of OperatingPoint
> >
> > are floats, not arrays).
> >
> > - arrays if the OperatingPoint object is vectorized (i.e., if any attribute of OperatingPoint is an
> >
> > array).
> - The “F\_g”, “F\_b”, “F\_w”, “M\_g”, “M\_b”, and “M\_w” keys are always lists, which will contain either
>
> floats or arrays, again depending on whether the OperatingPoint object is vectorized or not.
wing\_aerodynamics(*wing*, *include\_induced\_drag=True*)
: Estimates the aerodynamic forces, moments, and derivatives on a wing in isolation.
Moments are given with the reference at Wing [0, 0, 0].
Parameters:
: - **wing** ([*aerosandbox.geometry.Wing*](/u/b315363d35db77b2#aerosandbox-geometry-wing)) – A Wing object that you wish to analyze.
- **op\_point** – The OperatingPoint that you wish to analyze the fuselage at.
- **include\_induced\_drag** (*bool*) –
Return type:
: [AeroComponentResults](#aerosandbox.aerodynamics.AeroBuildup.AeroComponentResults)
Returns:
fuselage\_aerodynamics(*fuselage*, *include\_induced\_drag=True*)
: Estimates the aerodynamic forces, moments, and derivatives on a fuselage in isolation.
Assumes:
: - The fuselage is a body of revolution aligned with the x\_b axis.
- The angle between the nose and the freestream is less than 90 degrees.
Moments are given with the reference at Fuselage [0, 0, 0].
Uses methods from Jorgensen, Leland Howard. “Prediction of Static Aerodynamic Characteristics for Slender Bodies
Alone and with Lifting Surfaces to Very High Angles of Attack”. NASA TR R-474. 1977.
Parameters:
: - **fuselage** ([*aerosandbox.geometry.Fuselage*](/u/b315363d35db77b2#aerosandbox-geometry-fuselage)) – A Fuselage object that you wish to analyze.
- **include\_induced\_drag** (*bool*) –
Return type:
: [AeroComponentResults](#aerosandbox.aerodynamics.AeroBuildup.AeroComponentResults)
Returns:
<a id="aerosandbox.aerodynamics.AVL"></a> *class* aerosandbox.aerodynamics.AVL(*airplane*, *op\_point*, *xyz\_ref=None*, *avl\_command='avl'*, *verbose=False*, *timeout=5*, *working\_directory=None*, *ground\_effect=False*, *ground\_effect\_height=0*)
: Bases: [`aerosandbox.common.ExplicitAnalysis`](/u/6d3330afd901bed5#aerosandbox-common-explicitanalysis)
An interface to AVL, a 3D vortex lattice aerodynamics code developed by Mark Drela at MIT.
Requires AVL to be on your computer; AVL is available here: <https://web.mit.edu/drela/Public/web/avl/>
It is recommended (but not required) that you add AVL to your system PATH environment variable such that it can
be called with the command avl. If this is not the case, you need to specify the path to your AVL
executable using the avl\_command argument of the constructor.
Usage example:
```default
>>> avl = asb.AVL(
>>> airplane=my_airplane,
>>> op_point=asb.OperatingPoint(
>>> velocity=100, # m/s
>>> alpha=5, # deg
>>> beta=4, # deg
>>> p=0.01, # rad/sec
>>> q=0.02, # rad/sec
>>> r=0.03, # rad/sec
>>> )
>>> )
>>> outputs = avl.run()Parameters:
: - **airplane** ([*aerosandbox.geometry.Airplane*](/u/b315363d35db77b2#aerosandbox-geometry-airplane)) –
- **op\_point** ([*aerosandbox.performance.OperatingPoint*](/u/ef68b15c282639e3#aerosandbox-performance-operatingpoint)) –
- **xyz\_ref** (*List**[**float**]*) –
- **avl\_command** (*str*) –
- **verbose** (*bool*) –
- **timeout** (*Union**[**float**,* *int**,* *None**]*) –
- **working\_directory** (*str*) –
- **ground\_effect** (*bool*) –
- **ground\_effect\_height** (*float*) –
default\_analysis\_specific\_options
: This is part of AeroSandbox’s “analysis-specific options” feature, which lets you “tag” geometry objects with
flags that change how different analyses act on them.
This variable, default\_analysis\_specific\_options, allows you to specify default values for options that can be used for
specific problems.
This should be a dictionary, where: \* keys are the geometry-like types that you might be interested in defining
parameters for. \* values are dictionaries, where: \* keys are strings that label a given option \* values are
anything. These are used as the default values, in the event that the associated geometry doesn’t override those.
An example of what this variable might look like, for a vortex-lattice method aerodynamic analysis:
```defaultdefault_analysis_specific_options = { Airplane: dict( profile_drag_coefficient=0 ), Wing : dict( wing_level_spanwise_spacing=True, spanwise_resolution=12, spanwise_spacing="cosine", chordwise_resolution=12, chordwise_spacing="cosine", component=None, # type: int no_wake=False, no_alpha_beta=False, no_load=False, drag_polar=dict( CL1=0, CD1=0, CL2=0, CD2=0, CL3=0, CD3=0, ), ) }
AVL\_spacing\_parameters
airplane
op\_point
xyz\_ref *= None*
avl\_command *= 'avl'*
verbose *= False*
timeout *= 5*
working\_directory *= None*
ground\_effect *= False*
ground\_effect\_height *= 0*
\_\_repr\_\_()
open\_interactive()
: Opens a new terminal window and runs AVL interactively. This is useful for detailed analysis or debugging.
Returns: None
Return type:
: None
run(*run\_command=None*)
: Private function to run AVL.
Args: run\_command: A string with any AVL keystroke inputs that you’d like. By default, you start off within the OPER
menu. All of the inputs indicated in the constructor have been set already, but you can override them here (
for this run only) if you want.
Returns: A dictionary containing all of your results.
Parameters:
: **run\_command** (*str*) –
Return type:
: Dict[str, float]
\_default\_keystroke\_file\_contents()
: Return type:
: List[str]
write\_avl(*filepath=None*)
: Writes a .avl file corresponding to this airplane to a filepath.
For use with the AVL vortex-lattice-method aerodynamics analysis tool by Mark Drela at MIT.
AVL is available here: <https://web.mit.edu/drela/Public/web/avl/>
Parameters:
: **filepath** (*Union**[**pathlib.Path**,* *str**]*) – filepath (including the filename and .avl extension) [string]
If None, this function returns the .avl file as a string.
Return type:
: None
Returns: None
*static* write\_avl\_bfile(*fuselage*, *filepath=None*, *include\_name=True*)
: Writes an AVL-compatible BFILE corresponding to this fuselage to a filepath.
For use with the AVL vortex-lattice-method aerodynamics analysis tool by Mark Drela at MIT.
AVL is available here: <https://web.mit.edu/drela/Public/web/avl/>
Parameters:
: - **filepath** (*Union**[**pathlib.Path**,* *str**]*) – filepath (including the filename and .avl extension) [string]
If None, this function returns the would-be file contents as a string.
- **include\_name** (*bool*) – Should the name of the fuselage be included in the .dat file? (This should be True for use with AVL.)
Return type:
: str
Returns:
*static* parse\_unformatted\_data\_output(*s*, *data\_identifier=' = '*, *cast\_outputs\_to\_float=True*, *overwrite=None*)
: Parses a (multiline) string of unformatted data into a nice and tidy dictionary.
The expected input string looks like what you might get as an output from AVL (or many other Drela codes),
which may list data in ragged order.
An example input s that you might want to parse could look like the following:
[``](#id1)[`](#id3)
: Standard axis orientation, X fwd, Z down
Run case: -unnamed-
> Alpha = 0.43348 pb/2V = -0.00000 p’b/2V = -0.00000
> Beta = 0.00000 qc/2V = 0.00000
> Mach = 0.003 rb/2V = -0.00000 r’b/2V = -0.00000
>
> CXtot = -0.02147 Cltot = 0.00000 Cl’tot = 0.00000
> CYtot = 0.00000 Cmtot = 0.28149
> CZtot = -1.01474 Cntot = -0.00000 Cn’tot = -0.00000
>
> CLtot = 1.01454
> CDtot = 0.02915
> CDvis = 0.00000 CDind = 0.0291513
> CLff = 1.00050 CDff = 0.0297201 | Trefftz
> CYff = 0.00000 e = 0.9649 | Plane
[``](#id5)[`](#id7)
Here, this function will go through this string and extract each key-value pair, as denoted by the data
identifier (by default, “ = “). It will pull the next whole word without spaces to the left as the key,
and it will pull the next whole word without spaces to the right as the value. Together, these will be
returned as a Dict.
So, the output for the input above would be:
{
> ‘Alpha’ : 0.43348,
> ‘pb/2V’ : -0.00000,
> ‘p’b/2V’ : -0.00000,
> ‘Beta’ : 0.00000,
> # and so on…
}
Parameters:
: - **s** (*str*) – The input string to identify. Can be multiline.
- **data\_identifier** (*str*) – The triggering substring for a new key-value pair. By default, it’s “ = “,
- **this** (*which is convention in many output files from Mark Drela's codes. Be careful if you decide to change*) –
- **"="** (*to*) –
- **separators** (*as you could pick up on heading*) –
- **cast\_outputs\_to\_float** (*bool*) – If this boolean flag is set true, the values of the key-value pairs are cast to
- **returning** (*floating-point numbers before*) –
- **cast** –
- **downstream** (*a NaN is returned* *(**guaranteeing that you can do floating-point math with the outputs in*) –
- **applications.****)** –
- **overwrite** (*bool*) –
Determines the behavior if you find a key that’s already in the dictionary.
- By default, value is None. In this case, an error is raised.
- If you set it to True, the new value will overwrite the old one. Thus, your dictionary will have
the last matching value from the string.
- If you set it to False, the new value will be discarded. Thus, your dictionary will have the first
matching value from the string.
Return type:
: Dict[str, float]
Returns: A dictionary of key-value pairs, corresponding to the unformatted data in the input string.
> Keys are strings, values are floats if cast\_outputs\_to\_float is True, otherwise also strings.