Own GPU solver, 2026
AuraFlow: a GPU SPH solver for violent free-surface flow
Weakly compressible smoothed-particle hydrodynamics in 2D and 3D, written on NVIDIA Warp and run on a laptop GPU. It is validated against standard dam-break, wave–structure and stream-tunnel benchmarks, differentiable end to end, and fast enough to generate training data for surrogates and reinforcement learning.
Why build a solver
Smoothed-particle hydrodynamics (SPH) handles what mesh-based CFD finds hard: breaking waves, dam breaks, sloshing and impacts, where the free surface folds and splits. I wanted three things existing codes do not give easily: gradients through a whole simulation, many cheap and consistent runs to train surrogates, and a reinforcement-learning loop inside the solver. That meant owning the code.
The first version was in JAX. A benchmark showed NVIDIA Warp running the same kernels 162–375 times faster than the CPU path, so from v0.2 on AuraFlow is a GPU-only Warp engine. Its focus is free-surface and violent flow; external aerodynamics at scale goes to a separate lattice-Boltzmann code.
How I worked: freeze, audit, gate
A solver can look right and be wrong, so I set rules early. Each version is frozen and tagged, then audited
before the next starts. Every validation case has its pass/fail tolerances written in its
validation/README.md before the first run. Since v1.2.2 every run stores a fingerprint of
the gates it started with, so any later change to a gate is flagged automatically. There has been one such
change (the floating-box metric, explained below), and it is logged. A thermal guard keeps the laptop GPU
below 87 °C, which also means long runs are paced by temperature rather than speed.
Why these validation cases
Each case isolates a different part of the solver, so a failure points to one place:
- Lobovsky 2014 dam break (2D): front position, water levels and wall pressures from a well-instrumented experiment. It tests free-surface kinematics and impact loads together.
- SPHERIC Test 2 (3D): the community dam break onto a box. It tests 3D impact on an obstacle, and DualSPHysics runs the same case, which allows a direct speed comparison.
- Cylinder at Re 100 and NACA 0012 in a stream tunnel with inflow and outflow buffers: tests open boundaries and body forces against well-known drag, lift and Strouhal numbers.
- Floating box in waves (Hadžić 2005, SPHERIC Test 12): two-way fluid–structure coupling.
- Taylor–Green vortex and wave flume: viscous decay with no walls, and wave generation, as clean checks of the fluid operator.
What the failures turned out to be
The most useful results came from the cases that failed first. Most were not physics errors:
- The cylinder's Strouhal number was 6 % high at two resolutions. If refining from D/dx 20 to 40 does not move an error, resolution is not the cause. A domain-size study showed the tunnel walls were too close. In a 40 D wide tunnel with a 10 D inlet, drag and Strouhal are both within 2 %.
- A sloshing tank oscillated at 0.88 s with no forcing. Fluid particles had been placed on top of the baffle wall particles. Density re-initialisation then saw about 1300 kg/m³ and kicked the tank into its second mode. Removing fluid within half a particle spacing of walls fixed it.
- Still water slowly gained density under the Riemann scheme. Particle shifting lets the particle volume and the continuity density drift apart. Gentle density re-initialisation (relaxation 0.3) holds the drift at +0.09 %. Several correction terms from the literature were tried first and did not help; they are recorded with their numbers so I do not try them again.
- The floating box's roll looked twice as large as the experiment. The original gate metric counted small wiggles near zero in the measured roll as full cycles. I changed it to a peak-to-peak metric, after seeing results, and logged the change. In v1.2.4, the box's measured moment of inertia (14 kg cm², SPHERIC Test 12) replaced the uniform-density estimate, and the roll error dropped from −22 % to −8 %. One wave gauge still misses its ±10 % gate, so the case scores 5/6.
The open problem: impact pressure peaks
Raw impact peaks in Lobovsky and in sloshing are far above the experimental bands and do not converge with time step. This is a known weakness of single-phase weakly compressible SPH, but “known weakness” is not an explanation, so in v1.2.4 I took it apart. At dx 5 mm the wall pressure sensor (4.2 mm across, smaller than one particle) was dry for 91–98 % of the impact window, and the peak came from a few wet steps. Moving the sampling point one particle spacing into the water keeps the sensor wet (66–99 %) and lowers the four sensor peaks from 51.7/26.1/9.7/5.1 to 35.7/14.1/6.4/3.3 (normalised pressure). The pressure impulse is still too high, so sampling explains part of it, but the water really does overload the wall.
Two causes remain. Switching off the kinematic wall clamp halves the sensor-1 peak (51.7 to 24.1), so the clamp's instant momentum change at first contact contributes. The missing air cushion may contribute too: a two-phase water–air model (after Rezavand et al. 2020) is implemented and passes its unit tests (still water under air matches single phase within 3 %), but its GPU comparison is still running, so I make no claim yet.
Speed against DualSPHysics
Same 3D case (SPHERIC Test 2 at dx 0.01 m), same RTX 3070 Laptop GPU. The schemes differ, so this compares throughput, not identical work.
The speed work was driven by measurement, not guesses: memory reordering bought 7 %, splitting the fluid and wall force passes about 2×, and building the 3D cell list without compaction another 9 % with bit-identical trajectories. One idea, a larger kernel radius in 3D, was rejected because the smaller time step it forces cancelled the gain (net 1.04×).
What the solver is for: learning on top
The point of owning the solver was to use it for learning. The differentiable version gives gradients that agree with finite differences within 5 %, and its forward pass is bit-identical to the production solver. Sixteen small cases run in one batch, each bit-identical to its solo run, for 9.3× throughput. That feeds a Gaussian-process surrogate with conformal intervals and a Transolver-style field surrogate trained on 320 dam breaks (36–47 % better than nearest-neighbour lookup).
For control, after reviewing DRLinSPH, FluidGym and HydroGym, the recipe that worked was SAC acting as a residual on a linear controller, with smoothed sensors and free-surface observations.
On a rotating cylinder at Re 100, SAC trained coarse and fine-tuned at D/dx 20 cut drag by 5.8 % and lift by 50 %. Not everything worked: the published DRLinSPH forced-baffle result was not reproduced (−1.4 % against −68.8 %), and model-based RL, gradient-based policies through the differentiable solver and a multi-agent wave array all missed their targets. I report those alongside the successes.
Current version (v1.2.4, in progress)
v1.2.4 closes gaps against established codes, each as an opt-in feature that leaves existing results unchanged: measured body inertia, hinged and moored floating bodies, a wave paddle driven by Biesel theory or a JONSWAP spectrum (regular-wave flume 4/4: H 0.0387 m for 0.04 m, T 1.203 s for 1.2 s, reflection 0.7 %), active wave absorption, and the two-phase air model. One feature failed: a hysteresis band on the variable-resolution zones did not fix the noise on the zone's side faces and raised pressure noise across the whole run about eightfold, so it is being removed. The unit suite has 151 tests; the version is not yet tagged and the code is not yet public.
Current limits, and the plan to close them
Each limit below has a concrete next step and a check that shows whether it worked, ordered by how much it would change the conclusions.
- Impact pressure peaks. Plan, staged cheapest first: (a) report the pressure impulse, which SPH can converge, next to the raw peak; (b) replace the kinematic wall clamp with a pressure-consistent wall repulsion if the no-clamp runs confirm it matters; (c) finish the two-phase comparison on the GPU. Check: the sensor-1 impulse moves into the experimental band and its grid-convergence study converges.
- Variable-resolution zone edges are rough. Plan: build the vacancy fill for side faces (generators refill empty spots even with no normal flow), then a Taylor gradient term in the interpolation, one change at a time. Check: the edge-noise metric drops on the side faces without raising noise elsewhere, the test the hysteresis band failed.
- One floating-box wave gauge misses its gate. Plan: the miss is in the tail amplitude of the wave group, not in reflections, so wave absorption would not fix it; next is a resolution study of that tail before any physics change. Check: gauge N1 within ±10 %.
- 3D resolution is capped by an 8 GB laptop GPU. Plan: run large 3D cases (sphere wake above Re 100, finer SPHERIC levels) on a single cloud GPU with more memory and no thermal throttling; the code runs there unchanged. Multi-GPU is deliberately not planned, because batching already gives 9.3× throughput for the learning use case.
- v1.2.4 is not finished. Plan: complete the GPU checks for active wave absorption and the air model, decide the defaults from the results, record them in the validation log and tag the version.
- No public code or paper yet. Plan: publish the code with a software paper and a benchmark paper positioned as a free-surface back end for HydroGym-style reinforcement learning, after adding PPO and SAC baselines on standard tasks.
Takeaways
A GPU SPH solver written by one person can match a mature code for speed and pass standard benchmarks, but only because each failure was traced to a cause instead of tuned away. Kinematics, forces on bodies and wave generation are validated. Impact pressure peaks are not, and the evidence so far says part of that is how pressure is sampled and part is real over-loading, with the wall clamp and the missing air as the remaining suspects. The solver is ready to serve as a free-surface back end for reinforcement learning, which is where the next paper is aimed; the main gap there is PPO/SAC baselines on standard tasks.
Lessons learned
- Declare the tolerance before the run, and log any change. One early pressure “near miss” turned out to be a dry sensor. Gate fingerprints keep the one metric change I made visible.
- When an error does not move with resolution, check the set-up. The Strouhal error was the tunnel, the phantom sloshing mode was overlapping particles, and part of the impact peak was where the sensor sat.
- Check the inputs before the model. Using the floating box's measured inertia did more for roll than any numerical change.
- Remove features that fail their test. The hysteresis band sounded reasonable and made things worse, so it is being deleted rather than left switched off.
- Chaotic quantities are not learnable targets. Post-impact pressure varies more between repeated runs than between designs, so the surrogates predict impact time and levels instead.
- Measure before optimising, and respect the hardware. Profiling decided every speed change, and a laptop GPU needs a thermal guard and clean stops, not force-kills.