Skip to main content
Sandbox Physics

Fluid dynamics · particle numerics workbench

SPH Free-Surface Splash

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.

Interactive modelSPH Free-Surface Splash
Simulation time tg/Ht\sqrt{g/H}00
Fluid particles NN260260
Bulk density RMS ερ\varepsilon_\rho0%0\%
Mass ledger M/M0M/M_01.0001.000
Acoustic time step ΔtCFL\Delta t_{\mathrm{CFL}}00
Scenario validationxf/H=0x_f/H=0

Physics tutorial

SPH free surfaces: reconstructing a pool from neighbors

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

Focus question
If each particle knows only its nearby neighbors, how can the collection recover pressure, approximate incompressibility, and free-surface motion?
One-sentence intuition
A compact-support kernel turns a discrete neighborhood into a continuous estimate. Raising the numerical sound speed c0c_0 reduces density variation but shortens the stable time step, so greater incompressibility and faster computation compete in WCSPH.

Core mathematical model

SPH density summation

ρi=jmjW ⁣(rirj,h)\rho_i=\sum_j m_j W\!\left(\lVert\boldsymbol r_i-\boldsymbol r_j\rVert,h\right)

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.

Symmetric pressure force and viscosity

dvidt=jmj(piρi2+pjρj2)iWij+ν2vi+g\frac{\mathrm d\boldsymbol v_i}{\mathrm dt}=-\sum_j m_j\left(\frac{p_i}{\rho_i^2}+\frac{p_j}{\rho_j^2}\right)\nabla_i W_{ij}+\nu\nabla^2\boldsymbol v_i+\boldsymbol g

The symmetric pair-pressure term produces forces in pairs. The viscous Laplacian, wall reflection, and cohesion used here are deliberately low-order teaching approximations.

Tait equation of state and acoustic CFL

pi=ρ0c02γ[(ρiρ0)γ1],ΔtChc0+maxivi,γ=7p_i=\frac{\rho_0c_0^2}{\gamma}\left[\left(\frac{\rho_i}{\rho_0}\right)^\gamma-1\right],\qquad \Delta t\leq C\frac{h}{c_0+\max_i\lVert\boldsymbol v_i\rVert},\qquad \gamma=7

The equation of state trades finite compressibility for explicit stepping. A higher numerical sound speed suppresses density error while reducing the allowed time step.

Common difficulties

Particles are not water molecules

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.

A pretty splash is not convergence

Typical misconceptionA plausible crown shape is enough to validate the solver.

Better mental modelInspect the mass ledger, bulk-density error, hydrostatic relation p=ρgdp=\rho g d, free-fall centroid, and sensitivity to particle spacing first. Visual similarity is only the last layer of evidence.

Run the experiment

  1. 01

    See density estimation through a kernel neighborhood

    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.
  2. 02

    Test hydrostatic pressure

    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.
  3. 03

    Expose the sound-speed tradeoff

    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.
  4. 04

    Perform a resolution check

    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.