Search arXivSearch

arXiv · 2507.21684

diffSPH: Differentiable Smoothed Particle Hydrodynamics for Adjoint Optimization and Machine Learning

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 training neural networks 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 application areas. 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 full simulation steps. Prioritizing readability, usability, and extensibility, this work offers a foundational platform for the CFD community to develop and deploy novel neural networks and adjoint optimization applications.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Rene Winchenbach, Nils Thuerey. 2025-07-29. diffSPH: Differentiable Smoothed Particle Hydrodynamics for Adjoint Optimization and Machine Learning. https://arxiv.org/abs/2507.21684

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related papers

Cross-helicity and chaotic dynamics of full-disc solar magnetic field

Using the results of laboratory experiments and direct numerical simulations, as well as observations of the full-disc solar magnetic field and sunspot number dynamics, it is demonstrated that cross-helicity can dominate the decaying part of the frequency power spectra of the magnetic field generated by a magnetohydrodynamic (MHD) dynamo in chaotic/turbulent swirling flows for sufficiently strong MHD turbulence (including the solar dynamo). The theoretical consideration is based on a Kolmogorov-like phenomenology within the framework of the distributed chaos concept. It is also shown that the solar full-disc magnetic field for the last two solar cycles with weak magnetic activity exhibits deterministic chaotic behavior concentrated around the equator.

physics.flu-dyn

Manifestation of spurious currents and interface regularization in wind turbulence over fast-propagating waves

Accurate simulation of wind turbulence over fast-propagating waves requires interface-capturing methods that suppress numerical artifacts while accurately resolving momentum transfer across the interface. In high wave-age regimes, numerical errors at the air-water interface can reach magnitudes comparable to the physical flow, directly affecting predicted turbulence statistics. This study examines widely used interface-capturing techniques to evaluate how curvature estimation and flux discretization influence wind-wave simulations through the resulting spurious currents and interface regularization. A systematic assessment is performed using static and translating droplet benchmarks, together with solitary and monochromatic wave cases, to identify and quantify the dominant numerical error mechanisms. In addition, comparison with experimental measurements reveals how these primary error sources manifest in coupled wind-wave simulations. These findings clarify the numerical origin of the observed discrepancies and underscore the importance of accurate curvature and flux treatment in high wave-age regimes, without which numerical artifacts risk being misattributed to genuine wind-wave physics.

physics.flu-dyn

A reconfigurable multi-axis cyber-physical framework for multi-regime fluid--structure interaction experiments

Fluid--structure interaction (FSI) experiments are typically built around mechanical dynamics and constraints imposed by the physical apparatus, so changing mass, stiffness, damping, or allowable motion often requires hardware reconfiguration. Here we present a reconfigurable cyber-physical framework in which these properties are instead assigned through software-defined dynamics. The system provides three translational and one rotational degree of freedom, each independently configurable as prescribed, load-responsive, or locked, with operating roles that can also be reassigned during a running experiment. Measured forces and torques are incorporated into real-time virtual dynamic models, while a common supervisory architecture coordinates multi-axis motion, mode switching, synchronized data acquisition, and diagnostic positioning. The prescribed-motion pathway is validated using a pitching hydrofoil by comparison with published thrust and power scaling trends, while the load-responsive pathway is evaluated using an active-heave/passive-pitch benchmark that reproduces the expected frequency-dependent resonant response over the tested conditions. The same platform is then reconfigured for intra-cycle active--passive pitching, coordinated vertical-axis turbine-surrogate motion, force-driven passive surge, and automated multilayer stereoscopic particle image velocimetry. These results demonstrate that distinct FSI boundary conditions and measurement requirements can be implemented within a common motion, sensing, and control architecture. By treating mechanical roles and constraints as software-defined experimental variables, the framework provides a reusable basis for reconfigurable FSI experiments without redesigning the underlying platform for each application.

physics.flu-dyn