Abstract
XFOIL, written by Mark Drela in 1986 and frozen at version 6.9 in 2000, is still the most widely used tool for subsonic airfoil analysis and design, and its predictions now train machine-learned surrogates. This paper reviews its history and its present family of ports, physics branches, re-implementations and surrogates. It sets out the complete governing equations of version 6.99: the linear-vorticity panel method, mass-defect coupling, the integral momentum, kinetic-energy, shear-lag and amplification equations with all closures, and the global Newton system. It then measures XFOIL’s weaknesses directly, using 13 356 operating-point solutions on six NACA sections between and . With the default iteration limit, 10.7 % of operating points fail to converge; with 100 iterations, 3.8 % still fail. Failures are numerical rather than physical. A stalled point sat within 0.1 % of its answer, locked in a cycle at the transition station. A single failure can corrupt every later point of a sweep, while converged solutions show no hysteresis. Changing the Newton step limiter alone made matters worse, but restoring the last converged state and re-approaching the target in smaller steps cut failures from 72 to 28 of 1908 points. The study further shows that drag varies by ±10 % over a plausible range of the transition parameter , and that the drag slope carries a 20–30 % saw-tooth from discrete transition. XFOIL also keeps returning converged answers above the critical Mach number, and finite-difference gradients through its five-decimal output are wrong by more than 100 % at relative steps of and below. Sixteen improvements are proposed, from state restoration, residual-based globalisation and smooth transition to adjoint sensitivities and a re-entrant library interface. A two-element panel study shows that potential-flow methods capture Smith’s circulation and dumping effects (the flap multiplies the main element’s lift 3.7-fold at ). However, they predict ever-rising lift and a zero optimum gap, and they cannot represent confluent boundary layers or wake bursting. Panel methods are therefore suitable for sizing multi-element airfoils but not for their maximum lift, which needs MSES-class or RANS methods.
Index Terms—XFOIL, airfoil analysis, viscous–inviscid interaction, integral boundary layer, panel method, transition, Newton method, convergence, continuation, adjoint, airfoil optimization, MSES, RFOIL, mfoil, NeuralFoil, multi-element airfoil, high lift, wake bursting.
Nomenclature
| Symbol | Meaning |
|---|---|
| , , | Section drag; friction and pressure parts |
| Boundary-layer dissipation coefficient | |
| Skin-friction coefficient | |
| , | Section lift and moment coefficients |
| , | Pressure coefficient; sonic value |
| , | Maximum shear-stress coefficient; equilibrium value |
| Mass-defect influence matrix | |
| , | Shape parameter ; kinematic shape parameter |
| , | Kinetic-energy and density-flux shape parameters |
| , , | Free-stream, edge and critical Mach numbers |
| Mass defect | |
| , | Number of panel nodes; critical amplification exponent |
| Amplification exponent of Tollmien–Schlichting waves | |
| , | Chord and momentum-thickness Reynolds numbers |
| , | Residual vector; vector of boundary-layer unknowns |
| Free-stream turbulence intensity | |
| , | Edge velocity; normalised wall slip velocity |
| Angle of attack | |
| , | Panel vortex and source strengths |
| , , | Boundary-layer, displacement and momentum thicknesses |
| Flap deflection | |
| Arc length from the stagnation point | |
| , | Stream function; its surface value |
| Newton under-relaxation factor |
1. Introduction
More than 35 years after its first version, XFOIL [1] remains the reference tool for the analysis and design of subsonic airfoils. It is used to design sailplane, model-aircraft, propeller, UAV, wind-turbine and marine-turbine sections [2], [3]. It is taught in aerodynamics courses everywhere. It sits inside XFLR5, QBlade and a family of optimisers, and its outputs are the training data for machine-learned surrogates such as NeuralFoil [4]. Yet its authors declared it frozen in 2000 [5]. Its numerics date from 1987–1996, and its users have long worked around convergence failures, “jagged” polars and an ill-defined transition parameter.
This paper asks three questions.
- Where did XFOIL come from, and where does it stand today? Section 2 traces its origin in the ISES code and the MIT Daedalus project and its evolution to version 6.99. Section 4 surveys the current official code and its branches: ports, physics modifications, re-implementations and surrogates.
- What exactly limits its results and its convergence, and how can it be improved, including for optimisation? Section 3 sets out the full governing equations, so that each weakness can be traced to a specific term. Section 5 measures those weaknesses with more than 13 000 XFOIL runs: convergence statistics, anatomy of a failure, failure propagation, panel and solver sensitivity, transition-parameter sensitivity, the compressibility limit and the smoothness of the outputs. Section 6 proposes sixteen improvements tied to that evidence.
- Can the panel-method approach be extended to multi-element airfoils? Section 7 answers this with the physics of high-lift systems and a two-element panel computation.
Section 8 gives practical guidance for current users, Section 9 a prioritised roadmap and Section 10 the conclusions. The experiments use the unmodified XFOIL 6.99 source, two small instrumented variants and an independent multi-element panel code. All scripts and results are listed in the Appendix so that every number can be reproduced.
2. A Short History of XFOIL
2.1 Before XFOIL
By the early 1980s, airfoil designers had two kinds of tool. Panel methods, descended from the Hess–Smith source method [6], gave accurate inviscid pressure distributions for arbitrary shapes in seconds. Viscous effects were added afterwards by marching a boundary-layer method along the inviscid pressure distribution and, at best, iterating the displacement effect back into the panel solution. Eppler’s code [7] combined conformal-mapping design with integral boundary-layer analysis and became the standard for laminar sections. However, its boundary layer did not feed back into the pressure distribution, so it could not resolve separation bubbles or trailing-edge separation self-consistently. “Direct” coupling (inviscid solution gives , boundary layer gives ) diverges at separation, where the boundary-layer equations become singular in that direction. “Inverse” and “semi-inverse” schemes [8] removed the singularity but converged slowly.
2.2 ISES, Daedalus and XFOIL 1.0
Mark Drela’s doctoral work at MIT produced ISES, a two-dimensional Euler solver on a streamline grid, fully coupled to integral boundary-layer equations and solved by a single global Newton method [9], [10]. The key idea was to treat boundary-layer and inviscid unknowns as one nonlinear system. That removed the direct/inverse distinction and gave quadratic convergence through separation bubbles and mild trailing-edge separation. The ISES boundary-layer formulation introduced the closures, the lag equation and the envelope transition model of Section 3. It was published with Giles in 1987 [10].
The immediate application was the MIT Daedalus human-powered aircraft. Its wing operated at chord Reynolds numbers of a few hundred thousand, where laminar separation bubbles dominate drag. Drela designed the DAI series of airfoils for it [11]. In April 1988, Daedalus 88 flew 115 km from Crete to Santorini, a human-powered distance record.
XFOIL 1.0 was written by Drela in 1986. Its stated aim was to combine the speed and accuracy of a high-order panel method with the fully coupled viscous–inviscid method of ISES, inside a fully interactive program rather than a batch CFD code [5]. Inverse design modes were added early. These were a full-inverse mode based on conformal mapping (QDES) and a mixed-inverse mode that modifies the panel solution locally (MDES). A geometry manipulator (GDES) followed, making XFOIL an airfoil development system rather than an analysis code. The method was presented at the 1989 Notre Dame conference on low-Reynolds-number aerodynamics [1], and the blunt-trailing-edge extension followed the same year [12].
2.3 Evolution to Version 6.99
Table 1 lists the documented milestones, taken from the version notes and source comments distributed with the code. Two points stand out. First, the core numerics were essentially complete by 1994–1996: the boundary-layer formulation was aligned with that of MSES in version 6.3, and the second-order transition treatment and low-Reynolds-number limiters arrived in 6.4. Second, the authors declared version 6.9 “frozen” in February 2000. Their user guide states that no further development was planned and that method extensions would go into a completely new code [5]. Version 6.91 (December 2000) was the first web release under the GNU General Public License. Later versions mainly fixed bugs and improved usability. Harold Youngren’s Xplot11 graphics library and polar-plotting work were incorporated along the way.
| Date | Version | Milestone |
|---|---|---|
| 1985–87 | ISES | Fully coupled Euler/integral-BL Newton method [9], [10] |
| 1986 | 1.0 | Linear-vorticity panel method + ISES boundary layer; interactive |
| 1988 | — | Daedalus airfoils (DAI series) designed [11] |
| 1989 | — | Method paper [1]; blunt trailing edge [12] |
| Apr 1994 | 6.1 | New plot library; optional second-order amplification equation |
| Oct 1994 | 6.3 | Viscous formulation brought into line with MSES 2.6 (single-layer wake) |
| Dec 1994 | 6.4 | Second-order transition (TRCHEK2) made default; low- limiters, valid down to |
| Aug 1996 | 6.8 | Better conditioning for sharp trailing edges with large angles |
| Nov 1996 | — | Modified envelope amplification rate (DAMPL2) added as an option |
| Feb 2000 | 6.9 | “New and final” features; sharp-TE regularity condition; code declared frozen |
| Dec 2000 | 6.91 | First web release under GPL |
| 2001–08 | 6.92–6.98 | Polar plotting, Windows builds, BL plotting, bug fixes |
| Jun/Dec 2013 | 6.99 | Drag-to-edit inverse modes; LAG command exposes lag constants |
| Jan 2026 | 6.996 | Source update for Unix listed on the MIT page [13] |
2.4 Why It Endured
Several features explain why XFOIL survived so long. It was free, and from 2000 open. It ran interactively on any machine. It predicted laminar separation bubbles, transition and drag with an accuracy that matched wind-tunnel data closely in the attached and mildly separated regime. And it combined analysis, inverse design and geometry editing in one program. Its global Newton solver was more robust than the alternatives of its day for a difficult, stiff problem [3]. Generations of students learned airfoil aerodynamics with it. Sailplane, model-aircraft, propeller, wind-turbine, UAV and marine-turbine airfoils have been designed with it [2], [3]. Its predictions have even become the training data for machine-learned surrogates [4].
3. The XFOIL Formulation: Governing Equations
This section sets out the complete equation set that XFOIL 6.99 solves. The notation follows [1], [10] and the source code of version 6.99 (files xpanel.f, xblsys.f, xbl.f and xsolve.f), from which every constant below has been checked. Fidkowski’s re-derivation [3] uses the same models and is a useful companion. The equations are needed later, because almost every improvement proposed in Section 6 is a change to one identifiable part of this system.
3.1 Inviscid Flow: Linear-Vorticity Stream-Function Panel Method
The airfoil surface is discretised into nodes ordered from the upper trailing edge, round the leading edge, to the lower trailing edge. Each panel carries a vortex sheet whose strength varies linearly between nodes, and (for the viscous solution) a constant-strength source sheet . The wake is a further panels carrying source only. The stream function at any field point is
where , , and and are the distance and angle from the sheet element to the field point. The surface is made a streamline by requiring the stream function at every node to equal a single unknown constant :
The influence coefficients follow in closed form. For the panel from node to node , let the field point have coordinates in a frame aligned with the panel and centred on node , and in the same frame centred on node . With , and , the vortex panel contributes
is the stream function of a uniform sheet and that of the linearly varying part. The source panels have analogous expressions (each split into two half-panels with linear variation), XFOIL also codes the derivatives of these expressions analytically to obtain velocities. Extending that hand-differentiation to the node coordinates is the main step needed for the geometric sensitivities discussed in Section 6.3.
The Kutta condition closes the system:
For a finite-thickness (blunt) trailing edge, the gap between nodes and is closed by a panel carrying both source and vorticity whose strengths are set from and and the bisector geometry. For a sharp trailing edge, the equation at node is redundant. Since version 6.9 it has been replaced by the requirement that the velocity component along the bisector vanishes at an internal point one-tenth of the smallest panel length ahead of the trailing edge [5]. That change removed a long-standing source of noise in sharp-trailing-edge solutions.
Because depends only on geometry, the system (2)–(4) is factorised once. Solutions for and are superposed for any other angle:
The surface speed is , and the lift and moment follow by integrating the surface pressure.
3.2 Compressibility Correction
XFOIL applies the Kármán–Tsien correction to the incompressible surface speeds [14]. With and ,
The correction is valid only while the flow is everywhere subsonic. It becomes singular as the local speed approaches sonic, and Section 5.8 quantifies where it breaks down.
3.3 Viscous–Inviscid Coupling Through the Mass Defect
The viscous layer displaces the outer flow. XFOIL represents this by wall transpiration, using source strengths equal to the streamwise gradient of the mass defect
where is arc length from the stagnation point and the edge velocity. Since (2) is linear in , the edge velocity at every boundary-layer node is an explicit linear function of the mass defect at every node on the airfoil and wake:
The mass-influence matrix is computed once per geometry. Equation (8) is the heart of XFOIL’s robustness. It lets the boundary-layer and inviscid problems be solved simultaneously by a single Newton method, rather than iterated in turn, which converged poorly near separation in earlier “direct” and “inverse” coupling schemes [10], [8].
3.4 Integral Boundary-Layer Equations
Each surface, and the single wake, is described by three ordinary differential equations in . The von Kármán momentum integral equation is
The kinetic-energy (shape-parameter) equation is obtained by combining the kinetic-energy integral with (9):
Here , and are the momentum, displacement and kinetic-energy thicknesses. and are shape parameters, is the density-flux shape parameter, the skin-friction coefficient and the dissipation coefficient. The third equation depends on the state of the layer. In laminar flow it is the amplification equation for the envelope of Tollmien–Schlichting wave growth
In turbulent flow and in the wake it is the shear-lag equation, which carries the maximum shear-stress coefficient as a lagged response to its equilibrium value, after Green’s lag-entrainment method [15]:
The constants are and . The dissipation-length factor is on the airfoil and in the wake. The equilibrium-gradient term is
with , and on the airfoil and in the wake. XFOIL 6.99 added a LAG command that lets the user change and [5]. That is the only closure constant exposed to the user.
The equations are discretised between adjacent nodes “1” and “2” with logarithmic differences. For example, the momentum residual is
where overbars denote interval averages. In regions of rapid change (typically just after transition), XFOIL automatically biases these averages towards the downstream node. This adds the minimum upwinding needed to suppress the oscillations that the second-order trapezoidal scheme otherwise produces [5].
3.5 Closure Relations
The kinematic shape parameter removes the density-profile effect from , and follows from it:
Laminar closures are fits to the Falkner–Skan profile family [10]. With ,
Turbulent closures are fits to Swafford’s velocity profiles and to equilibrium-layer data. The skin friction is
with . The kinetic-energy shape parameter is defined about , with :
and . The turbulent dissipation is the sum of a wall-layer part, an outer-layer part driven by the lagged shear stress, and a small laminar-stress part:
with . The wall term is omitted in the wake. In both cases the result is not allowed to fall below the laminar value. The normalised wall slip velocity and the equilibrium shear stress are
with on the airfoil and in the wake. The boundary-layer thickness used in (12) is . In the wake , and the wake thickness includes the trailing-edge gap, decaying downstream over about gap heights for a blunt trailing edge [12].
3.6 Transition: the Simplified Envelope Method
Transition is predicted by integrating (11) from the instability point. XFOIL does not track individual frequencies. Instead, it uses an envelope of the Orr–Sommerfeld amplification curves of the Falkner–Skan family, expressed in terms of and only [10]. With , the critical (instability) Reynolds number is
and the amplification rate above it is
where is a cubic ramp from 0 to 1 across . The first bracket is the envelope slope and the second is re-expressed through the Falkner–Skan relations. Transition occurs where reaches the user-set . It is located to sub-interval accuracy, and the transition interval is split into laminar and turbulent parts whose residuals are summed. The shear stress then starts from
Mack’s correlation [16] links to the free-stream turbulence intensity (as a fraction):
so corresponds to . The user guide suggests 12–14 for sailplanes, 10–12 for a clean wind tunnel, 9 for an average tunnel and 4–8 for a “dirty” one [5].
3.7 Drag
Profile drag is taken from the far-wake momentum deficit, extrapolated from the last wake station by the Squire–Young formula [17]:
Friction drag is integrated from , and pressure drag is the difference .
3.8 The Global Newton System
At each boundary-layer station the unknowns are . The edge velocity is eliminated through (8). The three residuals (9), (10) and (11) or (12) at all stations form a system of nonlinear equations. One more unknown is the angle of attack (when is prescribed) or the Reynolds number (for “type 2” fixed-lift polars). Linearising gives
where and are blocks from the local differencing, and the dense columns carry the mass-defect influence of every station on every other. A special block couples the two trailing-edge stations to the first wake station. The custom solver BLSOLV performs block Gaussian elimination that exploits this structure. Mass-influence entries smaller than a threshold VACCEL (default 0.01) are dropped during elimination to save work. That speeds up each iteration but makes the Newton step approximate.
The Newton update is under-relaxed by a single global factor , chosen so that no normalised change exceeds fixed bounds:
and with limits of on the change in , or on the change in , per iteration. After the update, is clipped to at least 1.02 on the airfoil and 1.00005 in the wake, and “islands” of negative are removed. Convergence is declared when the RMS of the normalised changes falls below . If this has not happened within the user’s iteration limit (ITER, default 20), XFOIL reports “Convergence failed” and keeps the unconverged state as the starting point for the next request.
3.9 Design Modes
XFOIL’s two inverse modes reuse the same machinery. In the full-inverse mode (QDES), the airfoil is the conformal image of a circle, and the user prescribes the surface speed as a function of the circle angle at one angle of attack. A prescribed speed does not in general give a closed airfoil in a uniform stream. Lighthill showed that three integral constraints must hold [18], so XFOIL adds free parameters to and solves for them together with the mapping coefficients. In the mixed-inverse mode (MDES), only a segment of the surface is redesigned. On that segment the vortex strength is prescribed,
and the normal displacements of the nodes become the unknowns instead of . The two shape functions with free amplitudes allow the new contour to join the fixed one with continuous slope at both ends. The stream-function equations (2) are linearised in and solved by Newton iteration. Both modes are inviscid. The designer shapes the inviscid speed distribution so that the viscous solution, checked afterwards in OPER, behaves well. This is the “design by pressure distribution” workflow for which XFOIL was built [19]. It is still the fastest way to tailor a laminar bucket or a pressure recovery, and it complements the black-box optimisation discussed in Section 6.3.
Fig. 1 summarises the solution flow. Two features matter for what follows. First, the method is a pure Newton method with a crude step limiter and no globalisation (line search, trust region or continuation). Robustness therefore depends heavily on the starting guess, which is usually the previous converged point. Second, the Jacobian of all residuals with respect to all unknowns, including , is formed exactly at every iteration. Its LU factors are available at convergence, so the sensitivities of , and to any input are almost free. XFOIL itself never exploits this, but MSES does [20].
4. Current Status and Branches
4.1 The Official Code
The MIT XFOIL page still offers version 6.99 (source and a Windows build), the older 6.97, and a 6.996 Unix source update listed in January 2026 [13]. The code remains Fortran 77 with global COMMON blocks. It is interactive by design, driven from a menu at a text prompt, with X11 graphics, and it is distributed under the GPL. Linux distributions package it with small patches. The Debian/Ubuntu package used for this study applies fixes for modern gfortran compilers. Its default build traps floating-point exceptions, which made batch runs abort on the very first viscous point here (Section 5). A user who wants XFOIL as a library (callable from Python, thread-safe, without disk I/O) must therefore turn to a derivative.
4.2 Derivatives and Re-Implementations
Over 35 years, four kinds of descendant have appeared (Table 2, Fig. 2).
- Ports that keep the solver and add an interface. XFLR5 translated XFOIL’s analysis and inverse-design routines into C++ inside a Qt application, adding wing and aircraft analyses by lifting-line, vortex-lattice and panel methods [21]. Its successor flow5, described by its author as version 7 of XFLR5, became public and open source on 1 January 2026 [22]. QBlade embeds the XFLR5 implementation for wind-turbine work. libxfoil moves XFOIL’s global variables into a structure so that several independent instances can run in parallel, with C, Fortran and Python bindings [23]. Several Python packages link the Fortran routines directly to avoid file I/O [24]. Browser ports compile XFOIL to WebAssembly or re-implement it in Rust or JavaScript. Flexcompute’s Rust core is being released under the GPL with Drela’s approval [25], and Vibefoil describes itself as a numerically faithful JavaScript port.
- Branches that change the physics. RFOIL, developed at TU Delft with ECN (now TNO) from 1995–96, modified the turbulent closure and shear-lag treatment to improve prediction around maximum lift. It also added a rotational (stall-delay) model for wind-turbine blades [26], [2]. A 2026 extension, RFOILVogue, adds a vortex-generator source term to the integral equations [27]. QFoil, distributed with QBlade, is a modified XFOIL 6.99 [28]. It tightens the Newton relaxation. The global under-relaxation starts at 0.7 instead of 1.0, the bounds in (29) narrow from to , and the per-iteration lift change is limited to instead of . It also makes the lag constant a function of , , divides the wake dissipation length by four in the RFOIL manner, and adds a post-stall correction to the Squire–Young drag.
- Independent re-implementations of the same model. Fidkowski’s mfoil (Matlab and Python, MIT licence) re-derives XFOIL’s equations in a single readable class [3], [29]. It changes the solver in instructive ways: an augmented state that includes for better control of the update, a stagnation-point treatment that suppresses leading-edge oscillations of , a small positive term that keeps from stalling near , re-marching of the transition location after each update, and an angle-of-attack continuation strategy. Viiflow solves the boundary layer in inverse form with a Newton coupling and reports better run times than XFOIL at high panel counts [30]. Xfoil.jl (in FLOWFoil.jl) re-derives the inviscid part in Julia.
- Surrogates trained on XFOIL. NeuralFoil is a physics-informed neural network trained on millions of XFOIL runs [4]. Its authors report a mean relative drag error of 0.37 % against XFOIL on simple cases and 2.0 % on a harder test set with post-stall and transitional cases. They also report speed-ups of 8 to 1000 times at equal accuracy and, importantly for optimisation, smooth outputs with no convergence failures. It is the aerodynamic engine of AeroSandbox [31]. Section 5.10 compares it with XFOIL on the test matrix of this study.
Optimisation front-ends form a fifth, parallel family. Xoptfoil [32] and its successor Xoptfoil2 [33] wrap XFOIL in particle-swarm, genetic and simplex optimisers with Hicks–Henne or Bézier shape functions. Their features include “retry of unconverged operating points” and “outlier detection of XFOIL results”, which show that the optimisation community has had to engineer around XFOIL’s convergence behaviour (Section 5.9).
| Code | Language | Licence | Relation to XFOIL | Main change |
|---|---|---|---|---|
| XFOIL 6.99/6.996 | Fortran 77 | GPL | Original | — |
| XFLR5 / flow5 | C++/Qt | GPL-3 | Port of solver | GUI, 3-D wing and plane analyses |
| QBlade / QFoil | C++ / Fortran | GPL | Port / modified 6.99 | Robust relaxation, -dependent lag, wake dissipation, post-stall drag |
| RFOIL / RFOILVogue | Fortran | In-house | Modified XFOIL | Stall prediction, rotation, vortex generators |
| libxfoil, xfoil-python | Fortran + C/Python | GPL | Library wrappers | Re-entrant, no disk I/O |
| Flexcompute Foil, Vibefoil | Rust/WASM, JavaScript | GPL (core) | Faithful ports | Browser, real-time visualisation |
| mfoil | Matlab, Python | MIT | Re-implementation | Augmented state, stagnation fix, continuation |
| Viiflow | Python | — | Independent VII | Inverse BL coupling, speed |
| NeuralFoil / AeroSandbox | Python/NumPy | MIT | Trained on XFOIL | Smooth, vectorised, differentiable surrogate |
| Xoptfoil / Xoptfoil2 | Fortran | GPL | Optimiser around XFOIL | PSO/GA, retry and outlier logic |
| MSES | Fortran | Licensed | Sister code | Euler + IBL, multi-element, transonic, sensitivities |
4.3 MSES, the Sister Code
MSES is Drela’s multi-element and transonic system. It couples a streamline-grid Euler solver to the same integral boundary-layer formulation and solves the whole system by Newton’s method [20]. It predicts transitional separation bubbles, shocks and shock-induced separation, and its force predictions are described as accurate to just past stall. It also provides parameter sensitivities, which its LINDOP module uses for single- and multi-point optimisation [20]. MSES is licensed rather than open. It is the reference point for Section 7, because it shows what the XFOIL boundary-layer model can do once the inviscid part is no longer limited to a single panel-method body.
4.4 What Has Not Changed
Despite this activity, the core of every open derivative is still the 1987–1996 boundary-layer formulation of Section 3. Its transition model is still the simplified envelope method with a single , its global solver still uses a fixed-bound step limiter, and no open derivative exposes the analytic sensitivities that the Newton Jacobian makes available. The next section measures the consequences of these choices, and Section 6 proposes remedies.
5. Where XFOIL Falls Short: Numerical Evidence
The weaknesses of XFOIL are often described anecdotally (“it doesn’t converge near stall”, “drag is noisy”). This section measures them with XFOIL 6.99 itself, so that each proposed improvement in Section 6 rests on a reproducible observation.
5.1 Test Set-Up
XFOIL 6.99 was compiled from the Debian source package with gfortran in double precision, with floating-point trapping disabled. (The distribution binary, which traps floating-point exceptions, aborted on its first viscous point.) A Python driver talks to the unmodified program through its text interface, waiting for each prompt, and parses the iteration history, coefficients and transition locations of every point. Two instrumented builds were also made. One prints and to full double precision; the other offers two alternative relaxation rules, selected by an environment variable. All scripts and data are listed in the Appendix.
The main test matrix comprises six NACA sections of different thickness and camber (0012, 0018, 2412, 4412, 23012 and the thin, highly cambered 6409), six chord Reynolds numbers (, , , , , ), and angles of attack from to in steps. That gives 1908 operating points per strategy, with 160 panels, and . A point counts as converged only if XFOIL reports convergence (RMS change ) with finite coefficients.
5.2 A Converged Solution in Detail
Before looking at failures, it helps to see what a successful solution contains. Fig. 3 shows NACA 4412 at and (, , 200 panels). On the upper surface, the laminar layer separates at in the adverse pressure gradient behind the suction peak. rises to 6.2 inside the separation bubble while is negative. The envelope amplification reaches at . The newly turbulent layer then reattaches at and falls rapidly to turbulent values. The lower surface stays laminar to the trailing edge. The whole bubble, which spans 20 % of the chord and dominates the drag at this Reynolds number, is captured by the integral equations of Section 3 without any special treatment. That is the main reason XFOIL is so successful at low Reynolds numbers. The figure also shows where the solution is most sensitive: Just after transition, falls by up to 1.35 between adjacent stations, beyond the user guide’s limit of 1.0 per station even at 200 panels. This is the region the paneling rule addresses, and it is where the failures examined below originate.
5.3 Convergence Statistics
Seven solution strategies were compared on the same matrix:
- S0: a cold start at every point (boundary layers re-initialised,
INIT), with 100 iterations allowed. - S1/20: standard continuation, as performed by
ASEQ, marching from upwards and from downwards with XFOIL’s default limit of 20 iterations. - S1/100: the same continuation with 100 iterations.
- S2: S1/100 with an adaptive step bound. The limits in (29) are halved whenever the RMS change fails to fall by 10 %, and are restored gradually otherwise.
- S2b: S1/100 with fixed tighter limits , as used in QFoil [28].
- S3: S1/100 plus a recovery procedure. After a failed point, the solver re-converges at the last good angle (with a cold start there if necessary) and approaches the target again in 2, 4, 8 and 16 sub-steps. As a last resort it tries a cold start at the target.
- S4: S3 combined with the adaptive bound of S2.
| Strategy | Converged | Failed | Newton iterations per converged point |
|---|---|---|---|
| S0 cold start each point | 93.5 % | 124 | 22.0 |
| S1/20 continuation, default ITER | 89.3 % | 204 | 8.3 |
| S1/100 continuation | 96.2 % | 72 | 11.3 |
| S2 adaptive step bound | 91.9 % | 155 | 16.7 |
| S2b fixed tighter bounds | 95.0 % | 95 | 12.4 |
| S3 continuation + recovery | 98.5 % | 28 | 24.5 |
| S4 = S3 + adaptive bound | 96.0 % | 76 | 43.4 |
Fig. 4 and Table 3 give the results. Five observations follow.
- The default iteration limit is too low. With 20 iterations, more than one point in ten fails. At the failure rate reaches 15 %, most likely because transition moves rapidly forward on these sections and the first point after each jump needs more than 20 iterations. Raising the limit to 100 cuts failures from 204 to 72, at only 36 % more iterations per converged point.
- Continuation beats cold starts. Re-initialising the boundary layer at every point (S0) is both less reliable (93.5 %) and twice as expensive. The previous solution is a far better initial guess than XFOIL’s own marching initialisation.
- Changing the step limiter does not help. The adaptive bound (S2) reduced convergence to 91.9 %, and the fixed QFoil-style bounds (S2b) reduced it slightly, to 95.0 %. The reason is visible in the iteration logs. XFOIL’s RMS change is often non-monotonic during the first few iterations of a successful solve (for example 0.41, 0.42, 0.31, …), so a monotonicity test shrinks the step precisely when the iteration is about to take off. Section 6.1 argues that a proper merit function is needed instead.
- State management is what matters. The recovery procedure S3 converts 61 % of the remaining failures into converged points (72 → 28) and is the best strategy at every Reynolds number (Fig. 4). It costs about twice the iterations per converged point. At roughly 0.15 s per point here, that is a few seconds for a complete polar.
- Difficulty is concentrated. Fig. 5 shows that failures cluster at the lowest Reynolds numbers near stall and at negative angles, where laminar separation bubbles form or burst. The thin cambered NACA 6409 is the hardest section (92.5 % with S1/100, 98.4 % with S3).
5.4 Anatomy of a Failure: the Transition Station
Fig. 7 shows a typical failure in detail. The case is NACA 4412 at , approached in steps to . The RMS change falls from 0.115 to in three iterations and then stays at for the remaining 97. XFOIL’s diagnostic shows that the largest change is always in the shear-stress/amplification variable at station 37 on the upper surface, and station 37 is exactly where transition sits (). The iteration has locked into a cycle in which the transition point and the shear stress of the first turbulent station keep correcting each other. A cold restart at converges in 12 iterations to , . The “failed” state (, ) was already within 0.1 % of this answer. The non-smoothness of the transition treatment, not any physical difficulty, prevented convergence. A user, or an optimiser, would have discarded a correct point.
How common is this? All 72 points that failed under S1/100 were re-run while recording their final RMS, and compared with the converged answers that S3 found at the same conditions. Of the 43 failed points with a converged reference and finite coefficients, 14 (one in three) were within 1 % of the correct and , and 10 were within 0.1 %. Their final RMS distinguishes them well. Of the 15 failed points that ended with an RMS below , 14 were within 1 % of the answer. The median failed point, in contrast, ended with an RMS of 0.15, and those points were genuinely wrong.
5.5 Failure Propagation and Path Dependence
When a point fails, XFOIL keeps the unconverged state as the starting guess for the next request. Fig. 8 shows the consequence. Each airfoil was swept up from to in steps and immediately back down. For NACA 4412 at , one failure at the top of the upward sweep poisoned the solution so badly ( values near 80) that all 89 points of the downward sweep failed. For NACA 2412 at , 23 consecutive points failed before the solution recovered. NACA 0012 and 0018 at were unaffected.
Wherever both sweeps converged, the results were identical to within in and in . XFOIL’s converged steady solutions showed no hysteresis in these cases. The path dependence users experience is therefore numerical, not physical. That is good news, because it can be removed by better state management (S3) rather than requiring a different physical model.
5.6 Panel Density and the Mass-Influence Approximation
Fig. 9 shows the sensitivity to the number of panel nodes . Lift is converged to 0.1 % by . Drag at is under-predicted by 3.2 % at , 1.9 % at and 0.8 % at , and comes within 0.3 % of the value only for . The default of 160 nodes is therefore adequate for low Reynolds numbers but marginal for drag at higher ones. This agrees with the user guide’s warning that moderate Reynolds numbers, with small bubbles, need the finest paneling [5]. More striking, failed to converge in 200 iterations for two of the three cases, while and converged in 4–8 iterations. Robustness is not monotonic in resolution. The likely reason is again the discrete position of transition relative to the nodes.
The VACC parameter, which drops small mass-influence terms in BLSOLV (Section 3.8), behaves similarly. With the default of 0.01, the three hardest low-Reynolds-number sweeps of 45 points converged 45, 43 and 44 points. Exact elimination () converged 44, 44 and 43 points. At 0.05 they converged 44, 35 and 28 points with up to four times the iterations. At 0.1–0.2, two sweeps hung outright and the others converged only 25–36 of 45 points. The approximate Newton step buys speed at the cost of robustness, and the default sits at the edge of the safe range.
5.7 Transition Model Sensitivity
The simplified envelope method has one free parameter, , and the user must choose it. Fig. 10 shows its influence. For NACA 4412 at , drag at falls from 83 counts at to 60 at 9 and 49 at 13. Between and 11, which by (26) corresponds to free-stream turbulence between 0.16 % and 0.03 %, it varies by ±10 % (66 to 54 counts). For NACA 0012 at , ranges from 1.47 to 1.31 over the same span of . At the trend is not even monotonic: drag at is lowest at (103 counts) and rises both for earlier transition (133 counts at ) and for later transition (117 counts at 13), because a later transition lengthens the laminar separation bubble. A single, user-chosen scalar therefore controls drag predictions to ±10 % or more. That is comparable to the differences between competing airfoils that XFOIL is used to rank.
5.8 Compressibility Limit
Fig. 11 shows NACA 0012 at as the Mach number increases. XFOIL’s minimum pressure coefficient reaches the sonic value at . Beyond this the Kármán–Tsien correction (6) has no physical basis, because the real flow contains a supersonic pocket and a shock. Yet XFOIL continued to return converged solutions, inviscid and viscous, up to with no warning. The inviscid lift reached 0.50, twice the incompressible value. XFOIL does compute and display the sonic , but it neither flags nor refuses supercritical cases, so a batch user can silently obtain meaningless transonic data.
5.9 Output Smoothness and Gradients
Optimisers need smooth objectives. Fig. 12 shows drag and its derivative for NACA 2412 at and NACA 4412 at , computed in steps with the full-precision build. The drag curve looks smooth, but its derivative carries a saw-tooth whose period matches the movement of the transition point from one boundary-layer station to the next. Measured against a 15-point moving average, the oscillation has a standard deviation of 1.8 counts per degree. That is about 30 % of the typical gradient for the 2412 and 20 % for the 4412. Near the drag minimum of the 2412, the local slope changes sign nine times where the smoothed slope changes sign once. The function is continuous but not smooth, because the transition location moves in discrete jumps.
The response to a smooth geometric change is better behaved. Fig. 13 scans the thickness of NACA 2412 from 9.6 % to 15.6 % in 201 steps (using GDES TFAC) at fixed . At full precision the drag rises monotonically, without a single sign change of its slope. However, 11 of the 201 cases at (5.5 %) failed to converge. Fig. 14 shows central finite-difference derivatives against step size. With full-precision output they are stable down to a relative step of , to four digits at and to about 2 % at . With XFOIL’s printed output of five decimal places, the same derivatives are already wrong by 30 % at a relative step of and by more than 100 % at and below, and at they become exactly zero for steps of or less.
Fig. 15 extends the scan to two design variables. Thickness and camber of NACA 2412 were scaled together over a grid (9–16 % thickness, 0–5 % camber) at and . The converged drag field is smooth, with its minimum at the thin, highly cambered corner. But 17 of the 625 points (2.7 %) failed, and the failures are scattered across the interior of the space, not confined to its edges. A gradient-based optimiser crossing this space would meet a hole roughly every 37 evaluations. A population-based one would see random penalties that are unrelated to aerodynamics.
These results separate three sources of “noise” that are often confused. The first is truncated output, which is entirely an interface problem and is solved by passing doubles instead of text. The second is convergence failures, about 5 % of design points, which an optimiser sees as holes or penalties. The third is genuine non-smoothness from discrete transition, which matters most for derivatives with respect to angle of attack or lift coefficient and for points near the ends of a laminar bucket. NeuralFoil’s smooth outputs remove all three by construction [4]. Xoptfoil2’s “retry” and “outlier detection” features address the second and third heuristically [33]. Section 6 proposes remedies at the source.
5.10 Comparison with a Learned Surrogate
Because NeuralFoil is trained on XFOIL [4], it offers a useful check on how much of XFOIL’s behaviour is physics and how much is numerics. Its largest (“xlarge”) model was run over the same matrix and compared with the 1880 points that XFOIL converged with strategy S3 (Fig. 16). Lift agrees to a median of 0.006–0.012, and drag to a median of 1.3–2.5 %, depending on Reynolds number. The 90th-percentile drag difference is 7–11 %, concentrated near stall and at the lowest Reynolds numbers, where XFOIL’s own solutions are least certain. NeuralFoil evaluated the whole matrix in 0.26 s, against roughly 290 s of XFOIL time (more than a thousandfold faster), and returned the 625-point design map of Fig. 15 in 10 s without a single failure. Most telling is the drag slope in the right panel of Fig. 16. NeuralFoil reproduces XFOIL’s mean trend but not its saw-tooth. The surrogate has effectively learned XFOIL’s physics while averaging out its discretisation artefacts, which is exactly what remedies 4 and 7 of Section 6 aim to do inside XFOIL itself.
5.11 Limitations of This Study
The experiments compare XFOIL with itself, with variants of itself and with a surrogate trained on it. They measure numerical behaviour (convergence, smoothness, sensitivity) and say nothing about how close XFOIL is to wind-tunnel data. For that, the extensive published validation of XFOIL and RFOIL should be consulted [1], [2], [34]. The test sections are all NACA four- and five-digit airfoils. Modern laminar and low-Reynolds-number sections with long pressure recoveries may behave differently, although the mechanisms identified (transition-station lock-up, failure propagation) are generic. Only one paneling (160 nodes) was used for the convergence matrix, and Section 5.6 showed that robustness depends on it in a non-monotonic way. Finally, the recovery strategy S3 was implemented outside XFOIL. A built-in version could restore the state exactly rather than by re-solving, and would be cheaper.
6. Proposed Improvements
The improvements below are grouped by goal: robustness and convergence, physical accuracy, optimisation, and software. Each is tied to the evidence of Section 5 and to the equation it changes in Section 3. Table 4 at the end summarises them.
6.1 Robustness and Convergence
1. Never continue from a failed state. The single most effective change is also the simplest. XFOIL already knows whether the current state is converged (its LVCONV flag). It should keep a copy of the last converged boundary-layer state and restore it automatically after a failure, instead of using the unconverged state as the next initial guess. Section 5.5 showed one failure making 89 subsequent points fail. The recovery strategy S3, which does this from outside the code, raised convergence from 96.2 % to 98.5 % (Table 3).
2. Adaptive continuation with step bisection. After a failure, the request should be approached again in progressively smaller steps from the restored state, with a cold start at the target as a last resort. This is the rest of S3, and mfoil uses a similar continuation strategy [3]. Continuation theory gives a sounder basis than ad-hoc halving. Arc-length continuation [35] can follow a polar through its maximum-lift fold, and a lift-prescribed solve (XFOIL’s CL mode) cannot do that.
3. Globalise Newton with a residual merit function. Fixed or adaptive bounds on the step (S2, S2b) did not help, because XFOIL’s step norm is a poor measure of progress. The natural alternative is a backtracking line search, or a dogleg trust region, on the residual norm [36]. A step is accepted only if
with halved otherwise. Each trial costs one residual evaluation, much cheaper than a Jacobian factorisation. For starts far from the solution, pseudo-transient continuation adds a vanishing time-like diagonal to the Jacobian,
and has a convergence theory for exactly this kind of steady problem with poor initial guesses [37]. It would replace both the cold-start initialisation and the step limiter (29).
4. Smooth the transition switch. Section 5.4 traced a stalled iteration to the transition station, and Section 5.9 traced the saw-tooth in to transition moving between stations. Both come from the discrete switch between (11) and (12). A smooth alternative blends the laminar and turbulent closures over a short distance with an intermittency . For example,
with a continuous unknown, located by , and a few momentum thicknesses. Then every residual is differentiable in the transition location. mfoil’s re-marching of the transition point after each update and its small positive term that keeps from stalling are steps in this direction [3].
5. Detect stagnation and report quality. The point in Fig. 7 sat within 0.1 % of its converged answer for 97 iterations and was then discarded. XFOIL should recognise a stalled RMS (no decrease over several iterations, with the maximum change at the transition station) and either apply remedies 3–4 or return the result flagged as “stalled” with its residual. The user can then decide. Section 5.4 shows that a simple threshold works: failed points that stall with an RMS below were within 1 % of the converged answer in 14 of 15 cases. The default iteration limit should rise from 20 to at least 100, which on its own removed 65 % of failures (Section 5.3).
6. Solve the Newton system exactly. With nodes the Newton system has about 600 unknowns. Today it is solved in a few milliseconds by dense LU, so the VACC approximation (Section 5.6) saves little and costs robustness. Exact elimination, or VACC , should be the default.
7. Adaptive paneling. The user guide already states the resolution rule for bubbles: should not fall by more than 1.0, and should not change by more than 0.05, between nodes after transition [5]. These checks can be automated. After convergence, nodes are added where the rule is violated and the point is re-solved. That also removes the non-monotonic robustness with seen in Fig. 9. Adding a stagnation-point formulation like mfoil’s [3] would suppress leading-edge oscillations in at fine paneling.
6.2 Physical Accuracy
8. Tie to the environment and quantify its uncertainty. Section 5.7 showed drag changing by ±10 % over a plausible range (7–11), and by up to ±6 % over = 1–13. XFOIL should accept a turbulence intensity and convert it by (26), and it should report polars as bands over an interval rather than single curves. A bypass-transition criterion for high-turbulence or rough-surface cases, such as wind and marine turbines, propellers in slipstreams and eroded blades, would replace the advice to “set to 1 or less” [5]. The Abu-Ghannam–Shaw correlation [38] is a natural candidate. It gives the transition momentum-thickness Reynolds number from (in per cent) and the pressure-gradient parameter :
Transition would then be taken at whichever comes first, or . Both inputs are already available at every station. The Orr–Sommerfeld database shipped with XFOIL is used only by a post-processing plot of individual-frequency amplification. It could support a frequency-resolved option in the solver itself, so that the envelope simplification in (24) becomes a choice rather than a necessity.
9. Better stall and post-stall prediction. XFOIL, like RFOIL, over-predicts lift on thick sections for a wide range of angles, partly because the wake geometry is taken from the inviscid solution [34]. Three established changes address this. The first makes the lag constant in (12) depend on (QFoil: ). The second strengthens wake dissipation (RFOIL, QFoil). The third displaces the wake trajectory by the viscous displacement thickness [26], [28]. Beyond these, deep stall needs a model that admits large- reversed-flow profiles without the clipping of Section 3.8, or an explicit separated-wake (free-streamline) model, and it should be validated against data rather than tuned to it.
10. Respect the compressibility limit. XFOIL should warn when passes (Fig. 11) and refuse to report drag beyond a small supersonic margin. For transonic sections, the coupled Euler formulation of ISES and MSES [10], [20] or a full-potential outer flow is the proper upgrade. The Kármán–Tsien correction cannot be patched to cover shocks.
11. Source terms for real-world effects. Several practical effects can be added as source terms or modified closures in the integral equations. Examples are vortex generators (RFOILVogue [27]), rotational augmentation on rotor blades (RFOIL [26]; Du–Selig-type stall delay [39]), roughness and erosion (modified and transition), and suction or blowing (a wall mass-flux term in (9)). Each keeps the cost of the method unchanged.
6.3 Optimisation
12. Analytic sensitivities by the adjoint method. At convergence XFOIL holds the exact Jacobian of (28). For any output (such as at fixed ) and design variables (shape parameters), one extra linear solve with the transposed Jacobian,
gives the gradient with respect to all design variables at once [40]. The geometric terms come from differentiating the panel influence coefficients and arc lengths, either by hand or by algorithmic differentiation of the Fortran. MSES already provides such sensitivities to its optimiser [20], and differentiable re-implementations (AeroSandbox, Julia codes) show that the same is practical for XFOIL’s model [31]. Fig. 14 shows why this matters. Finite differences through XFOIL’s text output are unreliable below a relative step of about and useless at , and even full-precision differences need two solves per variable.
13. Make the objective smooth before optimising it. Analytic gradients of a non-smooth function are still unhelpful. Remedy 4 (smooth transition) and remedy 7 (adaptive paneling) remove the saw-tooth of Fig. 12. Returning doubles through an API (remedy 15) removes output quantisation. Point optimisation also tends to produce small bumps that exploit the separation-bubble model [41]. Curvature constraints, as in Xoptfoil2 [33], and multi-point or robust objectives (averaged over and ) counter this.
14. Use surrogates for exploration, XFOIL for verification. Smooth learned surrogates such as NeuralFoil are 8 to 1000 times faster and never fail to converge [4]. A multi-fidelity workflow follows naturally. Global exploration with a surrogate, using CST [42], Bézier or Hicks–Henne [43] parameters, is followed by gradient-based refinement with an adjoint-enabled XFOIL, and then by verification with MSES or RANS. Because the surrogates inherit XFOIL’s physics, improvements 8–11 propagate to them when they are retrained.
6.4 Software
15. A library, not only a program. The global COMMON state should be moved into a structure, as libxfoil has done [23], so that several analyses can run concurrently. A small C/Fortran API should return full-precision coefficients, distributions, convergence diagnostics and error codes, with Python bindings. This removes the disk and text-parsing overheads that wrappers currently pay. The experiments in this paper needed a prompt-synchronised text driver, two instrumented builds and workarounds for three interface traps: INIT is a toggle, VACC lives in a different menu from ITER, and the packaged binary traps floating-point exceptions. A library would avoid all of these.
16. Tests and validation in the open. A public regression suite should cover reference airfoils at several , and , with stored polars and convergence statistics like Table 3, plus a validation set of wind-tunnel data. Then branch developers (RFOIL, QFoil, browser ports) could show that a change improves accuracy or robustness without regressions.
6.5 What the First Improvements Change in Practice
Fig. 17 shows what items 1, 2, 5 and 8 change for a user, using the thin, highly cambered NACA 6409 at , to in steps. With default settings (160 nodes, ITER 20, plain continuation), 74 of 81 points converge. The failures cluster at the negative-angle end and near , exactly where a designer wants to know the drag rise and the stall. With 200 nodes, 100 iterations and the recovery procedure, all 81 points converge at . Repeating the sweep at and 11 then gives the band that the environment justifies. Minimum drag ranges from 144 to 238 counts and from 1.49 to 1.63, compared with 183 counts and 1.54 at the nominal value. The band is far wider than the differences that are often used to choose between low-Reynolds-number sections. Reporting it is the honest output. The curve also shows a sudden lift drop near where its bubble changes character, a feature that a single nominal polar would hide.
| # | Improvement | Evidence | Changes | Effort | Expected benefit |
|---|---|---|---|---|---|
| 1–2 | Restore last converged state; bisection continuation | Figs. 4, 8 | Driver logic | Low | Failures 72 → 28 of 1908 |
| 3 | Residual line search / pseudo-transient continuation | S2, S2b results | (29) | Medium | Robust cold starts, fewer stalls |
| 4 | Smooth transition (intermittency) | Figs. 7, 12 | (11)–(12), (25) | Medium | Removes stalls and gradient saw-tooth |
| 5 | Stagnation detection; ITER ≥ 100 | Fig. 7, Table 3 | Driver | Low | Failures 204 → 72 |
| 6 | Exact Newton elimination | VACC study | BLSOLV | Low | Robustness at no practical cost |
| 7 | Adaptive paneling, stagnation fix | Fig. 9 | Paneling | Medium | Drag accuracy; fewer anomalies |
| 8 | from ; bands; bypass transition | Fig. 10 | (26) | Low–medium | Honest ±10 % drag bands |
| 9 | Stall/post-stall closure and wake changes | [34], [28] | (12), (21), wake | Medium–high | Better , post-stall |
| 10 | Supercritical warning; Euler option | Fig. 11 | (6) | Low / high | No silent transonic errors |
| 11 | Source terms (VG, rotation, roughness) | [27], [26] | (9)–(12) | Medium | Wider applicability |
| 12 | Adjoint sensitivities | Fig. 14 | New solve with (28) | Medium | Exact gradients for all variables |
| 13–14 | Smooth objectives; surrogate + XFOIL workflow | Figs. 12, 13 | Workflow | Low | Reliable optimisation |
| 15–16 | Re-entrant library API; open tests | Section 5.1 | Code structure | Medium | Parallel use, reproducibility |