Validation
NACA 4412: a separated flow that missed its limit, and the wall-cell term behind it
Our second 2D gate case failed its own 2 % drag limit on two of three grids. We found the cause in how the wall-adjacent cell is treated, fixed it behind an option, and kept the failure on the record.
Status. No status yet. The case of record does not meet its drag criterion (drag against OpenFOAM −2.11 / −2.39 / −1.72 % on three grids, limit 2 %). With a post-hoc option, wall_fn, all criteria are met. The option reproduces OpenFOAM’s wall-cell formulation, so agreement with OpenFOAM in that term is by construction; it is off by default. Wall pressure against the experiment is qualitative only.
A flat plate and a bump are attached flows. The NACA 4412 at 13.87° is not: a boundary layer on the upper surface separates near 80 % of the chord and the wake carries a large share of the drag. This is the case from NASA’s Turbulence Modeling Resource (2DN44, Coles & Wadcock’s experiment, Reynolds number 1.52 million), and it was our second gate for the 2D solver.
The criteria, fixed before any run
We wrote the pass criteria down on 18 October, before the first run: lift within 1 % of OpenFOAM, drag within 2 %, the pressure and friction pieces of five wall regions each within 3 %, wall pressure RMS within 0.01, separation point within 0.01 chord. Same mesh nodes in both codes: NASA’s C-grids at 225×65, 449×129 and 897×257, incompressible, k-ω SST in both, OpenFOAM’s relaxation. The finer LeonSim levels ran on the GPU port (matching the CPU to 10⁻⁸ on this mesh).
The record: close, but over the line
| grid | CL | CD | CD,p | CD,v | separation x/c, LeonSim / OpenFOAM |
|---|---|---|---|---|---|
| 225×65 | +0.44 % | −2.11 % | −2.71 % | 0.00 % | 0.7800 / 0.7752 |
| 449×129 | +0.58 % | −2.39 % | −3.02 % | −0.18 % | 0.7991 / 0.7923 |
| 897×257 | +0.43 % | −1.72 % | −2.16 % | −0.16 % | 0.8008 / 0.7953 |
| limit | 1 % | 2 % | 3 % per region | 3 % per region | 0.01 chord |
Lift, wall pressure, the separation point and every one of the pieces are inside the limits at all three levels. Drag is not: it fails at 225 and 449. The shortfall is pressure drag, spread over the regions with the same sign; friction agrees to 0.2 %. We did not change the criterion. The case does not pass as recorded.
Finding the cause
We followed our rule for stubborn gaps: halve the space of possible causes with a test that can fail, before fixing anything.
- Attached flow agrees. At 4° (attached) the pressure-drag gap to OpenFOAM is −0.47 %, at 10° −1.5 %, at 13.87° −2.7 %. It grows with the separated extent.
- Not the far field. Cutting rows off the outer boundary moves both codes’ drag alike (+0.5, +2.3, +15.8 % against +0.5, +2.2, +14.9 %).
- Not the relaxation or the frame. Three relaxation settings move pressure drag by 0.014 %; a mesh turned by the angle of attack moves lift by 0.025 %.
- High-order convection takes some, not all. First-order upwind for turbulence in both codes removes a quarter to two fifths of the gap. First-order upwind for velocity as well makes the two codes agree to 0.43 % (with drag 2.5 times higher, from numerical diffusion: that tests that the algorithms are equal, not that they are accurate). Both pointed at the high-order convection, and the next two tests cleared it.
- Not the gradient or limiter. LeonSim’s gradient routines evaluated on OpenFOAM’s own fields reproduce OpenFOAM’s gradients to rounding (about 10⁻¹⁰), including the active-limiter fraction.
- Not the convection operator. OpenFOAM’s assembled convection operator and ours, on the same fields, agree to 10⁻⁸ for velocity.
That left the equations’ right-hand sides. We put OpenFOAM’s converged fields into LeonSim and looked at the residual of each equation. Momentum was balanced (10⁻⁶). The turbulent kinetic energy equation was not: 3.7 % of the diagonal term in the cells touching the wall. Pinning k, ω and eddy viscosity to OpenFOAM’s values in just those 224 wall-adjacent cells recovered 70 % of the drag gap.
The mechanism, from OpenFOAM’s source: in every wall-adjacent cell its omegaWallFunction sets the production of k to G0 = ν |∂U/∂n| Cμ1/4 √k / (κ y) and blends ω between its viscous and logarithmic limits. LeonSim used the eddy-viscosity form there, which is about zero in a wall-resolved cell, and the viscous limit alone. At y⁺ near 0.3 the OpenFOAM production is orders of magnitude larger, and it sets the near-wall k that the adverse-pressure-gradient layer then carries.
With the fix
The option wall_fn applies the same formulas in LeonSim’s wall-adjacent cells. Against the same OpenFOAM runs, with the criteria unchanged:
| grid | CD, record | CD, with option | CD,p, with option | CL | worst region, share of limit (record) |
|---|---|---|---|---|---|
| 225×65 | −2.11 % | −0.30 % | −0.36 % | +0.03 % | 0.19 (0.75) |
| 449×129 | −2.39 % | −0.57 % | −0.69 % | +0.14 % | 0.23 (0.84) |
| 897×257 | −1.72 % | −0.72 % | −0.90 % | +0.19 % | 0.24 (0.59) |
LeonSim’s observed drag order goes from 0.76 to 1.55 (OpenFOAM: 1.48), with a grid-convergence index of 0.76 % on the finest pair instead of 3.58 %: the two codes now converge alike. Lift is not monotone with the grid in either code, so we state no order for it.
What the fix is and is not
- It is post hoc. We made it after the record failed. The record, with the option off, stays failed in our log.
- The agreement with OpenFOAM is by construction in that term. The independent checks are NASA’s CFL3D and FUN3D, which have their own wall treatment, and the experiment. Against both, the option leaves things unchanged or slightly closer: at 897×257 lift is +0.52 % and +0.58 % from CFL3D and FUN3D, drag +0.42 % and −2.4 % (the two NASA codes are 2.9 % apart themselves).
- The remaining gap grows with refinement (−0.30, −0.57, −0.72 %). We traced it to OpenFOAM’s wall-distance algorithm, not LeonSim: with OpenFOAM on the exact wall distance, as LeonSim uses, the gap is +0.08, −0.01 and −0.05 %.
- The option is off by default, because a default must pass every case on the scoreboard. On the flat plate and bump it moves forces by at most 0.004 %, and on the NACA 0012 by 0.11 % in pressure drag. Whether it becomes the default is still to be decided.
- Compressibility. LeonSim is incompressible. OpenFOAM at Mach 0.09 puts pressure drag 2.1 % above the incompressible value on the same grid; applied to LeonSim as an estimate (not a run), the drag with the option is +1.9 % from CFL3D and −0.9 % from FUN3D, inside NASA’s own spread.
Against the experiment
NASA is explicit that comparisons with this experiment are qualitative: the tunnel walls matter, the boundary layers were tripped, and the reference velocity needs an unexplained 0.93 factor. The experiment gives no force data, only wall pressure and six velocity profiles near the trailing edge. Against the 45 wall-pressure points, the RMS error is 0.178 for LeonSim, 0.179 for OpenFOAM and 0.179 for CFL3D. All three over-predict the suction on the upper surface by the same amount, and miss the trailing-edge plateau the same way, as the first panel shows. So the experiment does not discriminate between the three, and this row is not validated against the experiment beyond that statement.
An open item at higher angles
On the NACA 0012, from 14° LeonSim and OpenFOAM disagree in lift (−2.2 % at 14°, −6.9 % at 15°) regardless of this option. The cause is a start-up velocity limiter, u_cap, whose default of three free-stream speeds is active in the converged states from 13° because the suction peak is above it. With the limiter raised to ten the two codes agree at 14° and 15° to 0.02 % in lift and 0.14 % in drag. On 21 October the 2D solver’s default was raised to ten (the 3D grid solver keeps three). Other cases whose suction peaks exceed three free-stream speeds have not been checked for clipped cells.
Numbers: docs/validation/naca4412-separation/README.md (sections 5.1 to 5.16) and the NACA 4412 section of docs/validation/validation-root-cause.md.