Library
Public API
Inputting Airfoil Coordinates
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.
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:
Viscous Airfoil Analysis
Xfoil.solve_alpha — Functionsolve_alpha(alpha, re; mach=0.0, iter=50, ncrit=9)Compute the flow solution at the specified angle of attack. Returns 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 level
Xfoil.alpha_sweep — Functionalpha_sweep(x, y, alpha, re; kwargs...)Perform angle of attack sweep using XFOIL. Return cl, cd, cdp, cm, converged.
Arguments
x: Airfoil coordinates start from trailing edge looping counterclockwisey:alpha: Array of angle of attacks in degreesre: Reynolds numberma: Mach numberiter=50: Maximum number of iterations for each XFOIL runnpan=140: Number of panelspercussive_maintenance=true: Flag to calldo_percussive_maintenanceupon convergence failureprintdata=false: Flag to indicate whether to print data obtained from XFOIL during the solutionzeroinit=true: Flag to indicate whether to start angle of attack sweeps from zero angle of attackclmaxstop=false: Stop if lift coefficient decreases twice consecutively going upclminstop=false: Stop if lift coefficient increases twice consecutively going down
Extracting Boundary Layer Data
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.
Xfoil.bldump — Functionbldump()Return boundary layer parameters s, x, y, ue, dstar, theta, and cf
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.
The following functions are available for use with the complex step version of XFOIL:
Xfoil.set_coordinates_cs — Functionset_coordinates_cs(x, y)set_coordinates for complex step enabled version of XFOIL.
Xfoil.pane_cs — Functionpane_cs(; kwargs...)pane for complex step enabled version of XFOIL.
Xfoil.solve_alpha_cs — Functionsolve_alpha_cs(alpha, re; mach=0.0, iter=50, ncrit=9)solve_alpha for the complex step enabled version of XFOIL.
Xfoil.alpha_sweep_cs — Functionalpha_sweep_cs(x, y, alpha, re; kwargs...)alpha_sweep for the complex step enabled version of XFOIL.
Xfoil.get_xsep_cs — Functionget_xsep_cs()get_xsep for the complex step enabled version of XFOIL.
Xfoil.bldump_cs — Functionbldump_cs()bldump for the complex step enabled version of XFOIL.
Private API
Xfoil.XfoilGlobals — TypeXfoilGlobalsHolds XFOIL global variables
Xfoil.get_globals — Functionget_globals()Wraps the global variables in XFOIL in a struct
Xfoil.get_globals_cs — Functionget_globals_cs()get_globals for the complex step enabled version of XFOIL.
Xfoil.do_percussive_maintenance — Functiondo_percussive_maintenance(x, y, alpha, re, iter, npan, ncrit)Attempts to converge previously unconverged XFOIL solutions by perturbing the starting point for the XFOIL solve. Returns cl, cd, cdp, cm, converged
Xfoil.do_percussive_maintenance_cs — Functiondo_percussive_maintenance_cs(x, y, alpha, re, iter, npan, ncrit)do_percussive_maintenance for the complex step enabled version of XFOIL.
Index
Xfoil.XfoilGlobalsXfoil.alpha_sweepXfoil.alpha_sweep_csXfoil.bldumpXfoil.bldump_csXfoil.do_percussive_maintenanceXfoil.do_percussive_maintenance_csXfoil.get_globalsXfoil.get_globals_csXfoil.get_xsepXfoil.get_xsep_csXfoil.paneXfoil.pane_csXfoil.set_coordinatesXfoil.set_coordinates_csXfoil.solve_alphaXfoil.solve_alpha_cs