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.
Case
Converged (Scirocco / flexfoil / XFOIL)
Cl vs flexfoil, mean / max
Cd vs flexfoil, mean / max
Transition vs flexfoil, max
flexfoil vs XFOIL, Cl / Cd max
NACA 2412, inviscid, α = −4…12°
9 / 9 / 9
0.005% / 0.012%
—
—
0.011% / —
NACA 0012, Re = 10⁶, α = 0…15°
16 / 15 / 15
0.31% / 0.88%
0.94% / 3.8%
0.0066c
0.009% / 0.001%
NACA 2412, Re = 3×10⁶, α = −4…14°
19 / 18 / 18
0.49% / 1.6%
0.54% / 1.0%
0.0026c
0.015% / 0.003%
NACA 4412, Re = 2×10⁵, α = −2…12°
15 / 15 / 15
0.35% / 0.84%
0.84% / 2.8%
0.0082c
0.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.
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.
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.
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
-2
0.018
-1
0.130
0
0.241
1
0.352
2
0.462
3
0.569
4
0.675
5
0.804
6
0.913
7
1.008
8
1.107
9
1.206
10
1.303
11
1.395
12
1.483
13
1.555
14
1.617
XFOIL 6.99
α (deg)
Cl
-4
-0.208
-3
-0.096
-2
0.017
-1
0.130
0
0.242
1
0.354
2
0.465
3
0.573
4
0.677
5
0.806
7
1.009
8
1.109
9
1.209
10
1.307
11
1.400
12
1.489
13
1.564
14
1.627
flexfoil 1.1.6
α (deg)
Cl
-4
-0.208
-3
-0.096
-2
0.017
-1
0.130
0
0.242
1
0.354
2
0.465
3
0.573
4
0.677
5
0.806
7
1.008
8
1.109
9
1.209
10
1.307
11
1.400
12
1.489
13
1.564
14
1.627
Scirocco
XFOIL 6.99
flexfoil 1.1.6
Show data
Scirocco
Cd
Cl
0.00637
-0.206
0.00607
-0.094
0.00582
0.018
0.00564
0.130
0.00547
0.241
0.00519
0.352
0.00508
0.462
0.00514
0.569
0.00570
0.675
0.00677
0.804
0.00791
0.913
0.00892
1.008
0.00994
1.107
0.01103
1.206
0.01216
1.303
0.01348
1.395
0.01482
1.483
0.01660
1.555
0.01852
1.617
XFOIL 6.99
Cd
Cl
0.00639
-0.208
0.00609
-0.096
0.00584
0.017
0.00566
0.130
0.00549
0.242
0.00521
0.354
0.00511
0.465
0.00518
0.573
0.00574
0.677
0.00680
0.806
0.00896
1.009
0.00998
1.109
0.01107
1.209
0.01221
1.307
0.01356
1.400
0.01497
1.489
0.01672
1.564
0.01871
1.627
flexfoil 1.1.6
Cd
Cl
0.00639
-0.208
0.00609
-0.096
0.00584
0.017
0.00566
0.130
0.00549
0.242
0.00521
0.354
0.00511
0.465
0.00518
0.573
0.00574
0.677
0.00680
0.806
0.00896
1.008
0.00998
1.109
0.01107
1.209
0.01221
1.307
0.01356
1.400
0.01497
1.489
0.01672
1.564
0.01871
1.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
NACA 0012, Re = 10⁶. Not converged: XFOIL 6.99 at 1°; flexfoil 1.1.6 at 1°.Show data
Scirocco
α (deg)
Cl
0
0.000
1
0.106
2
0.212
3
0.318
4
0.428
5
0.556
6
0.693
7
0.830
8
0.914
9
0.997
10
1.078
11
1.165
12
1.238
13
1.306
14
1.348
15
1.351
XFOIL 6.99
α (deg)
Cl
0
-0.000
2
0.214
3
0.320
4
0.428
5
0.556
6
0.694
7
0.827
8
0.910
9
0.995
10
1.078
11
1.167
12
1.242
13
1.312
14
1.351
15
1.357
flexfoil 1.1.6
α (deg)
Cl
0
0.000
2
0.214
3
0.320
4
0.428
5
0.556
6
0.694
7
0.827
8
0.910
9
0.995
10
1.078
11
1.167
12
1.242
13
1.312
14
1.351
15
1.357
Scirocco
XFOIL 6.99
flexfoil 1.1.6
Show data
Scirocco
Cd
Cl
0.00539
0.000
0.00548
0.106
0.00579
0.212
0.00639
0.318
0.00728
0.428
0.00846
0.556
0.00972
0.693
0.01091
0.830
0.01208
0.914
0.01340
0.997
0.01515
1.078
0.01673
1.165
0.01939
1.238
0.02186
1.306
0.02521
1.348
0.03255
1.351
XFOIL 6.99
Cd
Cl
0.00541
-0.000
0.00582
0.214
0.00641
0.320
0.00730
0.428
0.00849
0.556
0.00975
0.694
0.01095
0.827
0.01211
0.910
0.01344
0.995
0.01524
1.078
0.01686
1.167
0.01961
1.242
0.02214
1.312
0.02604
1.351
0.03382
1.357
flexfoil 1.1.6
Cd
Cl
0.00541
0.000
0.00582
0.214
0.00641
0.320
0.00730
0.428
0.00849
0.556
0.00975
0.694
0.01095
0.827
0.01211
0.910
0.01344
0.995
0.01524
1.078
0.01686
1.167
0.01961
1.242
0.02214
1.312
0.02604
1.351
0.03382
1.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
NACA 4412, Re = 2×10⁵. Every point converged in every code.Show data
NACA 4412, Re = 2×10⁵: transition location on the upper surface.Show data
Scirocco
α (deg)
x/c transition, upper
-2
0.855
-1
0.814
0
0.766
1
0.713
2
0.665
3
0.623
4
0.585
5
0.549
6
0.510
7
0.460
8
0.403
9
0.319
10
0.192
11
0.103
12
0.074
XFOIL 6.99
α (deg)
x/c transition, upper
-2
0.855
-1
0.814
0
0.766
1
0.714
2
0.665
3
0.623
4
0.585
5
0.549
6
0.510
7
0.459
8
0.402
9
0.316
10
0.184
11
0.099
12
0.072
flexfoil 1.1.6
α (deg)
x/c transition, upper
-2
0.855
-1
0.814
0
0.766
1
0.714
2
0.665
3
0.623
4
0.585
5
0.549
6
0.510
7
0.459
8
0.402
9
0.316
10
0.184
11
0.099
12
0.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.
NACA 2412 at Re = 3×10⁶ and α = 4°. The markers are every sixth flexfoil
node.
Scirocco
XFOIL 6.99
flexfoil 1.1.6
NACA 2412, Re = 3×10⁶, α = 4°.
Scirocco
XFOIL 6.99
flexfoil 1.1.6
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.
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.
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
NACA 2412, inviscid, α = 4°.
flexfoil reports inviscid Cp at panel midpoints rather than at the nodes.
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.
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.