Fluidsim is a framework for studying fluid dynamics with numerical simulations using Python. It is part of the wider project FluidDyn.
Fluidsim is an object-oriented library to develop solvers (mainly using pseudo-spectral methods) by writing mainly Python code. The result is very efficient even compared to a pure Fortran or C++ code since the time-consuming tasks are performed by optimized compiled functions.
Fluidsim is a HPC code written mostly in Python. It uses the library Fluidfft to use very efficient FFT libraries. Fluidfft is written in C++, Cython and Python. Fluidfft and fluidsim take advantage of Pythran, a static Python compiler which produces very efficient binaries by compiling Python via C++11. Pythran is actually used in Fluidsim through Transonic, which is a new and cool project for HPC with Python.
An advantage of a CFD code written mostly in Python is that to run simulations and analyze the results, the users communicate (possibly interactively) together and with the machine with Python, which is nowadays among the best languages to do these tasks. Moreover, it is much simpler and faster than with pure Fortran or C++ codes to add any complicate analysis or to write a modified solver.
We have created fluidsim to be easy and nice to use and to develop, highly efficient and robust.
Fluidsim is a young package but the list of solvers already implemented (see
fluidsim.solvers) gives a good idea of the versatility of this
framework. However, currently, Fluidsim excels in particular in solving
equations over a periodic space:
- 2d and 3d incompressible Navier-Stokes equations,
- 2d and 3d incompressible Navier-Stokes equations under the Boussinesq approximation (with a buoyancy variable),
- 2d and 3d stratified Navier-Stokes equations under the Boussinesq approximation with constant Brunt-Väisälä frequency,
- 2d one-layer shallow-water equations + modified versions of these equations,
- 2d Föppl-von Kármán equations (elastic thin plate).
Being a framework, Fluidsim can easily be extended in other packages to develop other solvers (see for example the package fluidsim_ocean).
Metapapers and citations
Our metapapers presenting Fluidsim, Fluidfft and the FluidDyn project, have been accepted by the Journal of Open Research Software (JORS). If you use Fluidsim to produce scientific articles, please cite them!
||Base classes for writing solvers|
||Solvers for a variety of physical problems|
||Utilities for FluidSim|
||IPython / Jupyter magic commands|