diffSPH: Differentiable smoothed particle hydrodynamics for hybrid machine learning solutions in fluid mechanics

Read full text
Authors: Rene Winchenbach, Nils Thuerey
Cited by: 1
References: 70

Abstract

We present diffSPH , a novel open-source differentiable Smoothed Particle Hydrodynamics (SPH) framework developed entirely in PyTorch with GPU acceleration. diffSPH is designed centrally around differentiation to facilitate optimization and machine learning (ML) applications in Computational Fluid Dynamics (CFD), including solving inverse problems and the development of hybrid models. Its differentiable SPH core, and schemes for compressible (with shock capturing and multi-phase flows), weakly compressible (with boundary handling and free-surface flows), and incompressible physics, enable a broad range of applications. We demonstrate the framework’s unique capabilities through several applications, including addressing particle shifting via a novel, target-oriented approach by minimizing physical and regularization loss terms, a task often intractable in traditional solvers. Further examples include optimizing initial conditions and physical parameters to match target trajectories, shape optimization, implementing a solver-in-the-loop setup to emulate higher-order integration, and demonstrating gradient propagation through hundreds of simulation steps. Prioritizing readability, usability, flexibility, and extensibility, this work offers a foundational platform for the CFD community to develop and deploy novel neural networks and adjoint optimization applications. Our differentiable SPH framework is available at https://github.com/tum-pbs/diffSPH .

Fields of Study & Subjects

Fluid Dynamics Simulations and Interactions Block Copolymer Self-Assembly Lattice Boltzmann Simulation Studies

Publication details

Journal / source
Journal of Computational Physics
Publisher
Elsevier BV
Volume
555
Pages
114769–114769
Publication date
15 February 2026
Language
EN