Installation From Sources

The most recent pythonFlu sources can be found here


pythonFlu OpenFOAM Python binding requires the following mandatory pre-requisites:

  • Make sure that confFlu (common configuration package) is installed.
  • Make sure that OpenFOAM is installed (tested with 1.4.1-dev, 1.5, 1.6, 1.6-ext, 1.7.0 and 1.7.1 versions).
    Please follow instructions from corresponding INSTALL file to setup OpenFOAM in your environment.
  • Make sure that Python (developement version, with Python.h header file) is installed (tested with 2.4, 2.6.2).
    Please follow instructions from web-site.
  • Make sure that SWIG is installed (tested with 1.3.36 - 1.3.40 ).
    Please follow instructions from web-site.

Then follow the instructions below in order to build and install the pythonFlu.

Basic Installation

The build procedure of the pythonFlu package is based on GNU autoconf and make utilities.
In order to build the module you have to perform the following steps:

  • Start a new shell session (to ensure a clear environment).
  • Go to the source directory :
cd <path to the sources>
  • Modify the provided "" file to adjust to your local environment.
<your favorite editor> ./
  • Source this "" file to define the corresponding configuration environment.
source ./
  • Configuring the build system:

Make sure that after each configuration step the "--- OK ---" message is printed in your console.
To see all applicable configuration options run "./configure —help"
Currently, the following options are available:

  • Source the generated on configure step "bashrc" file to define the corresponding build environment.
source ./bashrc
  • Build and install pythonFlu :
make install

Use "make clean" command to cleanup the build folder.


Before using pythonFlu do not forget to configure OpenFOAM itself

# For OpenCFD's OpenFOAM-1.7.1
source /opt/openfoam171/etc/bashrc 

# For Extended's OpenFOAM-1.6
source /usr/lib/OpenFOAM-1.6-ext/etc/bashrc

Installation check

Import installed pythonFlu kernel library

python -c "from Foam import finiteVolume; print 'ok'"

Note : Install one of the existing pythonFlu based solvers to verify this installation on a more complex test case