Public API

Loading Airfoil Geometry

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

Repaneling Airfoils

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

Inviscid Airfoil Analysis

Xfoil.solve_alphaMethod
solve_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
source

Viscous Airfoil Analysis

Xfoil.solve_alphaMethod
solve_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 number
  • mach: Mach number
  • iter: Number of iterations
  • ncrit: turbulence level
  • reinit: reinitialize the solution? (rather than use the previous solution)
  • xtrip: forced transition x/c locations on top/bottom sides
source

Inviscid Angle of Attack Sweep

Xfoil.alpha_sweepMethod
alpha_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-clockwise
  • y: Airfoil y-coordinate starting from trailing edge looping counter-clockwise
  • alpha: Angle of attacks (in degrees)
  • ma: Mach number
  • npan=140: Number of panels
  • printdata=false: Print data obtained from XFOIL during the solution?
  • zeroinit=true: Start angle of attack sweeps from zero? If true, results will be sorted by ascending angle of attack.
source

Viscous Angle of Attack Sweep

Xfoil.alpha_sweepMethod
alpha_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-clockwise
  • y: Airfoil y-coordinate starting from trailing edge looping counter-clockwise
  • alpha: Angle of attacks (in degrees)
  • re: Reynolds number
  • ma: Mach number
  • xtrip=(1.0,1.0): forced transition x/c locations on top/bottom sides
  • reinit=false: reinitialize the solution? (rather than use the previous solution)
  • iter=50: Maximum iterations for viscous analyses
  • npan=140: Number of panels
  • percussive_maintenance=!reinit: Call do_percussive_maintenance upon convergence failure?
  • printdata=false: Print data obtained from XFOIL during the solution?
  • zeroinit=true: Start angle of attack sweeps from zero? If true, 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?
source

Separation Point

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

Boundary Layer Variables

Xfoil.bldumpFunction
bldump()

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

source

Pressure Coefficients

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.