Source pack installa0on of OpenFOAM v3.0+ into RHL
Open CAE Local Study Mee0ng Y. Takagi
Jan. 16, 2016
Download the packages from the official website
Procedure of installa0on
Assump0on: OpenFOAM 3.0.x has already been installed.
1. Download the source packages and extract them. 2. Edit the configura0on/seUng files. 3. Allwmake 4. Test (foamInstallationTest)
Directory configura0on
• Under OpenFOAM-‐v3.0+
• Under ThirdParty-‐v3.0+: Same as 3.0.x
Allwmake* README.md bin/ etc/ pla\orms/ tutorials/ COPYING applica0ons/ doc/ src/ wmake/
Red: make by yourself Blue: generated later
Download the source packages and extract them
• OpenFOAM main source code: A`er downloading,
• OpenFOAM ThirdParty:
• No compiling ThirdParty so`wares.
$ tar zxvf OpenFOAM-‐v3.0+.tgz
$ ln -‐s ThirdParty-‐3.0.1 ThirdParty-‐v3.0+
Edit the configura0on/seUng files
• Edit OpenFOAM-‐v3.0p environment file
$ cd /opt/OpenFOAM-‐v3.0+ $ vi etc/bashrc
# Location of the OpenFOAM installation # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # foamInstall=$HOME/$WM_PROJECT # foamInstall=~$WM_PROJECT foamInstall=/opt/$WM_PROJECT # foamInstall=/usr/local/$WM_PROJECT
#-‐ Compiler location: # foamCompiler= system | ThirdParty (OpenFOAM) foamCompiler=ThirdParty
Edit the configura0on/seUng files
$ vi ../OpenFOAM-‐v3.0+/etc/bashrc
#-‐ Label size: # WM_LABEL_SIZE = 32 | 64 export WM_LABEL_SIZE=64
#-‐ MPI implementation: # WM_MPLIB = SYSTEMOPENMPI | OPENMPI | SYSTEMMPI | \ MPICH | MPICH-‐GM | HPMPI # | MPI | QSMPI | SGIMPI export WM_MPLIB=OPENMPI
Edit the configura0on/seUng files
• Edit OpenFOAM-‐v3.0+ compiler/libraries seUng file
$ vi etc/config/settings.sh
case "${foamCompiler}" in OpenFOAM | ThirdParty) case "$WM_COMPILER" in Gcc | Gcc48) gcc_version=gcc-‐4.8.4 gmp_version=gmp-‐5.1.2 mpfr_version=mpfr-‐3.1.2 mpc_version=mpc-‐1.0.1
Edit the configura0on/seUng files
• Edit CGAL.sh $ vi etc/config/CGAL.sh
# Description # Setup file for CGAL (& boost) include/libraries. # Sourced from OpenFOAM-‐<VERSION>/etc/bashrc #-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐
boost_version=boost_1_58_0 cgal_version=CGAL-‐4.7
Compile the tools/libraries
• Build OpenFOAM:
• A`er the compiling, check it:
$ . /opt/OpenFOAM/OpenFOAM-‐v3.0+/etc/bashrc $ cd /opt/OpenFOAM/OpenFOAM-‐v3.0+/ $ export WM_NCOMPPROCS=4 # depending on your machine $ ./Allwmake
$ . /opt/OpenFOAM/OpenFOAM-‐v3.0+/etc/bashrc $ foamInstallationTest
Compile the tools/libraries
• A`er the compiling, check a tutorial run (pitzDaily):
$ . /opt/OpenFOAM/OpenFOAM-‐3.0.x/etc/bashrc $ mkdir –p $FOAM_RUN $ run $ cp –r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily ./ $ blockMesh $ simpleFoam $ paraFoam
Here we go! Enjoy!
Top Related