A variable speed of sound formulation for weakly compressible smoothed particle hydrodynamics

Fabian Thiery, Nikolaus A. Adams, Stefan AdamiarXiv 2023 · DOI · arXiv

Abstract

This paper introduces Uniform Compressible SPH (UCSPH), a novel formulation for fluid simulations that dynamically adjusts the artificial speed of sound ($c_s$) throughout a simulation. Traditional Weakly Compressible SPH (WCSPH) relies on a constant $c_s$ chosen for worst-case scenarios, which often leads to computational inefficiency or numerical instability. By allowing $c_s$ to evolve with the flow field, UCSPH achieves up to a 5.5x speedup and significantly improved accuracy. The method's robustness is demonstrated through three benchmarks: a Taylor-Green vortex, a falling droplet impact, and a dam break simulation.

Introduction

In Smoothed Particle Hydrodynamics (SPH), researchers typically choose between two primary approaches: Truly Incompressible SPH (ISPH) and Weakly Compressible SPH (WCSPH). While ISPH is highly accurate, it is computationally expensive due to the need to solve a pressure Poisson equation at every step. WCSPH is generally easier to implement and parallelize but requires the definition of an artificial speed of sound ($c_s$) to maintain stability and limit density variations (typically to less than 1%).

Traditionally, $c_s$ is a constant value determined by the highest expected velocities or pressures in a simulation. This "worst-case" approach is inherently inefficient. If a simulation begins with slow-moving fluid that later accelerates—such as a dam break—a constant $c_s$ is either too low (causing excessive compressibility and instability) or unnecessarily high (forcing extremely small time steps and wasting computational resources). UCSPH addresses this by treating the speed of sound as a temporal variable that adapts to the current state of the flow.

The UCSPH Formulation

The core innovation of UCSPH is the dynamic calculation of the required artificial speed of sound at each time step based on the current maximum velocity ($v_{max}$) and pressure ($p_{max}$) in the flow field. This ensures the fluid remains consistently at the target 1% compressibility limit—a state the authors term "Uniform Compressibility."

Stability and Smoothing

Simply changing the speed of sound abruptly can introduce numerical artifacts, such as artificial pressure shocks. To ensure stability, the UCSPH algorithm incorporates three specific safeguards:

  1. Temporal Smoothing: A "history interval" is used to filter out high-frequency numerical noise, preventing erratic fluctuations in $c_s$.
  2. Rate Limiting: The speed of sound is restricted from changing by more than 1% within a single time step.
  3. Adjustment Thresholds: To avoid unnecessary computations, the value is only updated if the current density variation deviates significantly from the target range (0.8% to 1.0%).

Adaptive Time Stepping

Because the Courant-Friedrichs-Lewy (CFL) condition—which dictates the maximum safe time step—is directly dependent on $c_s$, the ability to lower the speed of sound during calmer phases of a simulation allows the solver to take significantly larger time steps, drastically reducing total wall-clock time.

Experimental Validation

The authors validated UCSPH using three classic fluid dynamics benchmarks, comparing performance and accuracy against standard WCSPH and analytical or experimental data.

Taylor-Green Vortex

In this decaying 2D flow, UCSPH achieved a 5.5x overall speedup. Remarkably, the kinetic energy decay was three orders of magnitude more accurate than standard WCSPH. In the standard approach, numerical noise eventually dominated the simulation, whereas UCSPH maintained physical fidelity by keeping $c_s$ at the lowest permissible level.

Falling Droplet Impact

This case involves a highly unsteady impact of a droplet into a shallow pool. Following the initial impact and subsequent splash, UCSPH dynamically adjusted $c_s$, allowing for time steps 2.4x larger than the constant-speed baseline without sacrificing the complex pressure profiles of the impact.

Dam Break

Simulating a fluid column collapsing and striking a wall, the UCSPH model matched experimental pressure signals and surface profiles closely. The method delivered a 3.2x speedup overall. As the fluid settled toward the end of the simulation, UCSPH utilized time steps 8x larger than the fixed-speed version.

Key Insights

A critical finding of this research is that lowering the speed of sound can actually increase numerical accuracy. In WCSPH, the speed of sound acts as a scaling factor for errors in density summation. By maintaining $c_s$ at the physical minimum required for the 1% compressibility constraint, UCSPH minimizes the "spurious" pressure noise that often degrades SPH results.

Furthermore, UCSPH moves SPH toward a "self-tuning" paradigm. It removes the need for expert intuition or trial-and-error when selecting $c_s$ for new engineering problems, as the algorithm identifies the optimal value on the fly.

Conclusion and Future Work

UCSPH represents a significant step forward in making WCSPH both faster and more user-friendly. While the method requires a user-defined "reference length" ($ ilde{L}$) to determine the smoothing interval, it largely automates the most difficult parameter tuning in SPH. Future research may explore the integration of UCSPH with more sophisticated pressure formulations, such as the Entropically Damped Artificial Compressibility (EDAC) method, or its extension to complex multi-phase flows.

Summary updated

Abstract

We present a Weakly Compressible SPH (WCSPH) formulation with a temporally variable speed of sound. The benefits of a time-varying sound speed formulation and the weaknesses of a constant sound speed formulation are worked out. It is shown how a variable sound speed can improve the performance, accuracy, and applicability of the WCSPH method. In our novel Uniform Compressible SPH (UCSPH) method, the required artificial speed of sound is calculated at each time step based on the current flow field. The method's robustness, performance, and accuracy are demonstrated with three test cases: a Taylor-Green vortex flow, a falling droplet impact, and a dam break. For all showcases, we observe at least similar accuracy as computed with WCSPH at strongly improved computational performance.
BibTeX
@misc{thiery2023variable,
  author = {Fabian Thiery and Nikolaus A. Adams and Stefan Adami},
  title = {{A variable speed of sound formulation for weakly compressible smoothed particle hydrodynamics}},
  year = {2023},
  eprint = {2310.04139},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2310.04139},
  howpublished = {arXiv},
}
Figure