XFOIL 6.94 Tutorial

SUBJECT

How to make a viscous drag and lift polar of a file-saved profile using XFOIL.

Click here for the Clark Y coordinate file

These are instructions on how to create a file that saves the 2D viscous drag and lift polars using the XFOIL program available from Mark Drela of MIT. These instructions are a useful way to reduce the steep curve associated with learning XFOIL, and they should be used in conjunction with the official instruction manual available on the XFOIL website. These instructions were originally written for a college technical writing class, which required that I write to a very basic level. Their implementation here is meant to provide more detail and explanation of the basic use of the program and common pitfalls. Also attached is the coordinate file for a Clark Y airfoil originally sourced from a course website of JD Jacob at the University of Kentucky. This file shows the proper format to save input coordinates for use with XFOIL.

ASSUMPTIONS

XFOIL can currently be downloaded here.

These instructions assume that a Windows operating system is being used. Before getting started it is important to make sure that your saved coordinate file is saved in the same folder as the XFOIL program executable is in. If you are not planning on using a saved coordinate file (i.e. using the supplied NACA command), then this can be skipped. The executable file is named xfoilP3.exe, or xfoilP4.exe, depending on which version of the program you've downloaded. If you don't remember where this folder is, you can find it using the "Find -> Files or Folders" option in the Start Menu. This is important because this is the default folder for the program, and as such is where all the outputted data will be saved.

PROCEDURE

  1. Start the XFOIL program by either:
    1. double clicking on the xfoil3.exe icon in the Windows Explorer program
    2. double clicking on the xfoil3.exe icon in the Find: Files or Folders program (after have searched for the file)
    As mentioned above, this load will only work if the file clarky.dat is saved in the same folder as the XFOIL executable.
  2. Load the desired airfoil into the XFOIL program by typing at the prompt: load file.suffix <ENTER> (where file is the name of your coordinate file, and suffix is the proper file designation, i.e. txt, dat, etc. An example of this would be: load clarky.dat <ENTER>)
  3. There are two main errors that can occur if your coordinate file doesn't meet XFOIL's requirements. One occurs when the coordinate file isn't formatted correctly, the other happens when the file doesn't have enough points around the Leading Edge (LE).
    1. If the program closes after executing the load command, then your coordinate file is not formated correctly. Coordinate files have to be in column format: x y, with the columns separated by spaces. Also the x coordinates must wrap around, i.e. 1.0 - 0.0 - 1.0, unlike the Selig coordinate convention. Finally if the airfoil is named (i.e. Clark Y), the name must be on the file's first line, and it must start with a letter.
    2. This will indicate that you need to go to the GDES menu, and then enter CADD. I have found that simply hitting <ENTER> through all the CADD command options solves this problem. Then head back to the main XFOIL menu by typing <ENTER>, then type PANE <ENTER>. In order to alleviate having to do this each time you load the airfoil, type SAVE <ENTER> and type in a new name at the prompt, such as testfoil_smooth.txt.
  4. Calculate the Reynolds Number that you would like to prepare this polar for, using the equation Re = ( Rho * Vl )/ mu.
    This is important because most airfoils are entered into XFOIL with a non-dimensional length. Steps 7 and 8 tell XFOIL what flight speed, chord length, and altitude the airfoil is operating at.
  5. Calculate the Mach Number using the formula V = M/a. If you don't know the local speed of sound ( a ) for your altitude you can use the Standard Atmosphere Calculator found here.
  6. Enter the operational menu of XFOIL by typing at the prompt: oper <ENTER>
  7. Enter the viscous mode of XFOIL by typing the visc command followed by the calculated Reynolds number.
    E.g.

    visc 8.8e5 <ENTER>

    or

    visc 880000 <ENTER>

    both set the Reynolds number to 880000. If you type: visc <ENTER>, XFOIL will prompt you to type the Reynolds Number followed by <ENTER>. YOU MUST HAVE CALCULATED A REYNOLDS NUMBER TO USE THE VISCOUS REGIME.
  8. Enter the flight Mach number at the prompt with: mach 0.4 <ENTER>. Where 0.4 stands for the Mach number you calculated.
  9. Adjust the Ncrit value by entering the viscous parameters menu: VPAR <ENTER>
    Then set the Ncrit value to 7:
    N <ENTER>
    7 <ENTER>
    Then exit the VPAR menu by typing <ENTER>
  10. Before starting an accumulation, its helpful to find the angle of attack that corresponds to a Cl of 0.0. During normal flight a wing airfoil will rarely see negative angles of attack, and a Cl 0.1 generally corresponds to the region of Vmax, thus starting at a Cl of 0.0 allows a complete picture of the high-speed drag of the airfoil. Type:C 0.0<ENTER>
    A warning will be displayed in XFOIL and on the XPANE window if the first series of calculations did not converge. Simply type:! to continue iterating solutions until it converges.
  11. Allow XFOIL to output polar data to a file by typing: PACC <ENTER>
  12. Enter the (new) filename that the data will be saved to at the following prompt. E.g. clarkY_polar.txt
  13. Skip the dump file naming by hitting the <ENTER> key. This accumulation is usually superfluous, clutters up your folder, and is often only useful if XFOIL runs into an error.
  14. Direct XFOIL to do an angle of attack (or "alpha") sweep. This can be done in either one step or three. The data required is first angle of attack, final angle of attack, and angle of attack increment. Use a convient approximation of the angle of attack found in step 10 for the first angle. A good range of delta values is between 0.05 and 0.5, any larger and you loose fidelity, any smaller and you might exceed the memory buffer limit.


    An example of the one step is: as -4 18 0.1 <ENTER>

    This will start the airfoil at negative four degrees, and proceed to 18 degrees in 0.1 degree increments. It is important to be conservative in your maximum negative alpha because XFOIL often times has trouble doing the computation. If you simply enter as <ENTER> XFOIL will prompt you for the next three numbers.
  15. It is best to use the init command before running successive polar accumulations. The program remembers the solution to the last alpha or Cl computed, and uses it to aid in the current solution. Thus, too large a jump in alpha, or Cl can cause the solution to not converge. However, XFOIL can do either ascending or descending sweeps, but you have to be careful of airfoil hysteresis near Clmax.
  16. Another method of accumulating data is a CL sweep. This method might be more convenient if you are doing complete aircraft polar estimation. To do this is similar; the data required is the first CL, the final CL, and the CL increment.

    An example of the one step is: cs -0.4 1.4 0.1 <ENTER>

    This will start the airfoil at negative 0.4 CL, and proceed to 1.4 CL in 0.1 CL increments. If you simply enter cs <ENTER> XFOIL will prompt you for the next three numbers.
  17. Shut off the polar accumulation by entering: PACC <ENTER>.
  18. View the polar by typing PPLO. If you have done several airfoils, and want to compare their polars, type PGET, and then enter the saved polar name and file extension. I.E., if you would enter testfoil_polar.txt if you wanted to add that previously accumulated polar file to the just calculated clarkY_polar.txt. You have to enter PPLO each time a polar is loaded into XFOIL. PDEL the function that deletes saved polars.
  19. If the plot that results is larger than the boundaries of default plot, use the PPAX command. It uses the form "min, max, delta", and it is important to enter all 3 numbers for any of the plot values (Alpha, CL, CD, -CM)

    Here is an example:



    or, since the CM hasn't changed, you can just hit enter at that prompt:



    Because of the dramatic increase of drag near the limits of an airfoil's use, the lines often overlap in XFOIL plots, regardless of the size of the plots. Because of this, and the inability to plot a single parameter, it can be better to use another data analysis program like: Mathworks Matlab, Wolfram Mathematica, Microsoft Excel, or Sun Microstation's OpenOffice.
  20. Shut down the XFOIL program by clicking the "X" box in the upper right corner of the window (or by typing quit <ENTER> from the main XFOIL menu).
  21. A final note: Typing ? in any menu (such as XFOIL, OPER, GDES, MDES, QDES) will print out each command in that menu with a short description.

SYMBOLS AND REFERENCES

SymbolDescription
ReReynold's Number
rhoDensity of air [slug/ft3, kg/m3]
VVelocity [ft/sec, m/s]
lreference length (i.e. chord length) [ft, m]
muviscosity of air [slugs/(ft*s), kg/(m*s)]
MMach number
aSpeed of sound (varies with density) [ft/sec, m/s]

CONCLUSION

I hope that these instructions prove useful. If you have a problem please email me -- tim@terrabreak.org. Good luck analyzing your airfoils.

--CwicSeolfer
This file was last modified on May 01, 2006.