Library

Public API

Inputting Airfoil Coordinates

Xfoil.set_coordinatesFunction
set_coordinates(x, y)

Input x and y airfoil coordinates into XFOIL. Coordinates must start at the trailing edge and loop counterclockwise.

source
Xfoil.paneFunction
pane(; kwargs...)

Run XFOIL's PANE command (Repanel the input airfoil)

Arguments

  • npan::Integer=140: Number of panel nodes
  • cvpar::Float64=1.0: Panel bunching parameter
  • cterat::Float64=0.15: TE/LE panel density ratio
  • ctrrat::Float64=0.2: Refined-area/LE panel density ratio
  • xsref1::Float64=1.0: Top side refined area x/c limits
  • xsref2::Float64=1.0:
  • xpref1::Float64=1.0: Bottom side refined area x/c limits
  • xpref2::Float64=1.0:
source

Viscous Airfoil Analysis

Xfoil.solve_alphaFunction
solve_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 number
  • mach: Mach number
  • iter: Number of iterations
  • ncrit: turbulence level
source
Xfoil.alpha_sweepFunction
alpha_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 counterclockwise
  • y:
  • alpha: Array of angle of attacks in degrees
  • re: Reynolds number
  • ma: Mach number
  • iter=50: Maximum number of iterations for each XFOIL run
  • npan=140: Number of panels
  • percussive_maintenance=true: Flag to call do_percussive_maintenance upon convergence failure
  • printdata=false: Flag to indicate whether to print data obtained from XFOIL during the solution
  • zeroinit=true: Flag to indicate whether to start angle of attack sweeps from zero 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
source

Extracting Boundary Layer Data

Xfoil.get_xsepFunction
get_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.

source
Xfoil.bldumpFunction
bldump()

Return boundary layer parameters s, x, y, ue, dstar, theta, and cf

source

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.pane_csFunction
pane_cs(; kwargs...)

pane for complex step enabled version of XFOIL.

source
Xfoil.solve_alpha_csFunction
solve_alpha_cs(alpha, re; mach=0.0, iter=50, ncrit=9)

solve_alpha for the complex step enabled version of XFOIL.

source
Xfoil.alpha_sweep_csFunction
alpha_sweep_cs(x, y, alpha, re; kwargs...)

alpha_sweep for the complex step enabled version of XFOIL.

source

Private API

Xfoil.do_percussive_maintenanceFunction
do_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

source

Index