Public API
Loading Airfoil Geometry
Xfoil.set_coordinates
— Functionset_coordinates(x, y)
Input x and y airfoil coordinates into XFOIL. Coordinates must start at the trailing edge and loop counterclockwise.
Repaneling Airfoils
Xfoil.pane
— Functionpane(; kwargs...)
Run XFOIL's PANE command (Repanel the input airfoil)
Arguments
npan::Integer=140
: Number of panel nodescvpar::Float64=1.0
: Panel bunching parametercterat::Float64=0.15
: TE/LE panel density ratioctrrat::Float64=0.2
: Refined-area/LE panel density ratioxsref1::Float64=1.0
: Top side refined area x/c limitsxsref2::Float64=1.0
:xpref1::Float64=1.0
: Bottom side refined area x/c limitsxpref2::Float64=1.0
:
Inviscid Airfoil Analysis
Xfoil.solve_alpha
— Methodsolve_alpha(alpha; mach=0.0)
Compute the inviscid flow solution at the specified angle of attack. Return cl and cm.
Arguments:
alpha
: Angle of attack (degrees)mach
: Mach number
Viscous Airfoil Analysis
Xfoil.solve_alpha
— Methodsolve_alpha(alpha, re; mach=0.0, iter=50, ncrit=9, reinit=false, xtrip=(1.0,1.0))
Compute the viscous flow solution at the specified angle of attack. Return cl, cd, cdp, cm, and a convergence flag indicating whether the solution converged.
Arguments:
alpha
: Angle of attack (degrees)re
: Reynolds numbermach
: Mach numberiter
: Number of iterationsncrit
: turbulence levelreinit
: reinitialize the solution? (rather than use the previous solution)xtrip
: forced transition x/c locations on top/bottom sides
Inviscid Angle of Attack Sweep
Xfoil.alpha_sweep
— Methodalpha_sweep(x, y, alpha; kwargs...)
Perform an inviscid analysis for a series of angles of attacks using XFOIL. Return cl and cm.
Arguments
x
: Airfoil x-coordinate starting from trailing edge looping counter-clockwisey
: Airfoil y-coordinate starting from trailing edge looping counter-clockwisealpha
: Angle of attacks (in degrees)ma
: Mach numbernpan=140
: Number of panelsprintdata=false
: Print data obtained from XFOIL during the solution?zeroinit=true
: Start angle of attack sweeps from zero? Iftrue
, results will be sorted by ascending angle of attack.
Viscous Angle of Attack Sweep
Xfoil.alpha_sweep
— Methodalpha_sweep(x, y, alpha, re; kwargs...)
Perform angle of attack sweep using XFOIL. Return cl, cd, cdp, cm, converged.
Arguments
x
: Airfoil x-coordinate starting from trailing edge looping counter-clockwisey
: Airfoil y-coordinate starting from trailing edge looping counter-clockwisealpha
: Angle of attacks (in degrees)re
: Reynolds numberma
: Mach numberxtrip=(1.0,1.0)
: forced transition x/c locations on top/bottom sidesreinit=false
: reinitialize the solution? (rather than use the previous solution)iter=50
: Maximum iterations for viscous analysesnpan=140
: Number of panelspercussive_maintenance=!reinit
: Calldo_percussive_maintenance
upon convergence failure?printdata=false
: Print data obtained from XFOIL during the solution?zeroinit=true
: Start angle of attack sweeps from zero? Iftrue
, results will be sorted by ascending angle of attack.clmaxstop=false
: Stop if lift coefficient decreases twice consecutively going up?clminstop=false
: Stop if lift coefficient increases twice consecutively going down?
Separation Point
Xfoil.get_xsep
— Functionget_xsep()
Return x-position of the separation point closest to the trailing edge on the upper and lower airfoil surfaces. This location is defined as the point where the friction coefficient becomes negative.
Boundary Layer Variables
Xfoil.bldump
— Functionbldump()
Return boundary layer parameters s
, x
, y
, ue
, dstar
, theta
, and cf
Pressure Coefficients
Xfoil.cpdump
— Functioncpdump()
Return x
and cp
Complex Step Version of XFOIL
The complex step version of each function is denoted by appending _cs
to each function name. Note that there is no interaction between the two versions of XFOIL wrapped by this package, so if you wish to use the complex step version of the code you must append _cs
to all function names.