Smoothed Particle Hydrodynamics represents continuum fields by particles and evaluates field variables, gradients, and divergence operators through local kernel-weighted interactions.
Consider any continuum field variable $\phi(\mathbf{x})$, such as density, pressure, or one velocity component. The value at a target position $\mathbf{x}$ can be written as a weighted integral over the whole domain:
Here, $\delta(\mathbf{x}-\mathbf{x}')$ acts as an ideal weighting function: it assigns zero weight to all positions except $\mathbf{x}'=\mathbf{x}$, where the contribution is concentrated.
This is the key idea: a field value can be represented through a weighted contribution of surrounding field information. The delta function is the limiting case of a perfect selector.
The delta function is not a regular finite-valued function. It is a generalized function with unit integral and infinitely concentrated support at the target point.
The exact identity is mathematically elegant, but it is not directly suitable for numerical continuum mechanics.
Replacing the delta function by a kernel gives the SPH kernel approximation:
The smoothing length $h$ controls the size of the local support domain. A larger $h$ uses more neighboring information and gives a smoother estimate; a smaller $h$ gives a sharper, more local estimate.
The 3D sketch shows the kernel as a positive weight surface. The peak is located at the target particle, and the value decays outward.
Drag the plot to rotate the view. The kernel value is always non-negative and rises upward from the support plane.
After the kernel integral is discretized, the field value at the target particle $a$ is obtained by adding the weighted contribution of each neighboring particle $b$.
The interaction panel explicitly shows the accumulation process: select a particle $b_k$, compute its contribution, and add it to the partial sum.
Blue particles are outside the support; green particles have already been added; orange is the current particle being accumulated.
For a scalar field such as pressure or density, the SPH gradient is obtained by summing the contribution from each neighboring particle.
Each particle contributes a small vector. The final gradient is the vector sum of these local contributions.
The orange arrow is the current vector term; the green arrow is the accumulated gradient at particle $a$.
For velocity divergence, each neighboring particle contributes a scalar obtained by projecting the velocity difference onto the kernel-gradient direction.
If the partial sum is positive, the local particle configuration behaves like expansion; if negative, it behaves like compression.
Velocity arrows are prescribed for illustration; the displayed number shows how each neighbor changes $\nabla\cdot\mathbf{v}_a$.
The same particle-by-particle accumulation is inserted into the Lagrangian Navier–Stokes equations. The continuity equation uses velocity divergence, while the momentum equation uses pressure-gradient and viscous terms.
This panel connects the abstract operators to the actual terms used in the SPH time-marching loop.
In weakly compressible SPH, pressure is not obtained from a Poisson equation. Instead, it is computed from density using an equation of state.
Here, $\rho_0$ is the reference density, $c_0$ is the artificial speed of sound, and $\gamma$ is commonly taken as $7$ for water-like fluids.
This closes the equation system: once $\rho$ is evolved from continuity, $p$ can be calculated, and then the momentum equation can update velocity.
This reconstructs density from the local mass distribution.
This form evolves density according to pairwise velocity differences.
The symmetric form helps preserve pairwise force balance.
This is a common laminar-viscosity form. $\eta^2$ is a small regularization term to avoid singularity.
SPH reconstructs a continuum field from local kernel-weighted particle information.
Gradient and divergence operators are obtained by differentiating the kernel, not the noisy particle field directly.
The discretized continuity equation, EOS, and momentum equation form a closed WCSPH time-marching system.