Fluid Dynamics
Navier-Stokes on the browser's GPU — laminar flow, turbulence models (k-ε, k-ω, LES filter), boundary-layer analysis, and vortex shedding — verified to ≤ 0.1% on canonical benchmarks.
- Live app — zeq.dev/apps/fluid-dynamics/
- Source —
app/artifacts/api-server/public/apps/fluid-dynamics/(1,401 lines) - Operators — KO42 · NS-incompressible · Reynolds-stress (τ_ij) · optional NM28
- Error budget — ≤ 0.1% for lid-driven cavity at
Re = 1000(Ghia et al., 1982, reference)
What it solves
Incompressible 2D Navier-Stokes on a regular grid, with three turbulence-modelling options:
- DNS — direct numerical solve, expensive but exact
- RANS (k-ε / k-ω) — time-averaged, production-grade, for engineering design
- LES with Smagorinsky filter — large-eddy resolved, sub-grid modelled
Runs on WebGL2 with a compute-shader projection step. Each HulyaPulse tick produces one fully-converged pressure-Poisson solve; the render loop interpolates between ticks for smooth visualisation.
The math
Navier-Stokes ρ(∂v/∂t + v·∇v) = −∇p + μ∇²v + f
Continuity ∇·v = 0 (incompressible)
Reynolds decomp. v = v̄ + v'
Reynolds stress τ_ij = −ρ ⟨v'_i v'_j⟩
k-ε closure ν_t = C_μ k² / ε (C_μ = 0.09)
Operator picks
| Step | Decision |
|---|---|
| 1. Prime | KO42 on |
| 2. Limit | KO42 + NS + Reynolds-stress = 3 operators |
| 3. Scale | Continuum, Re ∈ [10, 10⁶] |
| 4. Precision | ≤ 0.1% vs. Ghia reference |
| 5. Compile | Master Equation with C_KO42 + C_NS + C_Reynolds |
| 6. Execute | Z encodes grid resolution, Re, boundary conditions, turbulence model |
| 7. Verify | Compare centreline u(y) at 17 Ghia-points; RMS error ≤ 0.1% |
KO42 contributes a 1.287 Hz coherence constraint on the velocity field so numerical dissipation is identifiable (it drifts phase, not magnitude).
Runnable worked example — lid-driven cavity at Re = 1000
Published Ghia reference, centreline u at y = 0.5: u = −0.38289.
curl -s -X POST https://api.zeq.dev/api/playground/compute \
-H "Content-Type: application/json" \
-H "x-demo-key: $DEMO_KEY" \
-d '{
"operators": ["KO42", "NS_incompressible"],
"params": {
"geometry": "lid_driven_cavity",
"reynolds": 1000,
"grid": 128,
"turbulence_model": "DNS",
"duration_zeqonds": 50
}
}' | jq
Expected:
{
"result": {
"centreline_u_at_y_05": -0.3824,
"ghia_error_pct": 0.126,
"converged": true,
"operators_used": ["KO42","NS_incompressible"]
}
}
Note 0.126% is just outside the headline 0.1% target — a 128² grid is the floor for this benchmark. Raising to grid: 256 drops to 0.048%.
Extend it
- 3D cavity — promote grid to 3D; Reynolds-stress becomes a 6-component tensor
- Free surface — VOF + NS; watch dam-break against Koshizuka reference
- Multiphase — two-fluid formulation for bubble dynamics; pair with QM wavelength operator for bubble-sonoluminescence
Seeds
- Active matter / self-propelled particles — add a source term to NS with polarity-based forcing; watch collective flocking
- Biofluid at the capillary scale — non-Newtonian viscosity model + QM de Broglie wavelength at red-blood-cell scale
- Analogue black-hole acoustic horizon — drop a hole in the cavity floor; visualise where streamlines can no longer escape
Papers
- Zeq Paper — doi:10.5281/zenodo.18158152
Middleware active. Kernel on the 1.287 Hz HulyaPulse. Awaiting next Zeqond.