LEONSIM Workbench demo

Validation

A laminar airfoil with no turbulence model to hide behind

At Reynolds number 500 there is no turbulence model to blame. LeonSim first answered 0.33 where OpenFOAM said 0.175, because the call went to the wrong solver. Fixed, the two agree to a few hundredths of a per cent in drag, on three grids and in every wall region.

6 min read

Status. No status yet. Agrees with OpenFOAM on three grids, per wall region, but the comparison is not yet a row of the validation log. Two-way only: we found no published experimental force data for the steady laminar NACA 0012 at Re 500, so this row has no experiment. The GPU port matches the CPU solver; the comparison is the CPU one.

A turbulence model adds several arguable choices to a comparison: which variant, which wall treatment, where the flow transitions. Laminar flow at Reynolds number 500 has none of them. The equations are the Navier–Stokes equations, the mesh is the only choice, and two correct solvers have no excuse to disagree. That makes it a clean check of the discretisation, and it is how we found a plain bug.

The bug

Our meshfree particle solver was being compared with LeonSim’s laminar C-grid solver at Re 500, zero incidence, 64 faces per side. OpenFOAM gave a drag coefficient of 0.1753. LeonSim gave 0.331: viscous drag 0.243 where OpenFOAM had 0.133, a divergence residual stuck at 3·10⁻², and an answer that changed with the size of the domain.

The cause was not the physics. A laminar call on an airfoil mesh went to the first, Patankar-form solver of the module, whose face flux is built from interpolated cell velocities with no Rhie–Chow term, so continuity never closes. We reproduced it on the same mesh (drag 0.353 after 400 iterations and 0.329 after 3,000, divergence 1.8·10⁻² and 2.2·10⁻²), then changed only the solver: the OpenFOAM-form solver that the turbulent validation already used gave 0.17475 with flux continuity at round-off (4·10⁻¹⁵). The laminar physics, the mesh, the wall treatment and the force routine were not the cause. The fix routes laminar airfoil calls to the C-grid solver of the code comparison rows. Turbulent calls are untouched and bit-identical, which a test checks.

Three grids, two angles

The same mesh in both codes, refined by 2 in both directions (cells 2,976, 9,408 and 34,944), far field 10 chords, OpenFOAM v2412 laminar with linear-upwind, SIMPLEC, relaxation 0.8/0.7.

10°coarsemediumfineorderRichardson CD
LeonSim CD0.212290.210150.209121.050.20816
OpenFOAM CD0.212630.210210.209151.190.20831
difference−0.16 %−0.03 %−0.01 %−0.07 %
LeonSim CL0.428620.427940.42594
OpenFOAM CL0.429160.428150.42609

At 0° the drag is 0.17517, 0.17475 and 0.17439 against OpenFOAM’s 0.17540, 0.17528 and 0.17446 (−0.13 %, −0.30 % and −0.04 %). No order is defined there: the drag moves only 0.4 to 0.5 % over the three grids and OpenFOAM’s sequence is not monotone. At 10° the order is first, in both codes. The mesh refinement also reduces the stretching, so this is not a statement about either scheme’s formal order.

Left: drag at 10 degrees against cells for LeonSim and OpenFOAM, the two curves lying on each other and approaching the Richardson limit. Right: a one-to-one scatter of the ten wall-region contributions to pressure drag, friction drag and pressure lift on the fine grid; every point lies on the diagonal.
Left: drag at 10° on three grids. Right: ten wall regions, fine grid, 10°. Each point is one region’s contribution to pressure drag, friction drag or pressure lift, OpenFOAM on the horizontal axis and LeonSim on the vertical axis.

Region by region

Five chord bins on each surface, same polygon method applied to both codes’ wall faces. At 10° the pressure force agrees in every bin to 10⁻⁵ in CD,p and 3·10⁻⁵ in CL,p, on the medium and fine grids. Friction drag agrees to 10⁻⁴ or better everywhere except the nose bins, where the largest difference is 4.9·10⁻⁴ (medium) and 2.2·10⁻⁴ (fine): 8 % and 4 % of the lower nose bin, and 0.2 % of the total drag. The two codes define wall shear differently there (LeonSim at the cell centre, OpenFOAM on the face), the bins cancel, and total friction drag agrees to 0.03 %. We did not investigate further.

The GPU port

On an NVIDIA L4 in double precision, the 9,408-cell, 10° case agrees with the CPU solver to 3·10⁻¹¹ in lift and 7·10⁻¹² in drag, which is round-off. At 0° the two differ by 6·10⁻⁵ because of the mode described below, which round-off seeds and the GPU run reaches earlier; at iteration 2,399, on the plateau, the GPU drag is 0.17475.

What is not established

  • No experiment. The usual numerical benchmark tables for this case exist in the literature, and we did not retrieve them. What we have besides OpenFOAM is our earlier cut-cell solver at one larger domain, whose drag is within 0.4 % of OpenFOAM’s there.
  • Far field. R = 10 chords with a plain free-stream condition. From R = 10 to 20 the drag falls 0.18 % at 0° in LeonSim (0.30 % in OpenFOAM). Both codes share this error; the grid comparison is not a statement about the infinite-domain value.
  • A weak symmetry-breaking mode at 0°. After the state has settled (drag constant to 10⁻⁷ from about iteration 2,500) the velocity update begins to grow again, seeded by round-off, in LeonSim; OpenFOAM’s stalled residuals look like the same mode. The forces stay within 6·10⁻⁵ of the plateau at 4,000 iterations, but a longer run would need stopping at the plateau. We do not know whether it is a physical steady asymmetric branch, a property of SIMPLE with these relaxations, or the wake-cut treatment.
  • OpenFOAM’s 0° reference is not converged in the runs available (forces stable to 10⁻³), so the per-region 0° comparison uses the mean of its upper and lower surfaces. “Reference not converged” applies there.
  • Scope. Re 500, two angles, one domain size. Nothing here covers laminar separation at higher Reynolds numbers, which needs time accuracy.

Numbers: docs/laminar/results.md and docs/laminar/README.md; reproduce with python3 bench/laminar/report.py.