Skip to main content
Version: Next

Comparison with flexfoil

flexfoil is Flexcompute's rewrite of XFOIL in Rust, available as a Python package and in the browser. It is a second, independent port of XFOIL's panel method and integral boundary layer, written in a compiled language like Scirocco. On the same nodes, flexfoil 1.1.6 reproduces XFOIL 6.99 to about 0.01% in Cl and 0.001% in Cd, and fails to converge at the same angles. Scirocco therefore differs from flexfoil by the same amount as from XFOIL: on average 0.3–0.5% in Cl and 0.5–1% in Cd.

CaseConverged (Scirocco / flexfoil / XFOIL)Cl vs flexfoil, mean / maxCd vs flexfoil, mean / maxTransition vs flexfoil, maxflexfoil vs XFOIL, Cl / Cd max
NACA 2412, inviscid, α = −4…12°9 / 9 / 90.005% / 0.012%——0.011% / —
NACA 0012, Re = 10⁶, α = 0…15°16 / 15 / 150.31% / 0.88%0.94% / 3.8%0.0066c0.009% / 0.001%
NACA 2412, Re = 3×10⁶, α = −4…14°19 / 18 / 180.49% / 1.6%0.54% / 1.0%0.0026c0.015% / 0.003%
NACA 4412, Re = 2×10⁵, α = −2…12°15 / 15 / 150.35% / 0.84%0.84% / 2.8%0.0082c0.006% / 0.004%
NACA 2412, Re = 6×10⁶, M = 0.4, α = −2…6°8 / 0 / 9————

Differences are relative, over the angles where both codes converged; Cl differences skip |Cl| < 0.05. The cases and nodes are those of XFOIL and mfoil, so the two pages can be read side by side.

Setup​

  • Same nodes. mfoil panels each airfoil with 199 panels. Scirocco takes those nodes unchanged, XFOIL loads them without repaneling (PCOP), and flexfoil builds its panels from the coordinates it is given, without repaneling.
  • Same physics. ncrit = 9, free transition on both surfaces, at most 100 Newton iterations per point. Scirocco runs mfoil's closure, as on the XFOIL and mfoil page.
  • How each code runs. Scirocco and XFOIL sweep each polar from the angle nearest 0°, each point warm-starting from the last (Scirocco with warm_start = true). flexfoil's Python interface has no warm start, so it solves every point from a cold start, like mfoil.
  • Version. flexfoil 1.1.6 from PyPI (pip install flexfoil==1.1.6), through its analyze_faithful and get_bl_distribution functions.

Viscous polars​

  • Scirocco
  • XFOIL 6.99
  • flexfoil 1.1.6
00.511.5-404812α (deg)Cl
NACA 2412, Re = 3×10⁶. Not converged: XFOIL 6.99 at 6°; flexfoil 1.1.6 at 6°.
Show data
Scirocco
α (deg)Cl
-4-0.206
-3-0.094
-20.018
-10.130
00.241
10.352
20.462
30.569
40.675
50.804
60.913
71.008
81.107
91.206
101.303
111.395
121.483
131.555
141.617
XFOIL 6.99
α (deg)Cl
-4-0.208
-3-0.096
-20.017
-10.130
00.242
10.354
20.465
30.573
40.677
50.806
71.009
81.109
91.209
101.307
111.400
121.489
131.564
141.627
flexfoil 1.1.6
α (deg)Cl
-4-0.208
-3-0.096
-20.017
-10.130
00.242
10.354
20.465
30.573
40.677
50.806
71.008
81.109
91.209
101.307
111.400
121.489
131.564
141.627
  • Scirocco
  • XFOIL 6.99
  • flexfoil 1.1.6
00.511.500.0050.010.0150.02CdCl
Show data
Scirocco
CdCl
0.00637-0.206
0.00607-0.094
0.005820.018
0.005640.130
0.005470.241
0.005190.352
0.005080.462
0.005140.569
0.005700.675
0.006770.804
0.007910.913
0.008921.008
0.009941.107
0.011031.206
0.012161.303
0.013481.395
0.014821.483
0.016601.555
0.018521.617
XFOIL 6.99
CdCl
0.00639-0.208
0.00609-0.096
0.005840.017
0.005660.130
0.005490.242
0.005210.354
0.005110.465
0.005180.573
0.005740.677
0.006800.806
0.008961.009
0.009981.109
0.011071.209
0.012211.307
0.013561.400
0.014971.489
0.016721.564
0.018711.627
flexfoil 1.1.6
CdCl
0.00639-0.208
0.00609-0.096
0.005840.017
0.005660.130
0.005490.242
0.005210.354
0.005110.465
0.005180.573
0.005740.677
0.006800.806
0.008961.008
0.009981.109
0.011071.209
0.012211.307
0.013561.400
0.014971.489
0.016721.564
0.018711.627

flexfoil's markers sit on the XFOIL curve throughout, including the miss at 6°, where both stop short of convergence.

  • Scirocco
  • XFOIL 6.99
  • flexfoil 1.1.6
00.511.50481216α (deg)Cl
NACA 0012, Re = 10⁶. Not converged: XFOIL 6.99 at 1°; flexfoil 1.1.6 at 1°.
Show data
Scirocco
α (deg)Cl
00.000
10.106
20.212
30.318
40.428
50.556
60.693
70.830
80.914
90.997
101.078
111.165
121.238
131.306
141.348
151.351
XFOIL 6.99
α (deg)Cl
0-0.000
20.214
30.320
40.428
50.556
60.694
70.827
80.910
90.995
101.078
111.167
121.242
131.312
141.351
151.357
flexfoil 1.1.6
α (deg)Cl
00.000
20.214
30.320
40.428
50.556
60.694
70.827
80.910
90.995
101.078
111.167
121.242
131.312
141.351
151.357
  • Scirocco
  • XFOIL 6.99
  • flexfoil 1.1.6
00.511.500.010.020.03CdCl
Show data
Scirocco
CdCl
0.005390.000
0.005480.106
0.005790.212
0.006390.318
0.007280.428
0.008460.556
0.009720.693
0.010910.830
0.012080.914
0.013400.997
0.015151.078
0.016731.165
0.019391.238
0.021861.306
0.025211.348
0.032551.351
XFOIL 6.99
CdCl
0.00541-0.000
0.005820.214
0.006410.320
0.007300.428
0.008490.556
0.009750.694
0.010950.827
0.012110.910
0.013440.995
0.015241.078
0.016861.167
0.019611.242
0.022141.312
0.026041.351
0.033821.357
flexfoil 1.1.6
CdCl
0.005410.000
0.005820.214
0.006410.320
0.007300.428
0.008490.556
0.009750.694
0.010950.827
0.012110.910
0.013440.995
0.015241.078
0.016861.167
0.019611.242
0.022141.312
0.026041.351
0.033821.357

XFOIL's limit cycle at 1° on NACA 0012 (see Convergence) recurs in flexfoil: both settle on Cl = 0.1075 and stop there after 100 iterations, which suggests that flexfoil follows XFOIL's Newton iteration step by step. Scirocco converges at that point.

  • Scirocco
  • XFOIL 6.99
  • flexfoil 1.1.6
00.511.504812α (deg)Cl
NACA 4412, Re = 2×10⁵. Every point converged in every code.
Show data
Scirocco
α (deg)Cl
-20.248
-10.352
00.490
10.593
20.696
30.801
40.905
51.008
61.109
71.201
81.284
91.349
101.367
111.359
121.357
XFOIL 6.99
α (deg)Cl
-20.250
-10.354
00.488
10.591
20.696
30.801
40.906
51.010
61.111
71.203
81.287
91.353
101.372
111.366
121.368
flexfoil 1.1.6
α (deg)Cl
-20.250
-10.354
00.488
10.591
20.696
30.801
40.906
51.010
61.111
71.203
81.287
91.353
101.372
111.366
121.368
  • Scirocco
  • XFOIL 6.99
  • flexfoil 1.1.6
00.511.500.010.020.030.04CdCl
Show data
Scirocco
CdCl
0.012790.248
0.010760.352
0.010000.490
0.010370.593
0.010970.696
0.011740.801
0.012620.905
0.013571.008
0.014541.109
0.015421.201
0.016431.284
0.017971.349
0.021821.367
0.028841.359
0.037091.357
XFOIL 6.99
CdCl
0.012840.250
0.010810.354
0.010020.488
0.010400.591
0.011010.696
0.011780.801
0.012660.906
0.013611.010
0.014591.111
0.015481.203
0.016511.287
0.018171.353
0.022331.372
0.029661.366
0.038121.368
flexfoil 1.1.6
CdCl
0.012840.250
0.010810.354
0.010020.488
0.010400.591
0.011010.696
0.011780.801
0.012660.906
0.013611.010
0.014591.111
0.015481.203
0.016511.287
0.018171.353
0.022331.372
0.029661.366
0.038121.368

Transition​

  • Scirocco
  • XFOIL 6.99
  • flexfoil 1.1.6
00.20.40.60.81-2024681012α (deg)x/c transition, upper
NACA 4412, Re = 2×10⁵: transition location on the upper surface.
Show data
Scirocco
α (deg)x/c transition, upper
-20.855
-10.814
00.766
10.713
20.665
30.623
40.585
50.549
60.510
70.460
80.403
90.319
100.192
110.103
120.074
XFOIL 6.99
α (deg)x/c transition, upper
-20.855
-10.814
00.766
10.714
20.665
30.623
40.585
50.549
60.510
70.459
80.402
90.316
100.184
110.099
120.072
flexfoil 1.1.6
α (deg)x/c transition, upper
-20.855
-10.814
00.766
10.714
20.665
30.623
40.585
50.549
60.510
70.459
80.402
90.316
100.184
110.099
120.072

flexfoil and XFOIL put transition within 0.0001c of each other in this case. The only differences above 0.0005c anywhere are two points, NACA 0012 at 6° and NACA 2412 at 5°, where XFOIL places lower-surface transition within 0.006c of the trailing edge and flexfoil reports none (x/c = 1). That edge case sets the 0.0066c maximum against Scirocco for NACA 0012; Scirocco and XFOIL agree there to 0.0014c.

Surface distributions​

NACA 2412 at Re = 3×10⁶ and α = 4°. The markers are every sixth flexfoil node.

  • Scirocco
  • XFOIL 6.99
  • flexfoil 1.1.6
-1-0.500.511.500.20.40.60.81x/c−Cp
NACA 2412, Re = 3×10⁶, α = 4°.
  • Scirocco
  • XFOIL 6.99
  • flexfoil 1.1.6
00.0040.00800.20.40.60.81x/cCf
NACA 2412, Re = 3×10⁶, α = 4° on the upper surface. The axis cuts off the leading-edge peak.

flexfoil's Cp matches XFOIL's to 4e-5 and its Cf to 6e-6 at every node, in all three viscous cases, so the Scirocco–flexfoil differences are those described for XFOIL in Surface distributions.

Compressible flow​

flexfoil 1.1.6 converged at none of the nine points at M = 0.4, nor at M = 0.1, within 100 iterations; at M = 0 the same points converge in at most nine. Its unconverged Cl stays at the incompressible value instead of rising by the Kármán–Tsien factor, about 9% at M = 0.4. No compressible comparison is possible with this version.

Inviscid​

flexfoil's inviscid routine (analyze_inviscid) is separate from its viscous solver. Its Cl agrees with Scirocco's and XFOIL's to 0.012%, but its Cm drifts away from theirs as lift grows: by 0.003 at 4° and 0.03 at 12°. Its viscous solver doesn't share the discrepancy; its Cm matches XFOIL's to 5e-6.

  • Scirocco
  • XFOIL 6.99
  • flexfoil 1.1.6
-1-0.500.511.500.20.40.60.81x/c−Cp
NACA 2412, inviscid, α = 4°.

flexfoil reports inviscid Cp at panel midpoints rather than at the nodes.

Speed​

Scirocco solves a single point about twice as fast as flexfoil at 200 panels, and a warm-started polar 2.4 to 4.7 times as fast, depending on whether flexfoil solves the points in parallel; see Performance.

Reproducing​

scirocco/validation/vv holds the scripts. vv.py codes runs flexfoil alongside Scirocco, XFOIL and mfoil and writes all four into docs/src/data/vv_codes.json; it needs the flexfoil Python package as well as XFOIL. flexfoil adds a few seconds; the cold-start mfoil solves dominate the run time.

flexfoil's boundary-layer output normalizes Cf by the local edge velocity, so vv.py multiplies it by ue² to get XFOIL's freestream-based Cf, and computes Cp from ue with XFOIL's Kármán–Tsien formula.