SPH density summation
The cubic-spline kernel is nonzero only inside a finite support radius. Bulk particles have nearly complete neighborhoods; a free-surface neighborhood is truncated on the air side.
Fluid dynamics · particle numerics workbench
A two-dimensional weakly compressible SPH workbench reconstructs a free surface from moving particles. Six scenarios synchronize the particle field, compact-support kernel, pressure–depth profile, and energy and density-error histories on one scientific canvas.
Physics tutorial
BackgroundSmoothed particle hydrodynamics discretizes a continuum into moving samples carrying mass, position, and velocity. Each particle queries only a finite neighborhood, estimates density with a weighted sum, then advances under pressure gradients, viscosity, and gravity. Where particle coverage ends, a free surface emerges naturally.
Why it mattersDam breaks, sloshing, and droplet impacts all involve violently moving interfaces. A fixed grid needs a separate interface-tracking method, while Lagrangian particles move with the fluid. The price is density noise, boundary error, and a strict explicit time-step limit.
Start with the essentials
The cubic-spline kernel is nonzero only inside a finite support radius. Bulk particles have nearly complete neighborhoods; a free-surface neighborhood is truncated on the air side.
The symmetric pair-pressure term produces forces in pairs. The viscous Laplacian, wall reflection, and cohesion used here are deliberately low-order teaching approximations.
The equation of state trades finite compressibility for explicit stepping. A higher numerical sound speed suppresses density error while reducing the allowed time step.
Typical misconceptionEach blue point in the rendering is one real water molecule.
Better mental modelAn SPH particle represents a finite continuum sample carrying smoothed mass, velocity, and thermodynamic state, not a molecular-scale individual.
Typical misconceptionA plausible crown shape is enough to validate the solver.
Better mental modelInspect the mass ledger, bulk-density error, hydrostatic relation , free-fall centroid, and sensitivity to particle spacing first. Visual similarity is only the last layer of evidence.
Pause the dam break and tap a bulk particle, then a free-surface particle. Compare the support circle in panel A and neighbor count in panel B.
What to observe: The bulk neighborhood is fuller and nearly isotropic. A surface particle lacks neighbors on the air side, producing a boundary deficit in the density sum.Choose Hydrostatic check, reduce viscosity, step forward, and compare particle pressure points with the hydrostatic line in panel C.
What to observe: Pressure generally rises with depth, but particle noise, wall treatment, and free-surface density deficit move the discrete points away from the analytic line.Reset the same scenario at lower and higher numerical sound speeds, then compare bulk-density RMS with the acoustic time-step readout.
What to observe: Higher sound speed generally reduces density fluctuation but demands a shorter time step: the defining computational tradeoff of weakly compressible SPH.Change particle spacing, reset the dam break, and compare front position, density error, and histories at similar simulation times.
What to observe: Particle count, neighborhood sampling, and stable time step all change. If the result drifts strongly with resolution, one splash run is not a reliable prediction.