Skip to content

OpenFOAM installation

Ruben Horn edited this page Aug 20, 2026 · 5 revisions

Installation of OpenFOAM

This page contains instructions for manually compiling MaMiCo with OpenFOAM.
For convenience, you can use tools/build-couette.py with the option --with-foam to automate this.

Download and Compile Version 2606 (June '26)

  1. Download Source Code from https://dl.openfoam.com/source/v2606/OpenFOAM-v2606.tgz. Alternatively, for current version do git clone https://github.com/OpenFOAM/OpenFOAM-dev.git (see instructions here).
  2. Also download wget https://dl.openfoam.com/source/v2606/ThirdParty-v2606.tar.gz (or git clone https://github.com/OpenFOAM/ThirdParty-dev.git)
  3. Unzip OpenFOAM-v2606.tgz eg $ gunzip OpenFOAM-v2606.tgz or tar xzf OpenFOAM-v2606.tgz
  4. Create a folder for the build environment, e.g. in $HOME do $ mkdir openfoam and copy source code files into the new directory
  5. Use tar xzf ThirdParty-v2606.tar.gz to unpack and put files to ~/openfoam/OpenFOAM-v2606/ThirdParty
  6. Source the build environment, e.g. $ source ~/openfoam/OpenFOAM-v2606/etc/bashrc. You might want to add this to your personal ~/.bashrc.
  7. Check for system compatibility $ foamSystemCheck
  8. Move into the OpenFOAM-v2606 folder and do $ foam
  9. Start compilation process $ ./Allwmake -s -l (-s reduces output, -l records output into a log file) * This Process may take upwards of 4 hours to complete. You may chose to stop the compilation process and continue later with $ ./Allwmake. For faster compilation (parallel), use e.g. ./Allwmake -s -l -q -j 8.

Test Validity of the Installation

  1. To check the installation move into the build folder and again source the build OpenFOAM environment like before
  2. let OpenFOAM run installation tests by $ foamInstallationTestand then $ foamTestTutorial -full incompressible/simpleFoam/pitzDaily

Test OpenFOAM Compatibility with MaMiCo via the CouetteTest Case

  1. create build folder in MaMiCo directory $ mkdir build$ and move into it $ cd build
  2. $ cmake ..
  3. $ ccmake .
  4. Move to the BUILD_WITH_OPENFOAM OFF option with the arrow keys and change it to ON via the enter key, then configure and generate via c g
  5. If error The OpenFOAM bashrc is not sourced or OpenFOAM is not installed is thrown, do $ source ~/openfoam/OpenFOAM-v2606/etc/bashrc again, the configuration files should now generate

Clone this wiki locally