-
Notifications
You must be signed in to change notification settings - Fork 5
OpenFOAM installation
Piet Jarmatz edited this page Oct 16, 2024
·
4 revisions
- Download Source Code from https://dl.openfoam.com/source/v2206/OpenFOAM-v2206.tgz. Alternatively, for current version do
git clone https://github.com/OpenFOAM/OpenFOAM-dev.git
(see instructions here). - Also download
wget https://dl.openfoam.com/source/v2206/ThirdParty-v2206.tgz
(orgit clone https://github.com/OpenFOAM/ThirdParty-dev.git
) - Unzip OpenFOAM-v2206.tgz eg
$ gunzip OpenFOAM-v2206.tgz
ortar xzf OpenFOAM-v2206.tgz
- Create a folder for the build environment, e.g. in
$HOME
do$ mkdir openfoam
and copy source code files into the new directory - Use
tar xzf ThirdParty-v2206.tgz
to unpack and put files to~/openfoam/OpenFOAM-v2206/ThirdParty
- Source the build environment, e.g.
$ source ~/openfoam/OpenFOAM-v2206/etc/bashrc
. You might want to add this to your personal~/.bashrc
. - Check for system compatibility
$ foamSystemCheck
- Move into the OpenFOAM-v2206 folder and do
$ foam
- 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
.
- To check the installation move into the build folder and again source the build OpenFOAM environment like before
- let OpenFOAM run installation tests by
$ foamInstallationTest
and then$ foamTestTutorial -full incompressible/simpleFoam/pitzDaily
- create build folder in MaMiCo directory
$ mkdir build$
and move into it$ cd build
$ cmake ..
$ ccmake .
- Move to the
BUILD_WITH_OPENFOAM OFF
option with thearrow keys
and change it toON
via theenter
key, then configure and generate viac
g
- If error
The OpenFOAM bashrc is not sourced or OpenFOAM is not installed
is thrown, do$ source ~/openfoam/OpenFOAM-v2206/etc/bashrc
again, the configuration files should now generate