TUBEFLOW
validation report
About← Tube Flow

How far can you trust the numbers?

Every case below runs the app's own solver (src/lbm.js) on a problem with a known answer — an exact solution, a published result, or a conservation law — and checks the answer against a stated tolerance. The results shown were recorded with node tube-flow-sim/tests/validation.test.js; press Re-run to compute them again in your browser, from the same code.

— loading recorded results…

Cases

GPU solver: same answer as the CPU solver

The WebGPU solver (src/lbm-gpu.js) is a port of the same scheme. Each case runs both for 400 steps and compares every node: velocity within 5·10⁻⁴ of the speed (float32 summation order), density within 10⁻⁵, the drag on the body within 0.01%, the wall force within 0.5% (a sum of thousands of nearly cancelling terms), mass within 10⁻⁶.

Needs a browser with WebGPU.
casenodesvelocity diffdensity diffdrag GPU / CPU − 1wall forcemass
Recorded with tests/gpu.test.js on an Intel Xe laptop GPU: all 5 cases pass (27/27 checks), ~200 million lattice updates per second.

Benchmark: the wake of a sphere

Long GPU runs (tests/benchmark.js): a sphere moving through a tube with 20% blockage, 16 cells across, 1.8 million cells, compared with Johnson & Patel (1999, J. Fluid Mech. 378, 19–70) for a sphere in unbounded flow.

RequantitysimulationJohnson & Patel (unbounded)
100recirculation length L/d0.860.88
100drag coefficient C_d1.201.09 — the tube's blockage raises the drag
300wakesteady, obliquesteady, planar-symmetric from Re ≈ 210
300mean lift coefficient0.066≈ 0.065
376wakeperiodic sheddingperiodic shedding above Re ≈ 270
376Strouhal number0.1500.137 at Re 300, rising toward ~0.17 at Re 500

Limits — what the numbers don't cover

Reproduce

node tube-flow-sim/tests/lbm.test.js           # 28 checks (also run on every change)
node tube-flow-sim/tests/validation.test.js    # this report → tests/validation-results.json
python -m http.server 8767                     # then, with Playwright and a WebGPU-capable Chromium:
CHROME=<chrome.exe> node tube-flow-sim/tests/gpu.test.js