t = 0.000
Initializing WebGPU…

Cosmology 3D on GPU. N = 100 cubic grid (1 000 000 cells). Compressible Navier–Stokes with self-gravity Poisson Δφ + G·(ρ−ρ̄) = 0 (G = 10, red-black Gauss-Seidel, 1000 sweeps in the initial settle then 1 sweep per fluid step by default), body force ρ∇φ on momentum. Ideal-gas pressure p = γe = ρT (e = ρT), γ adjustable by the slider (default 1, giving effective adiabatic index 1+γ = 2). Artificial viscosity ν = h in proper form dt·ν·Δh/h². Initial state: one central Gaussian mass concentration at rest (ρ = e bump, peak +4, σ = 0.04N, so T = 1), all velocities/momenta/φ = 0. Base artificial viscosity ν = 0.3h, plus a shock-capturing term ν += C·h·|∇·u| that activates in compression: as the lump starts to collapse, the rising velocity gradient ramps the viscosity up, dissipating the inflow and (via the heating term +C·h·|∇·u|·(∇·u)² added to e) converting kinetic energy irreversibly into heat. That heating raises the pressure and halts the collapse even for a soft (small-γ) gas — the 2nd-law / entropy-production mechanism. Outer-box BC frozen; φ Dirichlet-zero.

Display: red particle traces on the mid-plane (reset every t > 0.1); cross-cut profiles along the central line: blue ρ, green T = e/ρ, cyan φ (auto-scaled to its peak each frame).

The GPU shader matches the canvas (cosmology_3d.html) physics with the p5-source bugs fixed: full 3D 7-point Laplacians on all three momentum components, and the e and ρ advection / pressure-work / energy-transfer terms all reconnected.