An optimal complexity spectral method for Navier-Stokes simulations in the ball

Nicolas Boullé, Jonasz Slomka, Alex TownsendarXiv 2021

Abstract

This paper introduces a highly efficient spectral method for simulating incompressible fluid flow within a 3D spherical domain. By integrating Poloidal-Toroidal (PT) decomposition, the Double Fourier Sphere (DFS) method, and the ultraspherical spectral method, the authors achieve a computational complexity of $O(N \log^2 N)$, where $N$ is the number of degrees of freedom. This approach effectively addresses coordinate singularities and incompressibility constraints, enabling high-resolution simulations of generalized Navier-Stokes equations, including those for active fluids, on standard hardware.

Introduction

Simulating fluids in a ball is a classic but difficult problem in computational fluid dynamics (CFD). Standard numerical methods often struggle with three main issues: maintaining the incompressibility constraint, handling coordinate singularities at the poles and the center of the ball, and managing the high computational cost as resolution increases. This paper presents a breakthrough by developing a solver that is both spectrally accurate and fast enough to handle millions of degrees of freedom on a single CPU core.

Furthermore, the authors focus on generalized Navier-Stokes equations. These include higher-order derivatives used to model "active fluids"—complex substances like bacterial suspensions or quantum fluids that have internal energy sources and non-Newtonian behaviors.

Methodology

The researchers combined four key mathematical techniques to achieve an optimal solver:

  • Poloidal-Toroidal (PT) Decomposition: Instead of solving for the 3D velocity vector directly, the flow is decomposed into two scalar fields. This automatically satisfies the incompressibility constraint, reducing the number of variables.
  • Double Fourier Sphere (DFS) Method: This technique maps the ball to a rectangular domain, effectively bypassing coordinate singularities.
  • Ultraspherical Spectral Method: Used for the radial direction, this method represents derivatives as sparse, banded matrices, allowing for linear-time inversion of differential operators.
  • Spherical Harmonics Transform (SHT): By using spherical harmonics as a basis, the angular parts of the equations are decoupled, turning a massive 3D problem into many small, independent 1D problems.

Algorithmic Complexity and Implementation

The core of the solver's efficiency lies in its time-stepping loop and the handling of nonlinear terms. The overall algorithm achieves $O(N \log^2 N)$ complexity, where $N$ is the total number of degrees of freedom. In the context of the provided figures, $n$ represents the linear resolution, such that $N \approx n^3$.

Overview of the time-stepping algorithm and its computational complexity.

As shown in the time-stepping flowchart, the most computationally intensive part is the evaluation of the nonlinear term. This step is broken down into a series of transforms between different bases and physical space to maintain efficiency.

Detailed breakdown of the nonlinear term computation using various transforms.

By choosing the right decomposition and basis, the coupled 3D system is reduced to independent 1D Helmholtz-like equations. The use of the ultraspherical method ensures that the resulting matrices are sparse, which is critical for maintaining speed at high resolutions.

Key Results and Discussion

The authors empirically demonstrated the $O(N \log^2 N)$ scaling. A simulation with 1 million degrees of freedom takes only about 12 seconds per time step on a single Intel Xeon CPU core. The method also exhibits spectral accuracy, with errors decaying to nearly machine precision ($10^{-13}$) as resolution increases, far outperforming standard grid-based methods.

The solver was successfully applied to simulate active fluids that form vortices of specific sizes before reaching a turbulent-like state. While the method is highly efficient, the authors noted long-term instabilities in active fluid simulations, possibly due to boundary conditions or resolution limits for specific physics. Future work will focus on parallelization and testing the method under extreme turbulence (high Reynolds numbers).

Summary updated

BibTeX
@misc{boulle2021optimal,
  author = {Nicolas Boullé and Jonasz Slomka and Alex Townsend},
  title = {{An optimal complexity spectral method for Navier-Stokes simulations in the ball}},
  year = {2021},
  eprint = {2103.16638},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2103.16638},
}
Figure