Validation · 27 July 2026
Navier–Stokes in Structured Text: the lid-driven cavity against Ghia, Ghia & Shin (1982)
A finite-difference flow solver written in IEC 61131-3 Structured Text, run as PLC tasks and scored against the standard benchmark, with one diagnosis tested and corrected along the way.
Question
Can a flow solver written in Structured Text, scheduled as ordinary PLC tasks, reproduce the standard lid-driven-cavity benchmark? Where it falls short, what causes the shortfall?
Method
The solver uses artificial compressibility, forward-backward staggering, a 70/30 central/upwind blend and 32-bit REALs. It runs on the runtime’s compute tier, and every task arm is certified byte-identical to the interpreter over 64 scans before the compute tier takes it. Centerline profiles were collected by live polling of the running tasks (P0, P1) and, for P2 and P3, from the historian alone, then scored against Ghia’s Tables I and II.
- P0 — 51×51, Re = 100, one task.
- P1 — the same grid split into three tiles exchanging halos, as three tasks.
- P2 — 129×129, Re = 1000, three tiles. On this grid every Ghia station falls exactly on a grid index, so no interpolation enters the comparison.
- P3 — a matched pair on the same binary and host, started together, whose project files differ only in the 24 upwind-blend constants (θ = 0.30 against θ = 0.10).
Result
| Case | u-centerline max / mean abs error | v-centerline max / mean abs error |
|---|---|---|
| P0, 51×51, Re = 100 | 0.01371 / 0.00526 | 0.01565 / 0.00495 |
| P1, 3 tiles, Re = 100 | identical to P0 at all 34 reference points | identical |
| P2, 129×129, Re = 1000, θ = 0.30 (v1.0.1259-era) | 0.07528 / 0.03312 | 0.06288 / 0.04118 |
| P3 control, θ = 0.30 (v1.0.1268) | 0.07509 / 0.03310 | 0.06280 / 0.04113 |
| P3 experiment, θ = 0.10 (v1.0.1268) | 0.05686 / 0.02667 | 0.04734 / 0.03151 |
The P3 control reproduced the P2 dataset to within 2 × 10⁻⁴ on a binary nine versions later, so the θ comparison is not confounded by the binary.
- Tiling changes nothing. The three-tile solver converges to the same 32-bit fixed point as the single task. A separate 15×15, two-tile test runs the single-domain interpreter, tiled interpreters and tiled compute VMs bit-identical for 600 scans.
- At Re = 1000 the flow structure is right and its strength is low. Every extremum sits at the Re = 1000 position. Scored against Ghia’s Re = 400 column, the errors are 1.9–3.5× worse, so the effective Reynolds number has not drifted. Magnitudes are uniformly damped by 13.8 %, with no sign disagreement. A second harvest after a machine reboot reproduced this to 4–5 decimal places.
- The first diagnosis was tested and was only about a quarter right. The 13.8 % deficit was attributed to the upwind blend. Cutting the blend threefold at a fixed grid reduced it only to 11.2 %. The blend is a real mechanism: the steep-gradient stations improved, and v_min moved to within one cell of Ghia’s position. But most of the deficit comes from something else.
Limits
- The 28 % / 72 % split comes from a two-point linear model. The intercept is an assumption, not a measurement, so the only claim made here is that most of the deficit is not the blend.
- The Re = 1000 reference column was taken from a public transcription of Ghia’s tables. That transcription matches the paper at all 34 Re = 100 points, but it has not yet been checked against the paper for Re = 1000.
- The 51×51 runs at Re = 400, 3200 and 5000 converged but have never been scored.
- Tiling at 51×51 was slower than a single task: a correctness result, not a speed-up.
What it rests on
Sources
Repository paths name records in the ControlForge repository, which is private and not available for review.
- Validation record, phases P0–P3
projects/cfd/VALIDATION.md - Single-domain solver
projects/cfd/cavity.st - Ghia, Ghia & Shin, J. Comput. Phys. 48 (1982) 387–411 ↗
Still open: What is the rest of the cavity solver's amplitude deficit?