physics.flu-dynSep 24, 2026

CraftSPH: A composable framework for differentiable smoothed particle hydrodynamics implemented in PyTorch

Authors: Gen Matono, Shujiro Fujioka, Mayuko Nishio

Organizations: Graduate student, Graduate School of Science and Technology, University of Tsukuba · Graduate Student, Department of Civil Engineering, Kyushu University · Ph.D., Associate professor, Institute of Systems and Information Engineering, University of Tsukuba

Abstract

Smoothed particle hydrodynamics (SPH) is well suited to large-deformation fluid problems, and the growing use of automatic differentiation in engineering applications has motivated interest in differentiable SPH solvers. In this study, a composable differentiable SPH framework, CraftSPH, has been developed. In CraftSPH, major computational operations are implemented as independent modules that users can combine to construct solvers for different purposes. This design supports high-accuracy discretization and both explicit and implicit computation within a common framework, while allowing individual components to be maintained and extended. Selected numerical operations also support automatic differentiation (AD) for physical-parameter estimation and potential coupling with deep learning models. These capabilities were demonstrated through forward and inverse analyses. Forward analyses using an implicit SPH scheme with high-accuracy discretization showed good agreement with analytical and reference solutions for Poiseuille flow and a rising bubble, while capturing the key experimental trends in two- and three-dimensional dam-break problems. In inverse analyses, explicit and implicit SPH schemes were used to estimate kinematic viscosity in Taylor-Green vortex flow and Reynolds number in lid-driven cavity flow. The results also showed that the choice of operations included in the computational graph affects the computed gradients. Together, these findings demonstrate that CraftSPH enables users to assemble problem-specific solvers for forward and inverse analyses within a common framework.

Explore similar work

CardsList
  1. An End-to-End PyTorch Interface for Differentiable PDE Solvers: A RANS Model-Correction Study

    May 19, 2026Luca Saverio, Michele Alessandro Bucci, Gianmarco Farro +2PDE SolvingDifferentiable Optimization

  2. Physics-integrated neural differentiable modeling for immersed boundary systems

    Mar 17, 2026Chenglin Li, Hang Xu, Jianting Chen +1PDE Surrogate ModelingComputational Fluid Dynamics

  3. Differentiate the Solver, Not the Equation: Reverse-Sweep Adjoints for Block Implicit Simulation

    Aug 9, 2026Lei Shu, Ying Jiang, Kui Wu +3Automatic DifferentiationDifferentiable Programming