The Python package fluidfft provides a common Python API for performing Fast Fourier Transforms (FFT) in sequential, in parallel and on GPU with different FFT libraries (FFTW, P3DFFT, PFFT, cuFFT). fluidfft is a comprehensive FFT framework which allows Python users to easily and efficiently perform FFT and the associated tasks, such as computing linear operators and energy spectra. We describe the architecture of the package composed of C++ and Cython FFT classes, Python "operator" classes and Pythran functions. The package supplies utilities to easily test itself and benchmark the different FFT solutions for a particular case and on a particular machine. We present a performance scaling analysis on three different computing clusters and a microbenchmark showing that fluidfft is an interesting solution to write efficient Python applications using FFT.
FluidDyn is a project to foster open-science and open-source in the fluid dynamics community. It is thought of as a research project to channel open-source dynamics, methods and tools to do science. We propose a set of Python packages forming a framework to study fluid dynamics with different methods, in particular laboratory experiments (package fluidlab), simulations (packages fluidfft, fluidsim and fluidfoam) and data processing (package fluidimage). In the present article, we give an overview of the specialized packages of the project and then focus on the base package called fluiddyn, which contains common code used in the specialized packages. Packages fluidfft and fluidsim are described with greater detail in two companion papers [4, 5]. With the project FluidDyn, we demonstrate that specialized scientific code can be written with methods and good practices of the open-source community. The Mercurial repositories are available in Bitbucket (https://bitbucket.org/fluiddyn/). All codes are documented using Sphinx and Read the Docs, and tested with continuous integration run on Bitbucket Pipelines and Travis. To improve the reuse potential, the codes are as modular as possible, leveraging the simple object-oriented programming model of Python. All codes are also written to be highly efficient, using C++, Cython and Pythran to speedup the performance of critical functions.
A two-dimensional toy model for geophysical turbulence.
The dynamics of irrotational shallow water wave turbulence forced at large scales and dissipated at small scales is investigated. First, we derive the shallow water analogue of the 'four-fifths law' of Kolmogorov turbulence for a third-order structure function involving velocity and displacement increments. Using this relation and assuming that the flow is dominated by shocks, we develop a simple model predicting that the shock amplitude scales as ( d) 1/3 , where is the mean dissipation rate and d the mean distance between the shocks, and that the pth-order displacement and velocity structure functions scale as ( d) p/3 r/d, where r is the separation. Then we carry out a series of forced simulations with resolutions up to 7680 2 , varying the Froude number, F f = ( L f ) 1/3 /c, where L f is the forcing length scale and c is the wave speed. In all simulations a stationary state is reached in which there is a constant spectral energy flux and equipartition between kinetic and potential energy in the constant flux range. The third-order structure function relation is satisfied with a high degree of accuracy. Mean energy is found to scale approximately as E ∼ L f c, and is also dependent on resolution, indicating that shallow water wave turbulence does not fit into the paradigm of a Richardson-Kolmogorov cascade. In all simulations shocks develop, displayed as long thin bands of negative divergence in flow visualisations. The mean distance between the shocks is found to scale as d ∼ F 1/2 f L f . Structure functions of second and higher order are found to scale in good agreement with the model. We conclude that in the weak limit, F f → 0, shocks will become denser and weaker and finally disappear for a finite Reynolds number. On the other hand, for a given F f , no matter how small, shocks will prevail if the Reynolds number is sufficiently large.
The Python package fluidsim is introduced in this article as an extensible framework for Computational Fluid Mechanics (CFD) solvers. It is developed as a part of FluidDyn project [2], an effort to promote opensource and open-science collaboration within fluid mechanics community and intended for both educational as well as research purposes. Solvers in fluidsim are scalable, High-Performance Computing (HPC) codes which are powered under the hood by the rich, scientific Python ecosystem and the Application Programming Interfaces (API) provided by fluiddyn and fluidfft packages [11]. The present article describes the design aspects of fluidsim, which includes use of Python as the main language; focus on the ease of use, reuse and maintenance of the code without compromising performance. The implementation details including optimization methods, modular organization of features and object-oriented approach of using classes to implement solvers are also briefly explained. Currently, fluidsim includes solvers for a variety of physical problems using different numerical methods (including finite-difference methods). However, this metapaper shall dwell only on the implementation and performance of its pseudo-spectral solvers, in particular the two-and three-dimensional Navier-Stokes solvers. We investigate the performance and scalability of fluidsim in a state of the art HPC cluster. Three similar pseudo-spectral CFD codes based on Python (Dedalus, SpectralDNS) and Fortran (NS3D) are presented and qualitatively and quantitatively compared to fluidsim. The source code is hosted at Bitbucket as a Mercurial repository bitbucket.org/fluiddyn/fluidsim and the documentation generated using Sphinx can be read online at fluidsim.readthedocs.io.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.
hi@scite.ai
10624 S. Eastern Ave., Ste. A-614
Henderson, NV 89052, USA
Copyright © 2024 scite LLC. All rights reserved.
Made with 💙 for researchers
Part of the Research Solutions Family.