From ArchWiki
Jump to: navigation, search

The OpenFOAM® (Open Field Operation and Manipulation) CFD Toolbox is a free, open source CFD software package produced by OpenCFD Ltd. It has a large user base across most areas of engineering and science, from both commercial and academic organisations. OpenFOAM has an extensive range of features to solve anything from complex fluid flows involving chemical reactions, turbulence and heat transfer, to solid dynamics and electromagnetics. It includes tools for meshing, notably snappyHexMesh, a parallelised mesher for complex CAD geometries, and for pre- and post-processing. Almost everything (including meshing, and pre- and post-processing) runs in parallel as standard, enabling users to take full advantage of computer hardware at their disposal.

For more information on OpenFOAM and the OpenFOAM Foundation, please see and respectively.

Basic installation

If you do not plan on doing development tasks with OpenFOAM, there is an updated version of the program available in the AUR package openfoamAUR and git versions openfoam2.4-gitAUR or openfoam3.0-gitAUR. For most users, this will be everything needed to get an installation up and running.

Development installation

For installation of OpenFOAM in a development environment, the process is fairly straight forward on Arch Linux. The basic steps are as follows:

  1. Obtain source files from OpenFOAM
  2. Prepare build directory
  3. Create Preference File and Set Environment Variables for your installation
  4. Compile OpenFOAM sources
  5. Test OpenFOAM installation


Obtain source files

Latest stable release

Tango-view-fullscreen.pngThis article or section needs expansion.Tango-view-fullscreen.png

Reason: TODO (Discuss in Talk:OpenFOAM#)

Environment variables

Paste the following code into your ~/.bashrc file. Whenever you want to run OpenFOAM you just have to type of20x to initialize the environment.

# OpenFOAM Install
alias of20x='source $FOAM_INST_DIR/OpenFOAM-2.0.x/etc/bashrc'



Some things don't work straightforward if you are not using bash. In the case of zsh, you will need the bash-completion package, and add the following to your .zshrc for the OpenFOAM scripts to work.

autoload bashcompinit

Add export FOAM_INST_DIR=/opt/OpenFOAM to your .zshenv and alias ofoam="source ${FOAM_INST_DIR}/OpenFOAM-5.0/etc/bashrc" to your .zshrc.

Paraview not installed

This happens because the dependencies are installed as separate packages, and not in the third-party apps directory of OpenFOAM. Either;

  • Add alias paraFoam='paraFoam -builtin' to your /opt/OpenFOAM/Open-FOAM-X.X/etc/bashrc.
  • For each project, touch `echo "${PWD##*/}"`.foam and then open the touched file from paraview.