Skip to main content

Framework for studying fluid dynamics with simulations.

Project description

alt:

Supported Python versions

Fluidsim is an extensible framework for studying fluid dynamics with numerical simulations using Python. 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.

Documentation: https://fluidsim.readthedocs.io

Getting started

To try fluidsim without installation: Binder notebook

For a basic installation it should be sufficient to run:

pip install fluidsim [--user]

Add --user flag if you do not have permission to write in the directory of the python executable and you don’t want to / can’t setup a virtual environment or use pyenv or conda.

Installation

To take full advantage of fluidsim, consider installing the following (optional) dependencies and configurations before installing fluidsim. Click on the links to know more:

  1. OpenMPI or equivalent

  2. FFT libraries such as MPI-enabled FFTW (for 2D and 3D solvers) and P3DFFT, PFFT (for 3D solvers) either using a package manager or from source

  3. Python packages fluiddyn mako cython pyfftw pythran mpi4py

  4. A C++11 compiler and BLAS libraries and configure ~/.pythranrc to customize compilation of Pythran extensions

  5. Configure ~/.fluidfft-site.cfg to detect the FFT libraries and install fluidfft

Note: Detailed instructions to install the above dependencies using Anaconda / Miniconda or in a specific operating system such as Ubuntu, macOS etc. can be found here.

You can get the source code from Bitbucket or from the Python Package Index. The development mode is often useful if you intend to modify fluidsim . From the root directory:

python setup.py develop

Tests

After installing fluidsim run the tests to ensure everything works:

fluidsim-test
mpirun -np 2 fluidsim-test

How does it work?

Fluidsim is a HPC code. It is part of the wider project FluidDyn and its pseudospectral solvers rely on the library fluidfft to use very efficient FFT libraries. Fluidfft is written in C++, Cython and Python. Fluidfft and fluidsim take advantage of Pythran, an ahead-of-time compiler which produces very efficient binaries by compiling Python via C++11.

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 complicated analysis or to write a modified solver. Fluidsim can also be used to extend existing solvers with Python interfaces such as Basilisk.

We have created fluidsim to be easy and nice to use and to develop, efficient and robust.

Keywords and ambitions: fluid dynamics research with Python (>=3.6); modular, object-oriented, collaborative, tested and documented, free and open-source software.

License

FluidDyn is distributed under the CeCILL License, a GPL compatible french license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fluidsim-0.3.0.tar.gz (814.3 kB view details)

Uploaded Source

File details

Details for the file fluidsim-0.3.0.tar.gz.

File metadata

  • Download URL: fluidsim-0.3.0.tar.gz
  • Upload date:
  • Size: 814.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.6.6

File hashes

Hashes for fluidsim-0.3.0.tar.gz
Algorithm Hash digest
SHA256 c81b150797069577861dbcf5ae57f7e949d351e31d4162d5ea2b1bc61604d249
MD5 01242af8e54045c8043ad07f39dc2ea9
BLAKE2b-256 c715fea2dd73598c566684b4628748ba580f46a30715785fc5f3dd898a92e405

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page