Smoothed-Particle Hydrodynamics (SPH) is a mesh-free, Lagrangian computational method used in physics engines to simulate fluid flows and deformable continua by discretizing the material into a set of interacting particles. Each particle carries field properties like mass, velocity, and pressure, and the system's state is evolved by solving the governing equations of fluid dynamics through weighted interpolations over neighboring particles using a smoothing kernel function. This approach naturally handles large deformations, free surfaces, and moving boundaries, making it a staple for real-time visual effects and engineering simulations of liquids, gases, and even elastic solids.
Glossary
Smoothed-Particle Hydrodynamics (SPH)

What is Smoothed-Particle Hydrodynamics (SPH)?
A core computational technique within physics engines for simulating fluids and other continuum media without a fixed grid.
Within physics simulation engines for robotics and sim-to-real transfer learning, SPH provides a computationally tractable way to model complex fluid-structure interactions, such as a robot arm stirring a liquid or navigating through water. Its particle-based nature aligns well with parallelized simulation infrastructure for high-performance computing. Key challenges include managing computational cost with many particles and mitigating numerical artifacts like tensile instability, often addressed through variants like Weakly Compressible SPH (WCSPH) or Incompressible SPH (ISPH). It is frequently contrasted with grid-based Eulerian methods and other mesh-free techniques like the Material Point Method (MPM).
Key Characteristics of SPH
Smoothed-Particle Hydrodynamics (SPH) is a Lagrangian, particle-based computational method for simulating fluid flows and deformable continua without a fixed grid. Its core characteristics stem from its mesh-free nature and use of kernel-based interpolation.
Lagrangian Formulation
SPH is a Lagrangian method, meaning the computational elements (particles) move with the fluid flow. This is in contrast to Eulerian methods (like Finite Volume) that use a fixed grid. This characteristic provides several key advantages:
- Natural advection: Convection terms are handled implicitly as particles carry their properties.
- Ease of tracking interfaces: Free surfaces, splashes, and multi-material boundaries are inherently captured without complex interface tracking algorithms.
- Mass conservation: Mass is trivially conserved as it is tied to each particle, a property highly beneficial for long-running simulations of violent flows.
Kernel-Based Interpolation
All field quantities (density, pressure, velocity) in SPH are approximated through kernel interpolation. The value at a particle is a weighted sum of contributions from its neighbors within a smoothing length h. The kernel function (e.g., cubic spline) defines this weighting.
- Smoothing: Creates continuous, differentiable fields from discrete particle data.
- Compact support: The kernel is zero beyond h, making computations local and efficient.
- Derivatives: Spatial derivatives of fields are computed analytically by differentiating the kernel function, avoiding the need for a computational mesh to calculate gradients.
Weakly Compressible Form
The most common SPH formulation for fluids is Weakly Compressible SPH (WCSPH). It assumes the fluid is slightly compressible, and pressure is calculated from density using a simple equation of state, such as Tait's equation.
- Explicit time integration: Makes the method straightforward to implement and parallelize.
- Pressure noise: Can introduce high-frequency numerical noise in the pressure field, often requiring artificial viscosity for stability.
- Speed of sound: Artificially reduced to allow for practical time steps, but this limits the range of density fluctuations that can be accurately modeled.
Incompressible SPH (ISPH)
Incompressible SPH is a more advanced variant that solves a pressure Poisson equation at each time step to enforce a divergence-free velocity field, mimicking true incompressibility.
- Reduced noise: Produces significantly smoother pressure fields compared to WCSPH.
- Increased computational cost: Requires solving a linear system (often with iterative solvers like Conjugate Gradient) at every step.
- Strict density invariance: Enforces incompressibility more accurately, which is critical for applications like microfluidics or detailed hydraulic engineering.
Boundary Handling
A critical challenge in SPH is accurately modeling interactions with solid boundaries. Common techniques include:
- Ghost/Dummy Particles: Stationary particles placed inside and on solid boundaries that exert repulsive forces on fluid particles.
- Dynamic Boundary Particles: Boundary particles that participate fully in the density and pressure summations.
- Analytical Wall Forces: Using kernel functions to integrate contributions from continuous boundary surfaces. Poor boundary handling leads to particle deficiency near walls, causing inaccurate pressure and unnatural fluid behavior like penetration or sticking.
Applications in Robotics & Sim-to-Real
In robotics simulation and Sim-to-Real Transfer Learning, SPH is used to model environmental interactions that are difficult with mesh-based methods.
- Granular materials: Simulating sand, soil, or gravel for excavation and manipulation tasks.
- Fluid manipulation: Training policies for pouring, stirring, or liquid handling.
- Deformable objects: Modeling dough, foam, or biological tissues.
- Coupling with Rigid Bodies: SPH fluids interact with articulated robots, providing realistic force feedback for tasks like underwater manipulation or washing. The particle-based nature can be computationally expensive but offers high visual and physical fidelity for complex, changing topologies.
SPH vs. Other Simulation Methods
A feature and capability comparison of Smoothed-Particle Hydrodynamics against other prominent numerical methods used in physics simulation engines.
| Methodological Feature | Smoothed-Particle Hydrodynamics (SPH) | Finite Element Method (FEM) | Material Point Method (MPM) |
|---|---|---|---|
Core Formulation | Mesh-free, Lagrangian particle method | Mesh-based, Eulerian or Lagrangian | Hybrid Eulerian-Lagrangian (particles on grid) |
Primary Domain | Fluid dynamics, astrophysics, free-surface flows | Structural analysis, solid mechanics, deformable bodies | Extreme material deformation (snow, sand, foam) |
Handles Large Deformation | |||
Mass Conservation | Inherent (particles carry mass) | Requires careful formulation | Inherent (particles carry mass) |
Native Topology Change | |||
Tensile Instability | Prone to instability without correction | Not applicable (handled by mesh) | Mitigated via constitutive models |
Computational Cost (Typical) | O(N) to O(N log N) for neighbor search | O(N^1.5) for linear solvers (depends on mesh) | O(N) for particles, plus grid solve cost |
Parallelization Scalability | High (embarrassingly parallel per particle) | Moderate (limited by mesh/solver coupling) | High (particle phase), Moderate (grid solve) |
Boundary Treatment Complexity | High (requires specialized boundary particles) | Low (boundaries are mesh surfaces) | Moderate (grid handles boundaries) |
Advection Accuracy | Subject to numerical diffusion over time | High (for Lagrangian FEM) | Very High (avoids numerical diffusion) |
Common Use in Robotics Sim | Fluid manipulation, sloshing, granular media | Precise deformable object interaction | Complex environmental interaction (e.g., digging) |
Frequently Asked Questions
Smoothed-Particle Hydrodynamics (SPH) is a foundational mesh-free method in physics simulation engines, enabling the modeling of complex fluid and continuum media behaviors critical for training robust robotic systems in simulation.
Smoothed-Particle Hydrodynamics (SPH) is a mesh-free, Lagrangian computational method used to simulate fluid flows and other continuum media by discretizing the material into a set of interacting particles. It works by approximating field quantities (like density, pressure, and velocity) at any point in space using a weighted average over neighboring particles via a smoothing kernel function. The core governing equations, such as the Navier-Stokes equations, are reformulated into particle-based summations. Each particle carries mass, velocity, and other properties, and forces like pressure and viscosity are computed based on the relative positions and states of its neighbors, allowing the simulation of complex phenomena like splashing, mixing, and free-surface flows without a fixed grid.
Key computational steps in an SPH loop:
- Neighbor Search: For each particle, find all neighboring particles within the support radius of the kernel.
- Density Estimation: Compute the density at each particle by summing the mass contributions of its neighbors, weighted by the kernel.
- Force Computation: Calculate forces (pressure gradient, viscosity, external forces like gravity) based on the estimated densities and velocities.
- Time Integration: Update particle positions and velocities using a numerical integration scheme (e.g., Leapfrog, Verlet).
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Smoothed-Particle Hydrodynamics (SPH) is a foundational technique within physics engines. These related concepts define the broader computational toolkit for simulating physical systems.
Finite Element Method (FEM)
The Finite Element Method (FEM) is a mesh-based numerical technique for simulating deformable bodies and continuum mechanics by discretizing a continuous domain into a mesh of small, interconnected elements. Unlike the mesh-free SPH, FEM solves partial differential equations for stress, strain, and heat transfer over this mesh.
- Primary Use: High-accuracy simulation of structural mechanics, elasticity, and thermal dynamics.
- Contrast with SPH: FEM excels with structured materials and boundary conditions but can struggle with extreme deformations where the mesh becomes distorted, a scenario where SPH's particle-based approach is more robust.
Material Point Method (MPM)
The Material Point Method (MPM) is a hybrid Eulerian-Lagrangian technique designed to simulate materials undergoing extreme deformation and phase changes, such as snow, sand, and fluids. It combines strengths from both SPH and grid-based methods.
- Key Mechanism: Material points (Lagrangian) carry state information (mass, velocity) and interact with a background computational grid (Eulerian) where equations of motion are solved.
- Advantage Over SPH: MPM often provides more stable handling of materials with complex internal friction and plasticity, and avoids SPH's issues with tensile instability in certain conditions.
Position-Based Dynamics (PBD)
Position-Based Dynamics (PBD) is a constraint-based simulation method that directly manipulates particle positions to enforce physical laws, bypassing the explicit calculation of velocities and forces. It is renowned for its stability and speed.
- Primary Use: Real-time simulation of cloth, soft bodies, and fluids in interactive applications like games and virtual prototyping.
- Contrast with SPH: While both are particle-based, PBD is not derived from fluid dynamics equations. It is more artist-controllable and stable for graphics but may be less physically accurate for complex fluid behaviors than SPH.
Computational Fluid Dynamics (CFD)
Computational Fluid Dynamics (CFD) is the broad discipline of using numerical analysis and algorithms to solve and analyze problems involving fluid flows. SPH is one specific Lagrangian method within the CFD spectrum.
- Broader Context: CFD encompasses many approaches, including:
- Grid-based (Eulerian) methods like Finite Volume Method (FVM), which solve flow equations on a fixed grid.
- Particle-based (Lagrangian) methods like SPH.
- Trade-offs: Grid-based CFD is typically more accurate and efficient for many industrial fluid problems, while SPH is favored for problems with free surfaces, moving boundaries, or fragmenting fluids.
Rigid Body Dynamics
Rigid Body Dynamics is the simulation of non-deformable objects whose shape is preserved under the action of forces and torques. It forms the core of most real-time physics engines for simulating solids.
- Core Principles: Governed by Newton-Euler equations, calculating linear and angular acceleration from applied forces and inertia tensors.
- Relation to SPH: In a full physics pipeline, SPH for fluids and Rigid Body Dynamics for solids are coupled. For example, a rigid boat hull (rigid body) interacts with ocean waves (simulated via SPH) through two-way force coupling and contact resolution.
Lagrangian vs. Eulerian Frameworks
This distinction defines the fundamental viewpoint of a simulation, critical for understanding SPH's place among simulation methods.
- Lagrangian Framework: The computational elements (e.g., particles in SPH) move with the material. Properties like density are carried by and updated for each moving particle. Ideal for tracking material history and free surfaces.
- Eulerian Framework: The computational grid is fixed in space, and material flows through it. Properties are evaluated at fixed grid points. Ideal for confined flows and high-velocity simulations.
- SPH's Place: SPH is a purely Lagrangian method, making it inherently suitable for problems where tracking the material itself is paramount.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us