Xfoil - Users - Manual 6.9 PDF
Xfoil - Users - Manual 6.9 PDF
Xfoil - Users - Manual 6.9 PDF
9 User Primer
Mark Drela, MIT Aero & Astro
Harold Youngren, Aerocraft, Inc.
30 Nov 2001
1
Contents
1 General Description 4
1.1 History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2 Theory References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3 Inviscid Formulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.4 Inverse Formulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.5 Viscous Formulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2 Data Structure 6
2.1 Stored airfoils and polars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.2 Current and buffer airfoils . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3 Program Execution 7
3.1 Airfoil file formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.1.1 Plain coordinate file . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.1.2 Labeled coordinate file . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.1.3 ISES coordinate file . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.1.4 MSES coordinate file . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.2 Buffer airfoil normalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.3 Buffer airfoil generation via interpolation . . . . . . . . . . . . . . . . . . . . 10
3.4 Airfoil node distribution matching . . . . . . . . . . . . . . . . . . . . . . . . 12
3.5 Further buffer airfoil manipulation . . . . . . . . . . . . . . . . . . . . . . . 12
3.6 Generation of current airfoil . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.7 Saving current airfoil coordinates . . . . . . . . . . . . . . . . . . . . . . . . 12
4 Units 13
5 Analysis 14
5.1 Force calculation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
5.2 Transition criterion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
5.3 Numerical accuracy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5.3.1 Panel density requirements . . . . . . . . . . . . . . . . . . . . . . . . 20
5.3.2 Differencing order of accuracy . . . . . . . . . . . . . . . . . . . . . . 21
5.4 Viscous solution acceleration . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5.5 Polar calculations and plotting . . . . . . . . . . . . . . . . . . . . . . . . . . 22
5.6 Off-line polar plotting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
5.7 Re, Mach dependence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
6 Output 24
7 Plot Hardcopy 25
8 Full-Inverse Design Routine (MDES) 25
8.1 Creation of seed surface speed distribution . . . . . . . . . . . . . . . . . . . 26
8.2 Modification of surface speed distributions . . . . . . . . . . . . . . . . . . . 27
8.2.1 Cursor input of modifications . . . . . . . . . . . . . . . . . . . . . . 27
8.2.2 Modification endpoint blending . . . . . . . . . . . . . . . . . . . . . 27
8.2.3 Smoothing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
8.2.4 Symmetry forcing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
8.2.5 Adjustment for Lighthill constraints . . . . . . . . . . . . . . . . . . . 28
8.2.6 Multipoint surface speed display . . . . . . . . . . . . . . . . . . . . . 28
8.3 Generation of new geometry . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
11 Start-up Defaults 36
12 Caveats 37
3
1 General Description
XFOIL is an interactive program for the design and analysis of subsonic isolated airfoils.
It consists of a collection of menu-driven routines which perform various useful functions
such as:
XFOIL is best suited for use on a good workstation. A high-end PC is also effective, but
must run Unix to support the X-Windows graphics. The source code of XFOIL is Fortran
77. The plot library also uses a few C routines for the X-Windows interface.
1.1 History
XFOIL 1.0 was written by Mark Drela in 1986. The main goal was to combine the speed
and accuracy of high-order panel methods with the new fully-coupled viscous/inviscid in-
teraction method used in the ISES code developed by Drela and Giles. A fully interactive
4
interface was employed from the beginning to make it much easier to use than the tradi-
tional batch-type CFD codes. Several inverse modes and a geometry manipulator were also
incorporated early in XFOIL’s development, making it a fairly general airfoil development
system.
Since version 1.0, XFOIL has undergone numerous revisions, upgrades, hacks, and en-
hancements. These changes mainly originated from perceived shortcomings during actual de-
sign use, so XFOIL is now strongly geared to practical airfoil development. Harold Youngren
provided the Xplot11 plot package which is a vast improvement over the grim Versaplot-type
package used initially. Enhancements and suggestions from Youngren and other people were
also incorporated into XFOIL itself along the way.
Over the past few years, bug reports and enhancement suggestions have slowed to prac-
tically nil, and so after a final few enhancements from version 6.8, XFOIL 6.9 is officially
”frozen” and being made public. Although any bugs will likely be fixed, no further devel-
opment is planned at this point. Method extensions are being planned, but these will be
incorporated in a completely new next-generation code.
Note to code developers and code enhancers... XFOIL does not exactly have the cleanest
implementation, but it isn’t too bad considering its vast modification history. Feel free to
muck with the code as you like, provided everything is done under the GPL agreement.
Drela and Youngren will not be inclined to assist with any code modifications at this point,
however, since we each have a dozen other projects waiting. So proceed at your own risk.
5
node coordinates are treated as unknowns wherever the surface speed is prescribed. Only a
part of the airfoil is altered at any one time, as will be described later. Allowing the panel ge-
ometry to be a variable results in a non-linear problem, but this is solved in a straightforward
manner with a full-Newton method.
2 Data Structure
XFOIL stores all its data in RAM during execution. Saving of the data to files is NOT
normally performed automatically, so the user must be careful to save work results before
exiting XFOIL. The exception to this is optional automatic saving to disk of polar data as
it’s being computed in OPER (described later).
6
2.1 Stored airfoils and polars
XFOIL 6.9 stores multiple polars and associated airfoils and parameters during one in-
teractive session. Each such data set is designated by its ”stored polar” index:
Not all of the data need to be present for each stored polar. For example, x, y would be
absent if the CL , CD polar was read in from an external file rather than computed online.
Earlier XFOIL versions in effect only allowed one stored airfoil and stored polar at a time.
The new multiple storage feature makes iterative redesign considerably more convenient,
since the cases can contain multiple design versions which can be easily overlaid on plots.
3 Program Execution
XFOIL is executed with
% xfoil
When the program starts, the following top level menu and prompt appear:
7
LOAD f Read buffer airfoil from coordinate file
NACA i Set NACA 4,5-digit airfoil and buffer airfoil
INTE Set buffer airfoil by interpolating two airfoils
NORM Buffer airfoil normalization toggle
PCOP Set current-airfoil panel nodes directly from buffer airfoil points
PANE Set current-airfoil panel nodes ( 140 ) based on curvature
.PPAR Show/change paneling
XFOIL c>
The commands preceded by a period place the user in another lower-level menu. The
other commands are executed immediately and the user is prompted for another top level
command. The lowercase letters i,r,f,s following some commands indicate the type of
argument(s) expected by the command:
i integer
r real
f filename
s character string
Commands will be shown here in uppercase, although they are not case sensitive.
Typically, either the LOAD or the NACA command is issued first to create an airfoil for
analysis or redesign. The NACA command expects an integer argument designating the airfoil:
8
The LOAD command reads and processes a formatted airfoil coordinate file defining an
arbitrary airfoil. It expects a filename argument:
The NACA or LOAD commands can be skipped if XFOIL is executed with a filename as an
argument, as for example
% xfoil e387.dat
which then executes the LOAD procedure before the first menu prompt is given.
X(1) Y(1)
X(2) Y(2)
. .
. .
X(N) Y(N)
NACA 0012
X(1) Y(1)
X(2) Y(2)
. .
This is deemed the most convenient format to use. The presence of the name string is
automatically recognized if it does not begin with a Fortran-readable pair of numbers. Hence,
“00 12 NACA Airfoil” cannot be used as a name, since the “00 12” will be interpreted as
the first pair of coordinates. “0012 NACA” is OK, however.
Some Fortran implementations will also choke on airfoil names that begin with T or F.
These will be interpreted as logical variables, defeating the name-detection logic. Beginning
the name with T or F is a workable solution to this “feature”.
9
3.1.3 ISES coordinate file
This has four or five ISES grid domain parameters in addition to the name:
NACA 0012
-2.0 3.0 -2.5 3.0
X(1) Y(1)
X(2) Y(2)
. .
If the second line has four or more numbers, then these are interpreted as the grid domain
parameters.
999.0 999.0
with the discrete secant arc length parameters s computed from the coordinates
x(i),y(i):
10
To perform the interpolation, the discrete s0(i) points are first used to define discrete
fractional parameter values s’(i) = 0...1, from the Leading Edge to the Trailing Edge:
The s’ values are computed separately on the top and bottom airfoil sides.
These fractional parameter values s’ are then used to compute new spline-parameter
values s0,s1 for each airfoil, separately on the top and bottom sides:
The interpolated-airfoil points are then computed by computing x,y from the splines
and interpolating them:
Treating the top and bottom surface separately ensures that the leading edge point
of the new airfoil is the interpolated result of the exact 0 and 1 leading edges.
The polar shape of an interpolated airfoil will often be quite close to the interpolated
polars of its two parent airfoils. Extrapolation can also be done by specifying a blending
fraction outside the 0..1 range, although the resulting airfoil may be quite weird if the
extrapolation is excessive.
A good way to use INTE is to “augment” or “tone down” the modifications to an airfoil
performed in MDES or GDES. For example, say airfoil B is obtained by modifying airfoil A:
A -> MDES -> B
Suppose the modification changed A’s polar in the right direction, but not quite far
enough. The additional needed change can be done by extrapolating past airfoil B in INTE:
Airfoil "0": A
Airfoil "1": B
Interpolating fraction 0..1 : 1.4
Output airfoil: C
Plotted along the ”modification axis”, the airfoils are:
A B C
0.0 1.0 1.4 ...
So airfoil C has 40% more of the change received by B in the redesign. Aifoil C’s polar
will also be changed about 40% more as intended.
11
3.4 Airfoil node distribution matching
The INTE command can be used to impose one airfoil’s node distribution onto another
airfoil shape. This is done as follows:
The resulting airfoil will have the shape of airfoil 1, but the node distribution of airfoil 0.
LOAD
GDES
EXEC
With XFOIL 6.9, the GDES, EXEC commands after LOAD are now superfluous.
The NACA command automatically invokes the paneling routine to create a current airfoil
with a suitable paneling.
12
asked which element in the file is to be overwritten. XFOIL can thus be used to easily ”edit”
individual elements in MSES multielement configurations. Of course, normalization should
not be performed on an element if it is to be written back to the same multielement file. Only
the current-airfoil coordinates can be saved to a file. If the buffer or polar x,y coordinates
need to be saved, they must first be copied into the current airfoil.
4 Units
Most XFOIL operations are performed on the airfoil’s cartesian coordinates x,y , which do
not necessarily have a unit chord c. Since the chord is ambiguous for odd shapes, the XFOIL
force coefficients CL , CD , CM are obtained by normalizing the forces and moment with only
the freestream dynamic pressure (the reference chord is assumed to be unity). Likewise, the
XFOIL Reynolds number RE is defined with the freestream velocity and viscosity, and an
implied unit chord:
CL = L / q | V = freestream speed
CD = D / q | v = freestream kinematic viscosity
CM = M / q | r = freestream density
RE = V / v | q = 0.5 r V^2
Cl = L / q c
Cd = D / q c
Cm = M / q c^2
Rc = V c / v
so that the conventional and XFOIL definitions differ only by the chord factor c or c2 .
For example, a NACA 4412 airfoil is operated in the OPER menu at
RE = 500000
ALFA = 3
first with chord=1.0, and then with chord=0.5 (changed with SCAL command in the GDES
menu, say). The results produced by XFOIL are:
Since CL is not normalized with the chord, it is nearly proportional to the airfoil size. It
is not exactly proportional, since the true chord Reynolds number Rc is different, and there
is always a weak Reynolds number effect on lift. In contrast, the CD for the smaller airfoil is
significantly greater than 1/2 times the larger-airfoil CD , since chord Reynolds number has
a significant impact on profile drag. Repeating the c = 0.5 case at Re = 1000000, produces
the expected result that CL and CD are exactly 1/2 times their c = 1.0 values.
13
c = 0.5 : CL = 0.40 CD = 0.0041 (RE = 1000000, Rc = 500000)
Although XFOIL performs its operations with no regard to the size of the airfoil, some
quantities are nevertheless defined in terms of the chord length. Examples are the camber
line shape and BL trip locations, which are specified in terms of the relative x/c,y/c along
and normal to the airfoil chord line. This is done only for the user’s convenience. In the input
and output labeling, “x,y” always refer to the cartesian coordinates, while “x/c,y/c” refer
to the chord- based coordinates which are shifted, rotated, and scaled so that the airfoil’s
leading edge is at (x/c,y/c) = (0,0), and the airfoil’s trailing edge is at (x/c,y/c) = (1,0).
The two systems coincide only if the airfoil is normalized.
5 Analysis
Most of the commands in the top level XFOIL menu merely put the user into some lower
command level with its own menu and prompt. Issuing the OPER command, for instance,
will produce the prompt
.OPERi c>
Typing a " ? " will result in the OPER analysis menu being displayed:
14
PGET f Read new polar from save file
PWRT i Write polar to save file
PSUM Show summary of stored polars
PLIS i List stored polar(s)
PDEL i Delete stored polar
PSOR i Sort stored polar
PPlo ii. Plot stored polar(s)
APlo ii. Plot stored airfoil(s) for each polar
ASET i Copy stored airfoil into current airfoil
PREM ir. Remove point(s) from stored polar
PNAM i Change airfoil name of stored polar
PPAX Change polar plot axis limits
CPx Plot Cp vs x
CPV Plot airfoil with pressure vectors (gee wiz)
.VPlo BL variable plots
.ANNO Annotate current plot
HARD Hardcopy current plot
SIZE r Change plot-object size
CPMI r Change minimum Cp axis annotation
The commands are not case sensitive. Some commands expect multiple arguments, but
if the arguments are not typed, prompts will be issued.
15
The most commonly-used commands have alternative short forms, indicated by the up-
percase part of the command in the menu list. For example, the menu shows...
The “A” command is the short alternative form of “ALFA”, and “C” is the short alter-
native of “CL”. Likewise, “AS” and “CS” are the short forms of “ASEQ” and “CSEQ”.
The CLI command has no short form (as indicated by all capitals in the menu), and must
be fully typed.
Hopefully, most of the commands are self-explanatory. For inviscid cases, the CLI and
CL commands are identical. For viscous cases, CLI is equivalent to specifying alpha, this
being determined a priori from the specified lift coefficient via an inviscid solution. CL will
return a viscous solution with the specified true viscous lift coefficient at an alpha which
is determined as part of the solution (prescribing a CL above CLmax will cause serious
problems, however!). The user is always prompted for any required input. When in doubt,
typing a ? will always produce a menu.
After an ALFA, CL, or CLI command is executed, the Cp vs x distribution is displayed,
and can be displayed again at any time with CPX. If the viscous mode is active, the true
viscous Cp is shown as a solid line, and the inviscid Cp at that same alpha is shown as a
dashed line. Each dash covers one panel, so the local dashed line density is also a useful
visual indicator of panel resolution quality. If the inviscid mode is active, only the inviscid
Cp is shown as a solid line.
The difference between the true viscous Cp distribution (solid line) and the inviscid Cp
distribution (dashed line) is due to the modification of the effective airfoil shape by the
boundary layers. This effective airfoil shape is shown superimposed on the actual current
airfoil shape under the Cp vs x plot. The gap between these effective and actual shapes is
equal to the local displacement thickness δ ∗ , which can also be plotted in the VPAR menu.
This is only about 1/3 to 1/2 as large as the overall boundary layer thickness, which can be
visualized via the BL or BLC commands which diplay velocity profiles through the boundary
layer. BL displays a number of profiles equally spaced around the airfoil’s perimeter, while
BLC displays profiles at cursor-selected locations. The zooming commands Z, U, may be
necessary to better see these small profiles in most cases.
If the Cp reference data overlay option is enabled with CREF, initiating a Cp vs x plot
will first result in the user being prompted for a formatted data file with the following format:
x(1) Cp(1)
x(2) Cp(2)
. .
. .
16
The Cp vs x plot is then displayed as usual but with the data overlaid. If FREF has
been issued previously, then numerical reference values for CL, CD, etc. will be requested
and added to the plot next to the computed values.
Boundary-layer quantities are plotted from the VPLO menu:
This menu is largely self-explanatory. The skin friction coefficient plotted with the CF
command is defined as
τ
cf = (1)
0.5ρQ2∞
This differs from the standard boundary layer theory definition which uses the local Ue
rather than Qinf for the normalization. Using the constant freestream reference makes cf (x)
have the same shape as the physical shear stress τ (x).
The dissipation coefficient CD’ (this is NOT the drag coefficient!!!) is plotted with the
CD command. CD’(x) is proportional to the local energy dissipation rate due to viscous
shear and turbulent mixing. Hence, it indicates where on the airfoil drag is being created. It
is in fact a much better indicator of drag production than Cf(x), since Cf does not account
for pressure drag. CD’, on the other hand, accounts for everything. Its relationship to the
total profile drag coefficient is simply
17
Z
0
CD = 2CD ds (2)
with the integration performed over both boundary layers and also the wake. It will be
seen that if the flow is separated at the trailing edge, much of the drag contribution (energy
dissipation) of CD’ occurs in the wake.
As mentioned earlier, all forces are normalized with freestream dynamic pressure only.
CL, CD, CM are the usual chord-based definitions only if the airfoil has a unit chord – in
general, they will scale with the airfoil’s chord. Also, CM is defined about the cartesian
point (xref,yref) = (0.25,0.0), which is not necessarily the airfoil’s 1/4 chord point.
where
x = xcos(a) + ysin(a)
a = angle of attack
y = ycos(a) − xsin(a)
The integrals performed in the counterclockwise direction around the airfoil contour. The
pressure coefficient Cp is calculated using the Karman-Tsien compressibility correction.
The drag coefficient CD is obtained by applying the Squire-Young formula at the last
point in the wake — NOT at the trailing edge.
D
CD = = 2θi = 2θ(u/V )(H+5)/2 (5)
q
where
θ= momentum thickness
u= edge velocity at end of wake
H= shape parameter
V = freestream velocity
θi = momentum thickness at “downstream infinity”
18
of application. This assumption is strongly violated in the near-wake behind an airfoil with
trailing edge separation, but is always reasonable some distance behind the airfoil. Hence,
the usual application of Squire-Young at the trailing edge is questionable with separation
present, but its application at the last wake point (typically 1 chord downstream) is always
reasonable. Also, application at the last wake point also results in the formula having a
smaller effect in any case, since there u V , and hence θi θ.
In most 2-D airfoil experiments, drag is measured indirectly by measuring 2 Theta/c in
the wake, often within one chord of the airfoil’s trailing edge. For consistency, this should
be compared to the Theta value predicted by XFOIL at the same wake location, rather than
the ”true” Cd = 2θi /c value which is effectively at downstream infinity. In general, thetai
will be smaller than θ. In most airfoil drag measurement experiments, this difference may
amount to the drag measurement being several percent too large, unless some correction is
performed.
In addition to calculating the total viscous CD from the wake momentum thickness,
XFOIL also determines the friction and pressure drag components CD,f , CD,p of this total
CD . These are calculated by
Z
CD,f = Cf dx (6)
Here, Cf is the skin friction coefficient defined with the freestream dynamic pressure, not
the BL edge dynamic pressure commonly used in BL theory. Note that CD,p is deduced from
CD and CD,f instead of being calculated via surface pressure integration. This conventional
definition Z
CDp = Cp dy (8)
The en method is always active, and free transition can occur upstream of the trip. The en
method has the user-specified parameter “Ncrit ”, which is the log of the amplification factor
of the most-amplified frequency which triggers transition. A suitable value of this parameter
depends on the ambient disturbance level in which the airfoil operates, and mimics the effect
of such disturbances on transition. Below are typical values of Ncrit for various situations.
19
Situation Ncrit
sailplane 12-14
motorglider 11-13
clean wind tunnel 10-12
average wind tunnel 9
dirty wind tunnel 4-8
Note: The en method in XFOIL is actually the simplified envelope version, which is the
same as the full en method only for flows with constant H(x). If H is not constant, the two
methods differ somewhat, but this difference is typically within the uncertainty in choosing
Ncrit .
The en method is only appropriate for predicting transition in situations where the growth
of 2-D Tollmien-Schlichting waves via linear instability is the dominant transition-initiating
mechanism. Fortunately, this happens to be the case in a vast majority of airfoil applications.
Other possible mechanisms are:
• Crossflow instabilities. These occur on swept wings with significant favorable chordwise
pressure gradients.
• Attachment-line transition. This requires large sweep, large LE radius, and a large
Reynolds number. Occurs primarily on big jets.
• Bypass transition. This occurs in cases with sufficient wall roughness and/or large
freestream turbulence or vibration levels. The linear-instability phase predicted by the
en method is ”bypassed”, giving relatively early transition. Usually occurs in favorable
pressure gradients, while the linear-instability mechanism usually dominates in adverse
pressure gradients.
If any of these alternative transition mechanisms are present, the trips must be set to
mimick their effect. The bypass transition mechanism can be mimicked to some extent by the
en method by setting Ncrit to a small value — Ncrit = 1 or less. This will cause transition just
after linear instability begins. For very large freestream turbulence or roughness in favorable
pressure gradients, bypass transition can occur before the linear instability threshold, and
in this case trips will have to be set as well.
20
the surface velocity Ue/Vinf should not change by more than 0.05 per point past transition,
otherwise there may be significant numerical errors in the drag. The point values can be
observed by issuing SYMB from the VPLO menu. Moderate chord Reynolds numbers (1-3
million, say) usually require the finest paneling, since the bubbles are still important, but
very small. On many airfoils, especially those with small leading edge radii, the development
of the small bubble which forms just behind the leading edge can have a significant effect on
CLmax. For such cases, the default paneling density at the bubble may not be adequate. In
all cases, inadequate bubble resolution results in a ”ragged” or ”scalloped” CL vs CD drag
polar curve, so fortunately this is easy to spot.
21
it to zero if all other efforts at convergence are unsuccessful. The value of VACCEL has
absolutely no effect on the final converged viscous solution (if attained).
% pplot
The file pplot.def contains plotting parameters, and is read automatically if available. If
it’s not available, then internal defaults are used.
Like the RGET,FREF commands in OPER, PPLOT permits reference data to be over-
laid. A reference polar data file has the following form:
CD(1) CL(1)
CD(2) CL(2)
. .
. .
999.0 999.0
22
alpha(1) CL(1)
alpha(2) CL(2)
. .
. .
999.0 999.0
alpha(1) Cm(1)
alpha(2) Cm(2)
. .
. .
999.0 999.0
Xtr/c(1) CL(1)
Xtr/c(2) CL(2)
. .
. .
999.0 999.0
The number of points in each set (CD-CL, alpha-CL, etc.) is arbitrary, and can be zero.
The contents of a polar dump file can be selectively plotted with the separate menu-driven
program PXPLOT. It is executed with:
This allows surface plots of Cp vs x, H vs x, etc. for any or all of the saved operating
points. Of course, these plots can be generated in XFOIL for any individual operating point,
so PXPLOT and the dump file itself are somewhat redundant in this respect.
• Type 1 corresponds to a given wing at a fixed velocity going over an angle of attack
range, as in a wind tunnel test alpha sweep or a sudden aircraft pullup. This is also
the common form for an airfoil polar.
• Type 2 corresponds to an aircraft in level flight at a given altitude undergoing trim
speed changes. This is the most useful airfoil polar form for determining a drag polar for
an aircraft at 1-g. For this case, The ”Mach number” input with the MACH command
23
is actually interpreted as the product M sqrt(CL), and the ”Reynolds number” input
with the VISC or RE commands is actually interpreted as RE sqrt(CL). For a wing in
level flight, these products can be computed from the following exact relations, with
Re based on the mean chord:
2W/S 1/2
M sqrt(CL) = (9)
1.4p
1/2
1 2ρW
REsqrt(CL) = (10)
µ AR
W = weight
p= ambient pressure
S= wing area
mu = dynamic viscosity
AR = aspect ratio
rho = ambient air density
• Type 3 corresponds to a wing of “rubber chord” with a given lift at a given speed. This
is best used for selecting an optimum CL for an airfoil while taking Reynolds number
changes into account. The product ReCL can be computed from the following:
2W
RECL = (11)
µV b
√
b = span = S × AR (12)
Caution must be used with Types 2 and 3 so as to not allow the CL to go negative. In
addition, with non-zero Mach and Type 2, the CL must not fall below that value which
makes Mach exceed unity. Warning messages are printed when these problems occur.
6 Output
All output goes directly to the terminal screen. H. Youngren’s plot package Xplot11
(libPlt.a) used by XFOIL drives monochrome and color X-Windows graphics, and generates
B&W or color PostScript files for hardcopy. The default setup assumes color X-Windows
graphics (if available), and B&W PostScript. These defaults are controlled by the IDEV and
IDEVRP flags in SUBROUTINE INIT (in xfoil.f).
The Xplot11 library should work on all Unix systems. The Makefile in the ./plotlib/
directory requires some modifications for some machines.
The default X-graphics window is in Landscape mode, with a black (reverse-video) back-
ground. Normal-video can be selected by setting the Unix shell variable
24
% setenv XPLOT11_BACKGROUND white
% unsetenv XPLOT11_BACKGROUND
See the plotlib/Doc file for more info on the plot library.
Xplot11 provides a built-in Zoom/Unzoom capability which can be applied to whatever
is on the screen. Zooming/Unzooming can be perfomed with the ”Z” and ”U” commands
from nearly all the menus — these commands are not listed to reduce clutter.
Some of the menus also have their own Blowup/Reset commands. The distinction is that
XFOIL’s plots don’t try to adjust themselves to Zoom parameters, so a highly-”Zoomed”
plot may show nothing at all. In contrast, Blowup/Reset instructs XFOIL to change its own
plot scales, so a highly-”Blown-up” plot will at least show the axes.
7 Plot Hardcopy
For hardcopy, the current screen plot can be echoed to a PostScript file plot.ps with the
HARD command. The size of the plot objects on the screen and on hardcopy can be changed
with the SIZE command from most menus. The number requested is the width of the plot
in inches.
*** NOTE *** If the plot.ps file is to be previewed with some X-Windows PostScript
viewer, or imported into word-processing systems, XFOIL must be exited with QUIT in
order for the plot.ps file to be properly terminated. For just printing, this may or may not
be necessary.
*** NOTE *** For the geometry plot in GDES, and the Qspec(s) plots in QDES and
MDES (described below), the hardcopy plot size will also be affected if the graphics window
is resized with the cursor at the window manager level. This is because the plot is always
scaled so that it fills up as much of the window as possible. If the window size is left at its
start-up size, the hardcopy plot widths will come out with the specified size in inches. If any
window dimension is increased from its default value, then a subsequent hardcopy plot will
probably not fit on a standard 8.5” x 11.0” sheet.
25
x + iy = z(w;Cn)
u - iv = f(w;Cn,alpha)
where w= 0..2*pi is the independent parameter going around the airfoil. The z and f
functions are rather complicated but this is not important here. The key to the full-inverse
method is that the mapping coefficients Cn can be computed from a known contour angle
theta(w) = arctan(dy/dz) OR from a surface speed q(w) = —u-iv—. The other quantity
then follows. In summary, the operations and their commands are...
26
VISC Qvis overlay toggle
REFL Reflected Qspec overlay toggle
SPEC Plot mapping coefficient spectrum
As described above, the initial Qspec distribution is taken from ”Q”, the speed distribu-
tion corresponding to the current geometry at the last angle of attack employed in OPER.
Qspec can be set back to this Q with QSET anytime.
8.2.3 Smoothing
Qspec can be smoothed with the SMOO command, which normally operates on the entire
distribution, but can be confined to a target segment whose endpoints are selected with the
MARK command. The smoothing acts to alleviate second derivatives in Qspec(s), so that
with many consecutive SMOO commands Qspec(s) will approach a straight line over the
target segment. If the slope-matching flag is set, the endpoint slopes are preserved.
27
The FILT command is an alternative smoothing procedure which acts on the Fourier
coefficients of Qspec directly, and is global in its effect. It is useful for ”cleaning up” the
entire Qspec(s) distribution if noise is present from some geometric glitch on the airfoil
surface. Also, unintended noise might be introduced into Qspec from a poor modification
via the cursor.
FILT acts by multiplying the Fourier coefficients by a Hanning window filter function
raised to the power of a filter parameter ”F”. This tapers off the high frequencies of Qspec
to varying degrees. A value of F = 0.0 gives no filtering, F = 1.0 gives the standard Hanning
filter, F = 2.0 applies the Hanning filter twice, etc. The standard Hanning filter appears
to be a bit too drastic, so a filter parameter of F = 0.2 is currently used. Hence, issuing
FILT five times corresponds to the standard Hanning filter. The SPEC command displays
the mapping coefficient spectrum at any time.
28
allows rapid design at multiple operating points. When the Qspec curves correspond to
specified CL values, the alpha for each curve will be adjusted after each Qspec modification
so as to preserve that curve’s CL. The resulting Qspec will therefore not match the input
cursor points exactly because of this alpha correction.
29
eXec i Execute mixed-inverse calculation
REST Restore geometry from buffer airfoil
CPXX CPxx endpoint constraint toggle
The QDES menu above is intentionally geared for the redesign of a segment of an existing
airfoil (with its surface speed distribution calculated previously in OPER) rather than the
generation of a totally new airfoil.
30
converge a Mixed-Inverse case. Two iterations are usually sufficient to get very close to the
new geometry. In any case, the new surface speed distribution Q which actually results from
the inverse calculation will typically differ somewhat from the specified distribution Qspec
by function modes which are added to Qspec. At least two modes are added, with their
magnitudes determined by geometric closure requirements at the inverse segment endpoints.
As with the MDES complex-mapping routine, the necessary modifications to Qspec will be
smallest if Qspec is modified so that CL (the area under the Qspec(s) curve) is roughly
preserved.
Issuing PLOT after the EXEC command finishes will compare the specified (Qspec)
and resulting (Q) speed distributions. If extra smoothness in the surface speed is required,
the CPXX command just before EXEC will enable the addition of two additional modes
which allow the second derivative in the pressure at the endpoints to be unchanged from
the starting airfoil. The disadvantage of this option is that the resulting surface speed Q
will now deviate more from the specified speed Qspec. It is allowable to repeatedly modify
Qspec, set or reset the CPXX option, and issue the EXEC command in any order.
The Mixed-Inverse modification is performed on the current airfoil directly, in contrast
to Full-Inverse which generates the buffer airfoil as its output. In fact, it is important not
to issue the PANE or PCOP commands at top level after doing work in the QDES menu, as
the new current airfoil will be overwritten with the old buffer airfoil.
31
TCPL Toggle thickness and camber plotting
TFAC rr Scale existing thickness and camber
TSET rr Set new thickness and camber
HIGH rr Move camber and thickness highpoints
.CAMB Modify camber shape directly or via loading
32
NINC Increment name version number
will add spline points adjacent to each existing point whose panel angle exceeds ±10
degrees, and only if the added point will fall within the interval −0.1 < x < 0.2. The “2”
indicates that an arclength spline parameter is to be used. The PANE command will always
use the arclength spline.
Some archived airfoils, notably the Eppler airfoils and some of the Selig airfoils have an
excessively coarse point spacing around the leading edge. The spacing has apparently been
tailored for a uniform-parameter spline, and often produces a badly shaped leading edge with
the arclength-parameter spline used in Xfoil. The following command will insert additional
points giving a much smoother shape for subsequent analysis.
The 10.0 degree angle tolerance can be varied as needed (1/2 of the max angle is the
default). The ”1” argument (also a default) specifies a uniform-parameter spline for the
interpolation since this works best for Eppler airfoils), and the default x range indicates that
the entire airfoil is to be treated. The CADD command can be repeated to keep reducing the
max panel angle, but this may or may not improve the smoothness of the resulting splined
airfoil.
33
10.3 Modifying buffer airfoil
Once the buffer airfoil is suitably initialized, most of the GDES commands can then
be used to modify it. The resulting new shape will usually be replotted immediately in a
highlighted color. The plot can be refreshed anytime with the PLOT command.
Sometimes a sequence of commands is necessary to achieve the desired effect. For in-
stance, suppose an airfoil with the current thickness envelope is to be given an entirely new
camber line. Issuing TSET and hitting a ¡cr¿ (keep same thickness) and a new camber of 0
will result in the current thickness envelope unchanged and the current camber eliminated,
so that a symmetrical airfoil remains. The new camber line can then be added in the CAMB
sub-menu:
..CAMB c>
INPC takes the new camber line as a sequence of x/c,y/c coordinate pairs which are
splined. INPP takes a sequence of x/c,delta(Cp) pairs instead. This delta(Cp) (i.e. loading)
distribution, defined as
34
delta(Cp) = (Cp)lower − (Cp)upper (13)
is then used in Glauert’s thin-airfoil relations to define the x/c,y/c camber line.
With INPC and INPP, a slope discontinuity in y(x) or Cp(x) can be specified with two
identical consecutive x/c values, which prevents splining across this point. INPP can thus
easily generate a camber line with a piecewise-linear delta(Cp) loading distribution, as for
example an a=0.8 NACA 6-digit airfoil:
x/c delta(Cp)
0.0 0.5
0.8 0.5
0.8 0.5
1.0 0.0
This results in a constant delta(Cp) = 0.5 for 0.0 < x/c < 0.8 ,
then decreasing linearly to delta(Cp) = 0.0 for 0.8 < x/c < 1.0
Once a suitable added camber is input, it is added to the existing buffer airfoil camber
via the ADD command.
The various GDES commands for modifying camber-line, thickness, leading edge radius,
etc. should suffice for most geometry modification tasks. If truly frustrated, the user can
”draw” the new contour with the MODI command, which accepts cursor inputs in the
same manner as the MDES and QDES procedures. Slope matching at the modified-piece
endpoints can likewise be enabled/disabled with the SLOP toggle command. The only
important difference is that here the points must be entered in consecutive order along the
new contour, although one can ”erase” a previously-entered point by clicking on ”Erase” or
type ”e” in the graphics window.
A point can be doubled with the CORN command. A doubled point is useful wherever a
sharp corner is required, such as at a flap break. Normally, the spline routine enforces slope
continuity at all points, effectively preventing sharp corners. A doubled point, marked by a
small diamond symbol on the plot, causes separate splines to be generated on each side of
the corner, thus allowing the slope break. The doubled point is eliminated by clicking on
it after issuing the DELP command. Using DELP on a normal single point will delete that
point entirely.
The TGAP command sets the thickness (or gap) of the blunt trailing edge. The gap ”ds”
is defined as the distance between the upper and lower coordinate endpoints: ds2 = dx2 +dy 2 .
If the gap is already nonzero, then the new TE base vector (dx,dy) will have the same
orientation as the old one, i.e.
dy dy
|new = |old (14)
dx dx
If the gap is zero to begin with, then the new base vector will be perpendicular to the
trailing edge bisector. If the base orientation comes out in an unexpected way, it probably
35
means that the gap was not *exactly* zero. The fix is to first set the gap to zero, and then
set it again to the desired value.
After a new gap size is input, a ”blending distance/c” will also be requested. This controls
how rapidly the new TE blends into the original airfoil, and is essentially the length scale
for the blending function, which is exponential in x/c. The limiting values are:
11 Start-up Defaults
XFOIL has hardwired parameters (in subr. INIT) controlling the paneling, plotting, and
viscous execution. Most of these can be changed at runtime in the various menus. To avoid
the need to change the parameters everytime XFOIL is executed, they can be saved to the
default file xfoil.def with the WDEF command at TOP LEVEL. This file has the format:
36
Line 3: Specifies the absolute plot size, the plot aspect ratio,
and scales the character, number, and symbol heights
Line 4: Defines page size and page margins, in inches
Line 5: Flags for color PostScript output, cursor screen input
Line 6: Defines the Cp axis annotations
Line 7: x-offset and scale for airfoil on Cp vs x plot, BL u profile scale
Line 8: CL axis annotations on polar plot
Line 9: CD axis annotations on polar plot
Line 10: alpha axis annotations on polar plot
Line 11: CM axis annotations on polar plot
Line 12: Mach-CL dependence type, Mach number, solution acceleration parameter
Line 13: Re-CL dependence type, Reynolds number, transition parameter
Line 14: Forced transition x/c locations on top,bottom sides
This file will be read at any time with the RDEF command, thus avoiding the manual
entry of all the information.
12 Caveats
The XFOIL code is not foolproof, and requires some level of aerodynamic expertise and
common sense on the part of the user. Although the inviscid analysis (OPERi), geometry
design (GDES), and Full-Inverse (MDES) routines are nearly invulnerable to failure, the
Mixed-Inverse (QDES) design routines and especially the viscous analysis (OPERv) routines
will fail if a ”reasonable” problem is not specified. Typical failure scenarios are:
37
• Airfoil too thin
These situations will rarely result in an arithmatic failure, but will typically result in
a ”ragged” Cp distribution. Examine the paneling in the GDES menu, making the GSET
command if neceesary to set the current paneling. Eliminate excessively small panels my
deleting one or more panel nodes with the DELP command.
When performing viscous analysis calculations, it is always a good idea to sequence
runs so that alpha does not change too drastically from one case to another. The Newton
solution method always uses the last available solution as a starting guess for a new solution,
and works best if the change from the old to the new solutions is reasonably small. For
this reason, it is best to perform difficult calculations (such as past CLmax) by gradually
increasing alpha. The ASEQ command in OPER is convenient for this. If the user insists on
a large change from one point to another, it is best to force a re-initialization of the boundary
layers with the INIT command from the VPAR menu in OPER before the radical calculation
is performed. INIT should always be executed whenever the viscous solution blows up but
the program doesn’t crash.
The viscous analysis will execute no more Newton iterations than set by the current
iteration limit each time an ALFA, CL, etc. command is issued. If convergence is not
achieved within this limit, ALFA or CL can be issued as often as needed (most easily with
”!”), with another set of Newton iterations being performed each time. This iteration limit
can be changed from its default value of 10 with the ITER command in OPER.
One should always be wary of trusting solutions which show regions of supersonic flow.
Such flows can be reliably predicted only with a truly nonlinear field method (such as the
MSES code). As a rule of thumb, if the maximum Mach number doesn’t exceed 1.05 any-
where, shock losses will be very small, the Cp distributions will be reasonably accurate, and
the drag predicted by XFOIL is likely to be accurate.
38