English

Massively parallel implementation in Python of a pseudo-spectral DNS code for turbulent flows

Mathematical Software 2016-07-05 v1

Abstract

Direct Numerical Simulations (DNS) of the Navier Stokes equations is a valuable research tool in fluid dynamics, but there are very few publicly available codes and, due to heavy number crunching, codes are usually written in low-level languages. In this work a \textasciitilde{}100 line standard scientific Python DNS code is described that nearly matches the performance of pure C for thousands of processors and billions of unknowns. With optimization of a few routines in Cython, it is found to match the performance of a more or less identical solver implemented from scratch in C++. Keys to the efficiency of the solver are the mesh decomposition and three dimensional FFT routines, implemented directly in Python using MPI, wrapped through MPI for Python, and a serial FFT module (both numpy.fft or pyFFTW may be used). Two popular decomposition strategies, slab and pencil, have been implemented and tested.

Keywords

Cite

@article{arxiv.1607.00850,
  title  = {Massively parallel implementation in Python of a pseudo-spectral DNS code for turbulent flows},
  author = {Mikael Mortensen},
  journal= {arXiv preprint arXiv:1607.00850},
  year   = {2016}
}
R2 v1 2026-06-22T14:42:28.683Z