High performance Python for direct numerical simulations of turbulent flows
نویسندگان
چکیده
Direct Numerical Simulations (DNS) of the Navier Stokes equations is an invaluable research tool in fluid dynamics. Still, there are few publicly available research codes and, due to the heavy number crunching implied, available codes are usually written in low-level languages such as C/C++ or Fortran. In this paper we describe a pure scientific Python pseudo-spectral DNS code that nearly matches the performance of C++ for thousands of processors and billions of unknowns. We also describe a version optimized through Cython, that is found to match the speed of C++. The solvers are written from scratch in Python, both the mesh, the MPI domain decomposition, and the temporal integrators. The solvers have been verified and benchmarked on the Shaheen supercomputer at the KAUST supercomputing laboratory, and we are able to show very good scaling up to several thousand cores. A very important part of the implementation is the mesh decomposition (we implement both slab and pencil decompositions) and 3D parallel Fast Fourier Transforms (FFT). The mesh decomposition and FFT routines have been implemented in Python using serial FFT routines (either NumPy, pyFFTW or any other serial FFT module), NumPy array manipulations and with MPI communications handled by MPI for Python (mpi4py). We show how we are able to execute a 3D parallel FFT in Python for a slab mesh decomposition using 4 lines of compact Python code, for which the parallel performance on Shaheen is found to be slightly better than similar routines provided through the FFTW library. For a pencil mesh decomposition 7 lines of code is required to execute a transform.
منابع مشابه
Overview of Direct Numerical Simulation of Particle Entrainment in Turbulent Flows
An overview of removal and re-entrainment of particles in turbulent flows is presented. The procedure for the direct numerical simulation (DNS) of the Navier-Stokes equation via a pseudospectral method for simulating the instantaneous fluid velocity field is described. Particle removal mechanisms in turbulent flows in a duct are examined and effects of the near-wall coherent eddies on the parti...
متن کاملAn Optimized Low-Dissipation Monotonicity-Preserving Scheme for Numerical Simulations of High-Speed Turbulent Flows
This paper presents an optimized low-dissipation monotonicity-preserving (MPLD) scheme for numerical simulations of high-speed turbulent flows with shock waves. By using the bandwidth dissipation optimization method (BDOM), the linear dissipation of the original MP scheme of Suresh and Huynh (J. Comput. Phys. 136, 83–99, 1997) is significantly reduced in the newly developed MP-LD scheme. Meanwh...
متن کاملMassively parallel implementation in Python of a pseudo-spectral DNS code for turbulent flows
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 ~100 line standard scientific Python DNS code is described that nearly matches the performance of pure C for thousands of processors an...
متن کاملمدلسازی عددی جریانهای لایهبندی شدهی غیرهمسان با استفاده از مدل آشفتگی صریح جبری تنش رینولدز
Flows of natural hydro-environments are usually turbulent and mostly stratified, like the flows in lakes, reservoirs, estuaries and atmosphere to name a few. In stratified flows due to the buoyancy forces, the turbulent stresses are usually non-isotropic. Therefore the accuracy of the numerical simulations for such flows is highly dependent on the turbulence model and the implementation of non-...
متن کاملAssessment of Turbulent Models in Computation of Strongly Curved Open Channel Flows
Several rigorous turbulent models have been developed in the past years and it can be seen that more research is needed to reach a better understanding of their generality and precision by verifying their applications for distinct hydraulic phenomena; under certain assumptions. This survey evaluates the performance of Standard k-ε, Realizable k-ε, RNG k-ε, k-ω and RSM models in predicting flow ...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
- Computer Physics Communications
دوره 203 شماره
صفحات -
تاریخ انتشار 2016