Smoothed-particle hydrodynamics

Also known as: SPH

On this page 7

Smoothed-particle hydrodynamics (SPH) is a meshless, Lagrangian method for simulating fluids in which the liquid is represented by moving particles that each carry mass, velocity and density, and every physical quantity is computed by blending neighboring particles with a smoothing kernel. In 3D graphics & animation, SPH belongs to the Simulation & effects toolkit alongside grid-based and hybrid solvers, and it is used for splashes, viscous goo, lava, mud and any liquid that breaks into many small pieces.

The method was introduced in 1977 for astrophysics, where it modeled gas clouds and stellar collisions, and it later moved into engineering and visual effects. Its appeal for artists is that particles go wherever the fluid goes, so no fixed simulation box limits the motion and thin sheets, droplets and free surfaces arise naturally.

How SPH turns particles into a fluid

SPH approximates a continuous fluid by sampling it at particle positions and reconstructing any field, such as density or pressure, as a weighted sum over neighbors. Each particle looks at others within its smoothing length h, a radius typically set to about two to four times the particle spacing, and the kernel function gives closer neighbors more influence than distant ones.

A simulation step usually follows the same sequence. The solver first runs a neighbor search, commonly with a uniform spatial hash grid, then computes each particle’s density from the masses around it. An equation of state converts the density error into pressure, and pressure gradients, viscosity, surface tension and external forces such as gravity are summed into an acceleration. Finally, the integrator updates velocities and positions and resolves collisions with colliders.

The table below lists the core quantities that an SPH solver tracks and what each one controls in the final look.

QuantityRole in the solverVisible effect
Smoothing lengthRadius of the kernel neighborhoodDetail level and smoothness
Rest densityTarget density the fluid tries to keepOverall volume of the liquid
StiffnessScales pressure from density errorCompressibility and bounciness
ViscosityDamps relative velocity between neighborsWater versus honey behavior
Surface tensionPulls surface particles togetherDroplet formation and thin strands
Time stepLength of one integration stepStability and simulation speed
Core quantities in an SPH solver

Kernels and pressure solvers in SPH

The choice of kernel and pressure solver decides how stable, how incompressible and how fast an SPH simulation is. Kernels are smooth, bell-shaped functions with compact support, meaning they fall to zero at the smoothing length, which keeps the neighbor count bounded at roughly 30 to 60 neighbors in 3D.

Early graphics solvers used a weakly compressible formulation (WCSPH), which computes pressure directly from density with a stiff equation of state. It is simple but needs very small time steps to avoid visible bouncing and volume loss. Modern solvers enforce incompressibility iteratively and allow far larger steps.

SolverHow pressure is foundTypical trade-off
WCSPHDirect equation of stateSimple, but tiny time steps
PCISPHPredict density, correct pressure iterativelyLarger steps, moderate cost
IISPHImplicit pressure equation solved by iterationStable, low compression error
DFSPHSeparate divergence and density correctionsFast and nearly incompressible
Position based fluidsDensity constraints on positionsRobust for games, less physical
Common SPH pressure solvers

In practice, the density error tolerance of an iterative solver, often set between 0.1 and 1 percent, is the most direct control over how much the liquid visibly compresses under its own weight.

SPH compared with grid and hybrid fluid methods

SPH is one of three families used for fluid simulation in production: purely particle-based methods, grid-based Eulerian methods and hybrid particle-grid methods such as FLIP. Each family stores the fluid differently, which shapes what it does well.

Grid solvers measure fluid properties at fixed cells, so incompressibility is enforced precisely, but small details below the cell size are lost. FLIP fluid carries particles through a grid, combining grid pressure accuracy with particle detail, and it dominates large water shots. SPH avoids the grid entirely, which suits unbounded domains and strongly viscous materials.

MethodFluid representationStrengthsWeaknesses
SPHParticles onlyNo domain limits, natural splashesNoisy surfaces, costly neighbors
Eulerian gridValues on fixed cellsAccurate pressure, smoke and fireBounded domain, numerical dissipation
FLIP or APICParticles advected through a gridDetail plus accurate pressureGrid memory, domain bounds
Position based fluidsParticles with constraintsFast and stable in real timeLess physically accurate
SPH versus other fluid simulation approaches

For smoke and fire simulation, grid methods remain the standard, because gases fill space continuously and do not benefit from tracking a free surface with particles.

Using SPH in 3D production

SPH is most useful when a shot needs free-flowing liquid with no fixed bounds or materials whose behavior depends on strong viscosity and cohesion. It appears in dedicated plug-ins, in physics engines for games and in research tools, and several general particle systems implement SPH-style density forces for blobs and goo.

The following decision table summarizes situations where SPH is a good fit and where another solver is the better choice.

SituationRecommended approachReason
Viscous goo, mud or lavaSPH with high viscosityHandles cohesion and stretching well
Liquid poured into open spaceSPHNo simulation box to enlarge
Large ocean or river shotFLIP or ocean simulationGrid pressure scales better
Interactive liquid in a gamePosition based fluidsPredictable cost and stability
Smoke, steam or fireEulerian gridGases fill volume continuously
When to choose SPH

Because SPH output is a point cloud, a separate surface reconstruction step is needed before rendering. Artists convert particles into a signed distance field or mesh, apply smoothing and then render the surface; the simulation cache stores particle data so that meshing can be adjusted without rerunning the solver.

Limitations and common mistakes with SPH

The main weakness of SPH is that accuracy depends on particle count, and a believable liquid often needs millions of particles. Neighbor searches dominate the cost, and a sparse simulation produces lumpy, grainy surfaces even after meshing.

  • Particle deficiency at boundaries causes particles near walls or the free surface to feel too few neighbors, which leads to sticking or clumping unless boundary particles or corrections are used.
  • Tensile instability makes particles clump into pairs under negative pressure, producing an unnatural, string-like texture.
  • Oversized time steps violate the CFL condition, so fast particles jump through colliders or the fluid explodes.
  • Mismatched scene scale changes the effective gravity and viscosity, so a cup of water simulated at building scale looks slow and heavy.
  • Too little substepping on fast collisions lets particles leak through thin geometry; simulation substeps fix this at higher cost.

A frequent misconception is that SPH is inherently more realistic than grid solvers. In fact, basic SPH is slightly compressible, and only careful solver settings bring its volume conservation close to that of a well-configured FLIP simulation.

A plain-language summary

Smoothed-particle hydrodynamics pretends that a liquid is made of a huge crowd of tiny balls. Each ball checks how crowded its neighborhood is. If too many balls are squeezed together, they push apart; if they drift too far, they pull back. Thickness and stickiness are added as extra rules.

Because the balls carry the liquid with them, the water can splash anywhere without hitting the edge of an invisible box. The key idea is that many simple particles following local rules together behave like a real fluid, and the computer later wraps a smooth surface around them so the result looks like liquid instead of sand.

An example from practice

A small studio produces a commercial in which thick caramel pours over a rotating chocolate bar and drips onto a plate. The team chooses an SPH solver because the caramel must stretch into long strands, fold over itself and pile up, behavior that depends on strong viscosity and cohesion.

The artist sets the particle spacing to 0.5 millimeters, which yields about four million particles for a six-second shot, and raises viscosity until the strands hold for roughly half a second before breaking. An iterative solver with a 0.5 percent density tolerance keeps the volume stable, and four substeps per frame prevent particles from passing through the rotating bar.

The particles are cached, converted into a smoothed mesh and rendered with a glossy subsurface material. The final shot shows continuous, glossy strands with no visible graininess, and the lighting team can adjust the meshing radius from the cache without rerunning the eight-hour simulation.