The source code of OpenFOAM 11 and related third-party software can be downloaded as
tar.gz compressed archive files:
The archive files download with inconvenient file names, so we recommend following the instructions below where they are unpacked immediately into the source directories, which avoids storing the files themselves.
OpenFOAM is developed and tested on Linux, and should work with any recent distribution of GNU/Linux. OpenFOAM-11 and ThirdParty-11 have been tested on the following Linux distributions:
- Ubuntu 18.04LTS (
bionic), 20.04LTS (
focal), 22.04LTS (
jammy), 23.04 (
- OpenSuSE Tumbleweed (June 2023)
Unpacking the Sources
The user should choose a directory location to unpack these files, which will become the installation directory of OpenFOAM. If the installation is for a single user only, or if the user does not have root access to the machine, we would recommend the installation directory is
$HOME/OpenFOAM (i.e. a directory
OpenFOAM in the user’s home directory). If the installer has root permissions and the installation is for more than one user, one of the ‘standard’ locations can be used, e.g.
/opt/OpenFOAM, or just
After the installation directory is chosen (and, if necessary, created), open a terminal window, change into the installation directory and download an unpack the source and third-party archives by copying and pasting the following:
wget -O - http://dl.openfoam.org/source/11 | tar xvz wget -O - http://dl.openfoam.org/third-party/11 | tar xvz
The files unpack to produce directories
ThirdParty-11-version-11, which need to be renamed as follows:
mv OpenFOAM-11-version-11 OpenFOAM-11 mv ThirdParty-11-version-11 ThirdParty-11
Software for Compilation
Follow the instructions for installing Software for Compilation of OpenFOAM for your platform.
Setting Environment Variables
The environment variable settings are contained in files in an
OpenFOAM-11/etc directory in the OpenFOAM release. e.g.
$HOME/OpenFOAM/OpenFOAM-11/etc for the case where the installation is in
The user should configure their system with permanent settings to source the environment. If OpenFOAM is installed in the
$HOME/OpenFOAM directory, the user should:
ksh (if in doubt type
echo $SHELL), source the
etc/bashrc file by adding the following line to the end of your
then type “
source $HOME/.bashrc” in the current terminal window
csh, which can have compatibility issues) source the
etc/cshrc file by adding the following line to the end of your
then type “
source $HOME/.cshrc” in the current terminal window.
When OpenFOAM is installed in an alternative directory, e.g.
/opt, the user should substitute
$HOME/OpenFOAM with the relevant installation location in the lines above.
Installing Third-Party Software
Follow the instructions for installing Third Party Software on your platform.
With the Third Party software installed and environment updated, compile OpenFOAM by going into the
OpenFOAM-11 directory and executing the
Allwmake script. Type
Allwmake -help for options, but the 2 main choices are to compile in serial with
or compile in parallel with all available cores/hyperthreads with:
Serial compilation takes several hours, whereas compilation on 8 cores/threads should take approximately one hour, possibly less, depending on the processor.
Create a project directory within the
$HOME/OpenFOAM directory named
chris-11 for user
chris and OpenFOAM version 11) and create a directory named
run within it, e.g. by typing:
mkdir -p $FOAM_RUN
Copy across the steady-state backward facing step example, generate the mesh with blockMesh and run foamRun with the incompressibleFluid solver module
cd $FOAM_RUN cp -r $FOAM_TUTORIALS/incompressibleFluid/pitzDailySteady . cd pitzDailySteady blockMesh foamRun paraFoam
Refer to the OpenFOAM User Guide to get started.
Reporting Bugs in OpenFOAM
We appreciate that bugs in OpenFOAM are reported so we can fix them. Please refer to the OpenFOAM bugs pages to report bugs.