---
title: "How Neighbors Reconstruct a Splashing Pool Interactive Lab | Sandbox Physics"
description: "How can particles that only sense their neighbors work out the density and pressure of splashing water?"
canonical_url: "https://sandboxphysics.com/labs/sph-free-surface-splash/"
language: "en"
page_type: "lab"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/labs/sph-free-surface-splash/"
last_modified: "2026-10-27"
---

Fluid dynamics · simulating a splash with particles

# SPH Free-Surface Splash

**How can particles that only sense their neighbors work out the density and pressure of splashing water?** Each particle estimates the local density by adding up its nearby neighbors with a smooth weighting function. An equation of state then turns that density into pressure. The water is treated as slightly compressible: giving it a higher artificial sound speed keeps the density closer to constant, but forces smaller time steps.

A two-dimensional, weakly compressible SPH simulation builds a free surface out of moving particles. In six scenarios, the particle field, the compact kernel, the pressure–depth profile and the histories of energy and density error update together on one canvas.

> Interactive simulation: open this page in a web browser to change the parameters and run the model.

This is a two-dimensional weakly compressible SPH teaching model. Density comes from the sum $\rho_i=\sum_j m_j W_{ij}$, and pressure from the Tait form $p_i=B\left[\left(\rho_i/\rho_0\right)^7-1\right]$. Numerical viscosity, simplified walls and an optional numerical cohesion are stated simplifications of the model, so the splash shape is not a high-fidelity engineering prediction.

Physics tutorial

## SPH free surfaces: reconstructing a pool from neighbors

**Background** Smoothed particle hydrodynamics (SPH) splits a fluid into moving particles, each carrying mass, position and velocity. A particle looks only at neighbors within a finite radius, estimates the density from a weighted sum, and then moves under pressure gradients, viscosity and gravity. Where the particles end, a free surface appears on its own.

**Why it matters** Dam breaks, sloshing and droplet impacts all have interfaces that move violently. A fixed grid needs a separate method to track the interface, but Lagrangian particles simply move with the fluid. The price is noisy density, errors at the boundaries and a strict limit on the explicit time step.

Start with the essentials

- **Focus question**: If each particle knows only its nearby neighbors, how do they together produce pressure, nearly incompressible water and the motion of a free surface?
- **One-sentence intuition**: A kernel that is nonzero only over a short range turns a handful of discrete neighbors into a smooth estimate. Raising the numerical sound speed $c_0$ reduces density variation but shortens the stable time step. In weakly compressible SPH (WCSPH), water that compresses less costs more computing time.

### Core mathematical model

#### SPH density summation

$$
\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 within a finite support radius. A particle inside the bulk has neighbors almost all around it; a particle on the free surface has none on the air side, so its neighborhood is cut short.

#### Symmetric pressure force and viscosity

$$
\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 pressure term is symmetric in each pair of particles, so the forces come in pairs. The viscous Laplacian, wall reflection and cohesion used here are deliberately low-order teaching approximations.

#### Tait equation of state and acoustic CFL

$$
p_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 lets the water compress by a finite amount, and in return the simulation can step forward explicitly. A higher numerical sound speed holds down the density error, but it also shrinks the allowed time step.

### Common difficulties

#### Particles are not water molecules

**Typical misconception** Each blue point in the rendering is one real water molecule.

**Better mental model** An SPH particle stands for a small but finite parcel of fluid. It carries a smoothed mass, velocity and thermodynamic state; it is not an individual molecule.

#### A pretty splash is not convergence

**Typical misconception** If the crown-shaped splash looks right, the solver must be correct.

**Better mental model** First check the total mass, the density error in the bulk, the hydrostatic relation $p=\rho g d$, the free-fall motion of the centroid and how much the result changes with particle spacing. Looking right is only the last layer of evidence.

### Run the experiment

1. 01

   #### See how a kernel neighborhood estimates density

   Pause the dam break and tap a bulk particle, then a free-surface particle. Compare the support circle in panel A and the neighbor count in panel B.

   **What to observe:** A bulk particle has neighbors on all sides, spread almost evenly in every direction. A surface particle has none on the air side, so its density sum comes out short at the boundary.

2. 02

   #### Test hydrostatic pressure

   Choose Hydrostatic check, reduce the viscosity, step forward, and compare the particle pressures with the hydrostatic line in panel C.

   **What to observe:** Pressure rises with depth overall, but particle noise, the wall treatment and the low density at the free surface pull the points away from the analytic line.

3. 03

   #### Compare sound speed and time step

   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:** A higher sound speed usually reduces the density fluctuations but needs a shorter time step. This is the central computational tradeoff of weakly compressible SPH.

4. 04

   #### Check the resolution

   Change particle spacing, reset the dam break, and compare front position, density error, and histories at similar simulation times.

   **What to observe:** The particle count, the neighborhood sampling and the stable time step all change together. If the result shifts a lot with resolution, a single splash run is not a reliable prediction.

Physical conclusion

SPH is flexible because it uses local kernel sums over particles that move with the fluid. Its results deserve trust only when the errors from the equation of state, the time step, the boundaries and the resolution stay in view.

Conceptual inspiration: [FluidMotion](http://www.bugman123.com/FluidMotion/index.html). Original simulations and graphics; the model limits are described above.

Fields & matter · Starter path

## From a field to an electron microscope

Map an electric field and steer a charged particle. Then find the electron's wavelength and use electron beams to see a crystal and a surface.

[Start here → **Make an Electric Field Visible** Move the probe around a dipole and check that the field always points downhill on the potential landscape. Observe · 8 min](https://sandboxphysics.com/labs/electric-field/)

1. [1 Make an Electric Field Visible](https://sandboxphysics.com/labs/electric-field/)
2. [2 A Charge Bending through Fields](https://sandboxphysics.com/labs/charged-particle/)
3. [3 Electron Wavelength & Voltage](https://sandboxphysics.com/labs/electron-wavelength/)
4. [4 Electron Diffraction & Reciprocal Space](https://sandboxphysics.com/labs/electron-diffraction/)
5. [5 TEM Bright Field, Dark Field & SAED](https://sandboxphysics.com/labs/tem-mode-selector/)
6. [6 SEM Secondary-Electron Topography](https://sandboxphysics.com/labs/sem-topography/)

[View the full path →](https://sandboxphysics.com/topics/fields-and-matter/#starter-path)
