Author Archives: bjorn

Install OpenFOAM v1706 on CentOS 6.x from source Copy

Download:

mkdir -p /opt/openfoam/v1706
cd /opt/openfoam/v1706
wget https://sourceforge.net/projects/openfoamplus/files/v1706/OpenFOAM-v1706.tgz
wget https://sourceforge.net/projects/openfoamplus/files/v1706/ThirdParty-v1706.tgz

Unpack:

tar -xzvf OpenFOAM-v1706.tgz ;tar -xzvf ThirdParty-v1706.tgz

Edit file OpenFOAM-v1706/etc/bashrc

change FOAM_INST_DIR to
 FOAM_INST_DIR=/opt/openfoam/v1706
and:
export WM_MPLIB=OPENMPI

Load modules

module load gcc/4.8.4            # installation Standalone gcc 4.8.4 with mpc, mpfr and gmp on CentOS 6.x
 module load mpfr/3.1.2 
 module load gmp/5.1.2
 module load mpc/1.0.1

Source bashrc

. ../OpenFOAM-v1612+/etc/bashrc

Compile on many cores if you have

export MAKEFLAGS='-j 60'
export WM_NCOMPPROCS=60

Now compile ThirdParty essentials

first install boost 1.48
yum install boost148 boost148-devel
I have not been able to use the compiled versions of gmp and mpfr...
 yum install gmp-devel mpfr-devel
cd  ThirdParty-v1612+
./Allwmake

Compile ParaView

Install cmake3
yum install cmake3

module load qt/4.8.6       # installation Standalone QT 4.8 installation on Centos
 ./makeParaView -cmake /usr/bin/cmake3
note: paraview need the path to gcc glibc: 
export LD_LIBRARY_PATH=/opt/gcc/4.8.4/lib64:$LD_LIBRARY_PATH

Compile ADIOS parallell IO

wget http://users.nccs.gov/~pnorbert/adios-1.11.0.tar.gz
 tar -xzvf adios-1.11.0.tar.gz
 mv adios-1.11.0 ADIOS-1.11.0
 ./makeADIOS

Compile ccmio

 wget http://portal.nersc.gov/svn/visit/trunk/third_party/libccmio-2.6.1.tar.gz
tar -xzvf libccmio-2.6.1.tar.gz
./makeCCMIO

Compile OpenFOAM

cd ../OpenFOAM-v1706
./Allwmake

Create module file

Create the file: /etc/modulefiles/openfoam/v1706

put the following content in the file

/etc/modulefiles/openfoam/v1706

#%Module1.0####################################################################
##
## openfoam/v1706 modulefile
##
## 
##
proc ModulesHelp { } {
 puts stderr "tSet OpenFOAM v1612+ environment."
}

## Create a whatis file.
module-whatis "Adds OpenFOAM links, aliases and paths"

set home $env(HOME)
set user $env(USER)


set-alias app "cd $FOAM_APP"
#set-alias foam3rdParty "cd $WM_THIRD_PARTY_DIR"
#set-alias foamApps "cd $FOAM_APP"
set-alias foam "cd $WM_PROJECT_DIR"
set-alias foamfv "cd $FOAM_SRC/finiteVolume"
set-alias foamSite "cd $WM_PROJECT_INST_DIR/site"
set-alias foamSol "cd $FOAM_SOLVERS"
set-alias foamsrc "cd $FOAM_SRC/$WM_PROJECT"
set-alias foamTuts "cd $FOAM_TUTORIALS"
set-alias foamUtils "cd $FOAM_UTILITIES"
set-alias lib "cd $FOAM_LIBBIN"
set-alias run "cd $FOAM_RUN"
set-alias sol "cd $FOAM_SOLVERS"
set-alias src "cd $FOAM_SRC"
set-alias tut "cd $FOAM_TUTORIALS"
set-alias util "cd $FOAM_UTILITIES"
#set-alias wm32 "wmSET WM_ARCH_OPTION "32""
#set-alias wm64 "wmSET WM_ARCH_OPTION "64""
set-alias wmDP "wmSET WM_PRECISION_OPTION "DP""
set-alias wmREFRESH "wmSET $FOAM_SETTINGS"
set-alias wmSchedOFF "unset WM_SCHEDULER"
set-alias wmSchedON "export WM_SCHEDULER $WM_PROJECT_DIR/wmake/wmakeScheduler"
set-alias wmSET ". $WM_PROJECT_DIR/etc/bashrc"
set-alias wmSP "wmSET WM_PRECISION_OPTION "SP""
set-alias wmUNSET ". $WM_PROJECT_DIR/etc/config.sh/unset"

set-alias cc "/opt/gcc/4.8.4/bin/gcc"
set-alias wmInt32 "wmSet WM_LABEL_SIZE "32""
set-alias wmInt64 "wmSet WM_LABEL_SIZE "64""

prepend-path PATH "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/gperftools-2.5/bin:/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/ParaView-5.0.1/bin:/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/openmpi-1.10.4/bin:$home/OpenFOAM/$user-v1612+/platforms/linux64GccDPInt32Opt/bin:/opt/openfoam/v1612+/site/v1612+/platforms/linux64GccDPInt32Opt/bin:/opt/openfoam/v1612+/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/bin:/opt/openfoam/v1612+/OpenFOAM-v1612+/bin:/opt/openfoam/v1612+/OpenFOAM-v1612+/wmake:/opt/qt/4.8.6/bin:/opt/cmake/2.8.12.2/bin:/opt/gcc/4.8.4/bin"
prepend-path LD_LIBRARY_PATH "/opt/gcc/4.8.4/lib64:/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/fftw-3.3.5/lib64:/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/CGAL-4.9/lib64:/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/boost_1_62_0/lib64:/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/gperftools-2.5/lib64:/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/ParaView-5.0.1/lib/paraview-5.0:/opt/openfoam/v1612+/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/lib/openmpi-1.10.4:/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64GccDPInt32/lib/openmpi-1.10.4:/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/openmpi-1.10.4/lib64:$home/OpenFOAM/$user-v1612+/platforms/linux64GccDPInt32Opt/lib:/opt/openfoam/v1612+/site/v1612+/platforms/linux64GccDPInt32Opt/lib:/opt/openfoam/v1612+/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/lib:/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64GccDPInt32/lib:/opt/openfoam/v1612+/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/lib/dummy:/opt/qt/4.8.6/lib:/opt/mpc/1.0.1/lib:/opt/gmp/5.1.2/lib:/opt/mpfr/3.1.2/lib:/opt/gcc/4.8.4/lib"
prepend-path MANPATH "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/openmpi-1.10.4/share/man:/opt/gcc/4.8.4/share/man:"

setenv BOOST_ARCH_PATH "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/boost_1_62_0"
setenv CGAL_ARCH_PATH "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/CGAL-4.9"
setenv CMAKE_ROOT_DIR "/opt/cmake/2.8.12.2"
setenv CPLUS_INCLUDE_PATH "/opt/mpc/1.0.1/include:/opt/gmp/5.1.2/include:/opt/mpfr/3.1.2/include:/opt/gcc/4.8.4/include"
setenv CPPFLAGS "-I/opt/mpc/1.0.1/include:-I/opt/gmp/5.1.2/include:-I/opt/mpfr/3.1.2/include:-L/opt/gcc/4.8.4/lib:-I/opt/gcc/4.8.4/include"
setenv FFTW_ARCH_PATH "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/fftw-3.3.5"
setenv FOAM_APPBIN "/opt/openfoam/v1612+/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/bin"
setenv FOAM_APP "/opt/openfoam/v1612+/OpenFOAM-v1612+/applications"
setenv FOAM_ETC "/opt/openfoam/v1612+/OpenFOAM-v1612+/etc"
setenv FOAM_EXT_LIBBIN "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64GccDPInt32/lib"
setenv FOAM_INST_DIR "/opt/openfoam/v1612+"
setenv FOAM_JOB_DIR "/opt/openfoam/v1612+/jobControl"
setenv FOAM_LIBBIN "/opt/openfoam/v1612+/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/lib"
setenv FOAM_MPI "openmpi-1.10.4"
setenv FOAM_RUN "$home/OpenFOAM/$user-v1612+/run"
setenv FOAM_SETTINGS ""
setenv FOAM_SIGFPE ""
setenv FOAM_SITE_APPBIN "/opt/openfoam/v1612+/site/v1612+/platforms/linux64GccDPInt32Opt/bin"
setenv FOAM_SITE_LIBBIN "/opt/openfoam/v1612+/site/v1612+/platforms/linux64GccDPInt32Opt/lib"
setenv FOAM_SOLVERS "/opt/openfoam/v1612+/OpenFOAM-v1612+/applications/solvers"
setenv FOAM_SRC "/opt/openfoam/v1612+/OpenFOAM-v1612+/src"
setenv FOAM_TUTORIALS "/opt/openfoam/v1612+/OpenFOAM-v1612+/tutorials"
setenv FOAM_USER_APPBIN "$home/OpenFOAM/$user-v1612+/platforms/linux64GccDPInt32Opt/bin"
setenv FOAM_USER_LIBBIN "$home/OpenFOAM/$user-v1612+/platforms/linux64GccDPInt32Opt/lib"
setenv FOAM_UTILITIES "/opt/openfoam/v1612+/OpenFOAM-v1612+/applications/utilities"
setenv GMP_INCLUDE_DIR "/opt/gmp/5.1.2/include"
setenv GMP_LIBRARIES "/opt/gmp/5.1.2/lib"
setenv LIBS "-L/opt/mpc/1.0.1/lib:-L/opt/gmp/5.1.2/lib:-L/opt/mpfr/3.1.2/lib"
setenv MAKEFLAGS "-j 60"
setenv MPFR_INCLUDE_DIR "/opt/mpfr/3.1.2/include"
setenv MPFR_LIBRARIES "/opt/mpfr/3.1.2/lib"
setenv MPI_ARCH_PATH "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/openmpi-1.10.4"
setenv MPI_BUFFER_SIZE "20000000"
setenv OPAL_PREFIX "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/openmpi-1.10.4"
setenv ParaView_DIR "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/ParaView-5.0.1"
setenv ParaView_INCLUDE_DIR "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/ParaView-5.0.1/include/paraview-5.0"
setenv PV_PLUGIN_PATH "/opt/openfoam/v1612+/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/lib/paraview-5.0"
setenv QT4_ROOT_DIR "/opt/qt/4.8.6"
setenv QT_BIN_DIR "/opt/qt/4.8.6/bin"
setenv QTDIR "/opt/qt/4.8.6"
setenv QTINC "/opt/qt/4.8.6/include"
setenv QTLIB "/opt/qt/4.8.6/lib"
setenv QT_PLUGIN_PATH "/opt/qt/4.8.6/plugins"
setenv SCOTCH_ARCH_PATH "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64GccDPInt32/scotch_6.0.3"
setenv WM_ARCH "linux64"
setenv WM_ARCH_OPTION "64"
setenv WM_CC "gcc"
setenv WM_CFLAGS "-m64 -fPIC"
setenv WM_COMPILE_OPTION "Opt"
setenv WM_COMPILER "Gcc"
setenv WM_COMPILER_LIB_ARCH "64"
setenv WM_COMPILER_TYPE "system"
setenv WM_CXXFLAGS "-m64 -fPIC -std "c++0x""
setenv WM_CXX "g++"
setenv WM_DIR "/opt/openfoam/v1612+/OpenFOAM-v1612+/wmake"
setenv WM_LABEL_OPTION "Int32"
setenv WM_LABEL_SIZE "32"
setenv WM_LDFLAGS "-m64"
setenv WM_LINK_LANGUAGE "c++"
setenv WM_MPLIB "OPENMPI"
setenv WM_NCOMPPROCS "60"
setenv WM_OPTIONS "linux64GccDPInt32Opt"
setenv WM_OSTYPE "POSIX"
setenv WM_PRECISION_OPTION "DP"
setenv WM_PROJECT_DIR "/opt/openfoam/v1612+/OpenFOAM-v1612+"
setenv WM_PROJECT_INST_DIR "/opt/openfoam/v1612+"
setenv WM_PROJECT "OpenFOAM"
setenv WM_PROJECT_USER_DIR "$home/OpenFOAM/$user-v1612+"
setenv WM_PROJECT_VERSION "v1612+"
setenv WM_THIRD_PARTY_DIR "/opt/openfoam/v1612+/ThirdParty-v1612+"

The ugly compilation of foamMeshToMED

I want to test Code Saturne. Then it would be nice to use OpenFOAM meshes. This i how I did

first install
Build OpenFOAM 3.0.0 on CentOS 6.6and
Install Salome-Platform on CentOS
then download foamMeshToMED

to create an compilation environment:

module load openfoam/3.0.0
. /opt/salome/7.3.0/env_build.sh
as root: ln -s /opt/salome/7.3.0/med-3.0.7/lib/libmedC.so /usr/lib64/
export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/opt/salome/7.3.0/med-3.0.7/include/
export LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/salome/7.3.0/med-3.0.7/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/salome/7.3.0/med-3.0.7/lib

then

wmake

to use it just do:

module load openfoam/3.0.0
. /opt/salome/7.3.0/env_build.sh

Install OpenFOAM v1706 on CentOS 6.x from source

Download:

mkdir -p /opt/openfoam/v1706
cd /opt/openfoam/v1706
wget https://sourceforge.net/projects/openfoamplus/files/v1706/OpenFOAM-v1706.tgz
wget https://sourceforge.net/projects/openfoamplus/files/v1706/ThirdParty-v1706.tgz

Unpack:

tar -xzvf OpenFOAM-v1706.tgz ;tar -xzvf ThirdParty-v1706.tgz

Edit file OpenFOAM-v1706/etc/bashrc

change FOAM_INST_DIR to
 FOAM_INST_DIR=/opt/openfoam/v1706
and:
export WM_MPLIB=OPENMPI

Load modules

module load gcc/4.8.4            # installation Standalone gcc 4.8.4 with mpc, mpfr and gmp on CentOS 6.x
 module load mpfr/3.1.2 
 module load gmp/5.1.2
 module load mpc/1.0.1

Source bashrc

. ../OpenFOAM-v1612+/etc/bashrc

Compile on many cores if you have

export MAKEFLAGS='-j 60'
export WM_NCOMPPROCS=60

Now compile ThirdParty essentials

first install boost 1.48
yum install boost148 boost148-devel
I have not been able to use the compiled versions of gmp and mpfr...
 yum install gmp-devel mpfr-devel
cd  ThirdParty-v1612+
./Allwmake

Compile ParaView

Install cmake3
yum install cmake3

module load qt/4.8.6       # installation Standalone QT 4.8 installation on Centos
 ./makeParaView -cmake /usr/bin/cmake3
note: paraview need the path to gcc glibc: 
export LD_LIBRARY_PATH=/opt/gcc/4.8.4/lib64:$LD_LIBRARY_PATH

Compile ADIOS parallell IO

wget http://users.nccs.gov/~pnorbert/adios-1.11.0.tar.gz
 tar -xzvf adios-1.11.0.tar.gz
 mv adios-1.11.0 ADIOS-1.11.0
 ./makeADIOS

Compile ccmio

 wget http://portal.nersc.gov/svn/visit/trunk/third_party/libccmio-2.6.1.tar.gz
tar -xzvf libccmio-2.6.1.tar.gz
./makeCCMIO

Compile OpenFOAM

cd ../OpenFOAM-v1706
./Allwmake

Create module file

Create the file: /etc/modulefiles/openfoam/v1706

put the following content in the file

/etc/modulefiles/openfoam/v1706

#%Module1.0####################################################################
##
## openfoam/v1706 modulefile
##
## 
##
proc ModulesHelp { } {
 puts stderr "tSet OpenFOAM v1612+ environment."
}

## Create a whatis file.
module-whatis "Adds OpenFOAM links, aliases and paths"

set home $env(HOME)
set user $env(USER)


set-alias app "cd $FOAM_APP"
#set-alias foam3rdParty "cd $WM_THIRD_PARTY_DIR"
#set-alias foamApps "cd $FOAM_APP"
set-alias foam "cd $WM_PROJECT_DIR"
set-alias foamfv "cd $FOAM_SRC/finiteVolume"
set-alias foamSite "cd $WM_PROJECT_INST_DIR/site"
set-alias foamSol "cd $FOAM_SOLVERS"
set-alias foamsrc "cd $FOAM_SRC/$WM_PROJECT"
set-alias foamTuts "cd $FOAM_TUTORIALS"
set-alias foamUtils "cd $FOAM_UTILITIES"
set-alias lib "cd $FOAM_LIBBIN"
set-alias run "cd $FOAM_RUN"
set-alias sol "cd $FOAM_SOLVERS"
set-alias src "cd $FOAM_SRC"
set-alias tut "cd $FOAM_TUTORIALS"
set-alias util "cd $FOAM_UTILITIES"
#set-alias wm32 "wmSET WM_ARCH_OPTION "32""
#set-alias wm64 "wmSET WM_ARCH_OPTION "64""
set-alias wmDP "wmSET WM_PRECISION_OPTION "DP""
set-alias wmREFRESH "wmSET $FOAM_SETTINGS"
set-alias wmSchedOFF "unset WM_SCHEDULER"
set-alias wmSchedON "export WM_SCHEDULER $WM_PROJECT_DIR/wmake/wmakeScheduler"
set-alias wmSET ". $WM_PROJECT_DIR/etc/bashrc"
set-alias wmSP "wmSET WM_PRECISION_OPTION "SP""
set-alias wmUNSET ". $WM_PROJECT_DIR/etc/config.sh/unset"

set-alias cc "/opt/gcc/4.8.4/bin/gcc"
set-alias wmInt32 "wmSet WM_LABEL_SIZE "32""
set-alias wmInt64 "wmSet WM_LABEL_SIZE "64""

prepend-path PATH "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/gperftools-2.5/bin:/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/ParaView-5.0.1/bin:/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/openmpi-1.10.4/bin:$home/OpenFOAM/$user-v1612+/platforms/linux64GccDPInt32Opt/bin:/opt/openfoam/v1612+/site/v1612+/platforms/linux64GccDPInt32Opt/bin:/opt/openfoam/v1612+/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/bin:/opt/openfoam/v1612+/OpenFOAM-v1612+/bin:/opt/openfoam/v1612+/OpenFOAM-v1612+/wmake:/opt/qt/4.8.6/bin:/opt/cmake/2.8.12.2/bin:/opt/gcc/4.8.4/bin"
prepend-path LD_LIBRARY_PATH "/opt/gcc/4.8.4/lib64:/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/fftw-3.3.5/lib64:/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/CGAL-4.9/lib64:/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/boost_1_62_0/lib64:/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/gperftools-2.5/lib64:/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/ParaView-5.0.1/lib/paraview-5.0:/opt/openfoam/v1612+/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/lib/openmpi-1.10.4:/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64GccDPInt32/lib/openmpi-1.10.4:/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/openmpi-1.10.4/lib64:$home/OpenFOAM/$user-v1612+/platforms/linux64GccDPInt32Opt/lib:/opt/openfoam/v1612+/site/v1612+/platforms/linux64GccDPInt32Opt/lib:/opt/openfoam/v1612+/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/lib:/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64GccDPInt32/lib:/opt/openfoam/v1612+/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/lib/dummy:/opt/qt/4.8.6/lib:/opt/mpc/1.0.1/lib:/opt/gmp/5.1.2/lib:/opt/mpfr/3.1.2/lib:/opt/gcc/4.8.4/lib"
prepend-path MANPATH "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/openmpi-1.10.4/share/man:/opt/gcc/4.8.4/share/man:"

setenv BOOST_ARCH_PATH "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/boost_1_62_0"
setenv CGAL_ARCH_PATH "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/CGAL-4.9"
setenv CMAKE_ROOT_DIR "/opt/cmake/2.8.12.2"
setenv CPLUS_INCLUDE_PATH "/opt/mpc/1.0.1/include:/opt/gmp/5.1.2/include:/opt/mpfr/3.1.2/include:/opt/gcc/4.8.4/include"
setenv CPPFLAGS "-I/opt/mpc/1.0.1/include:-I/opt/gmp/5.1.2/include:-I/opt/mpfr/3.1.2/include:-L/opt/gcc/4.8.4/lib:-I/opt/gcc/4.8.4/include"
setenv FFTW_ARCH_PATH "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/fftw-3.3.5"
setenv FOAM_APPBIN "/opt/openfoam/v1612+/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/bin"
setenv FOAM_APP "/opt/openfoam/v1612+/OpenFOAM-v1612+/applications"
setenv FOAM_ETC "/opt/openfoam/v1612+/OpenFOAM-v1612+/etc"
setenv FOAM_EXT_LIBBIN "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64GccDPInt32/lib"
setenv FOAM_INST_DIR "/opt/openfoam/v1612+"
setenv FOAM_JOB_DIR "/opt/openfoam/v1612+/jobControl"
setenv FOAM_LIBBIN "/opt/openfoam/v1612+/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/lib"
setenv FOAM_MPI "openmpi-1.10.4"
setenv FOAM_RUN "$home/OpenFOAM/$user-v1612+/run"
setenv FOAM_SETTINGS ""
setenv FOAM_SIGFPE ""
setenv FOAM_SITE_APPBIN "/opt/openfoam/v1612+/site/v1612+/platforms/linux64GccDPInt32Opt/bin"
setenv FOAM_SITE_LIBBIN "/opt/openfoam/v1612+/site/v1612+/platforms/linux64GccDPInt32Opt/lib"
setenv FOAM_SOLVERS "/opt/openfoam/v1612+/OpenFOAM-v1612+/applications/solvers"
setenv FOAM_SRC "/opt/openfoam/v1612+/OpenFOAM-v1612+/src"
setenv FOAM_TUTORIALS "/opt/openfoam/v1612+/OpenFOAM-v1612+/tutorials"
setenv FOAM_USER_APPBIN "$home/OpenFOAM/$user-v1612+/platforms/linux64GccDPInt32Opt/bin"
setenv FOAM_USER_LIBBIN "$home/OpenFOAM/$user-v1612+/platforms/linux64GccDPInt32Opt/lib"
setenv FOAM_UTILITIES "/opt/openfoam/v1612+/OpenFOAM-v1612+/applications/utilities"
setenv GMP_INCLUDE_DIR "/opt/gmp/5.1.2/include"
setenv GMP_LIBRARIES "/opt/gmp/5.1.2/lib"
setenv LIBS "-L/opt/mpc/1.0.1/lib:-L/opt/gmp/5.1.2/lib:-L/opt/mpfr/3.1.2/lib"
setenv MAKEFLAGS "-j 60"
setenv MPFR_INCLUDE_DIR "/opt/mpfr/3.1.2/include"
setenv MPFR_LIBRARIES "/opt/mpfr/3.1.2/lib"
setenv MPI_ARCH_PATH "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/openmpi-1.10.4"
setenv MPI_BUFFER_SIZE "20000000"
setenv OPAL_PREFIX "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/openmpi-1.10.4"
setenv ParaView_DIR "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/ParaView-5.0.1"
setenv ParaView_INCLUDE_DIR "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/ParaView-5.0.1/include/paraview-5.0"
setenv PV_PLUGIN_PATH "/opt/openfoam/v1612+/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/lib/paraview-5.0"
setenv QT4_ROOT_DIR "/opt/qt/4.8.6"
setenv QT_BIN_DIR "/opt/qt/4.8.6/bin"
setenv QTDIR "/opt/qt/4.8.6"
setenv QTINC "/opt/qt/4.8.6/include"
setenv QTLIB "/opt/qt/4.8.6/lib"
setenv QT_PLUGIN_PATH "/opt/qt/4.8.6/plugins"
setenv SCOTCH_ARCH_PATH "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64GccDPInt32/scotch_6.0.3"
setenv WM_ARCH "linux64"
setenv WM_ARCH_OPTION "64"
setenv WM_CC "gcc"
setenv WM_CFLAGS "-m64 -fPIC"
setenv WM_COMPILE_OPTION "Opt"
setenv WM_COMPILER "Gcc"
setenv WM_COMPILER_LIB_ARCH "64"
setenv WM_COMPILER_TYPE "system"
setenv WM_CXXFLAGS "-m64 -fPIC -std "c++0x""
setenv WM_CXX "g++"
setenv WM_DIR "/opt/openfoam/v1612+/OpenFOAM-v1612+/wmake"
setenv WM_LABEL_OPTION "Int32"
setenv WM_LABEL_SIZE "32"
setenv WM_LDFLAGS "-m64"
setenv WM_LINK_LANGUAGE "c++"
setenv WM_MPLIB "OPENMPI"
setenv WM_NCOMPPROCS "60"
setenv WM_OPTIONS "linux64GccDPInt32Opt"
setenv WM_OSTYPE "POSIX"
setenv WM_PRECISION_OPTION "DP"
setenv WM_PROJECT_DIR "/opt/openfoam/v1612+/OpenFOAM-v1612+"
setenv WM_PROJECT_INST_DIR "/opt/openfoam/v1612+"
setenv WM_PROJECT "OpenFOAM"
setenv WM_PROJECT_USER_DIR "$home/OpenFOAM/$user-v1612+"
setenv WM_PROJECT_VERSION "v1612+"
setenv WM_THIRD_PARTY_DIR "/opt/openfoam/v1612+/ThirdParty-v1612+"

Install OpenFOAM-dev on CentOS 6.x from source

Download:

mkdir -p /opt/openfoam/dev
cd /opt/openfoam/dev

git clone git://github.com/OpenFOAM/OpenFOAM-dev.git
git clone git://github.com/OpenFOAM/ThirdParty-dev.git

Edit file OpenFOAM-dev/etc/bashrc

change FOAM_INST_DIR to
 FOAM_INST_DIR=/opt/openfoam/dev
and:
export WM_MPLIB=OPENMPI

Load modules

module load gcc/4.8.4            # installation Standalone gcc 4.8.4 with mpc, mpfr and gmp on CentOS 6.x
 module load mpfr/3.1.2 
 module load gmp/5.1.2
 module load mpc/1.0.1 
 module load cmake/2.8.12.2  # installation Standalone cmake 2.8 on CentOS

Source bashrc

. ../OpenFOAM-v1612+/etc/bashrc

Compile on many cores if you have

export MAKEFLAGS='-j 60'
export WM_NCOMPPROCS=60

Now compile ThirdParty essentials

first install boost 1.48
yum install boost148 boost148-devel
I have not been able to use the compiled versions of gmp and mpfr...
 yum install gmp-devel mpfr-devel
cd  ThirdParty-dev

download openmpi 2.0.2:
 wget https://www.open-mpi.org/software/ompi/v2.0/downloads/openmpi-2.0.2.tar.gz
unpack:
tar -czvf openmpi-2.0.2.tar.gz
./Allwmake

Compile ParaView

module load qt/4.8.6       # installation Standalone QT 4.8 installation on Centos
 ./makeParaView
wmRefresh
note: paraview need the path to gcc glibc: 
export LD_LIBRARY_PATH=/opt/gcc/4.8.4/lib64:$LD_LIBRARY_PATH

Compile OpenFOAM

cd ../OpenFOAM-dev
./Allwmake

Create module file

Create the file: /etc/modulefiles/openfoam/dev

put the following content in the file

/etc/modulefiles/openfoam/dev

#%Module1.0####################################################################
##
## openfoam/dev modulefile
##
## 
##
proc ModulesHelp { } {
 puts stderr "\tSet OpenFOAM-dev environment."
}

## Create a whatis file.
module-whatis "Adds OpenFOAM links, aliases and paths"

set home $env(HOME)
set user $env(USER)

set-alias app "cd \$FOAM_APP"
set-alias foam "cd \$WM_PROJECT_DIR"

set-alias foamSite "cd \$WM_PROJECT_INST_DIR/site"
set-alias lib "cd \$FOAM_LIBBIN"
set-alias run "cd \$FOAM_RUN"
set-alias sol "cd \$FOAM_SOLVERS"
set-alias src "cd \$FOAM_SRC"
set-alias tut "cd \$FOAM_TUTORIALS"
set-alias util "cd \$FOAM_UTILITIES"
set-alias wm32 "wmSet WM_ARCH_OPTION=32"
set-alias wm64 "wmSet WM_ARCH_OPTION=64"
set-alias wmDP "wmSet WM_PRECISION_OPTION=DP"
set-alias wmSchedOff "unset WM_SCHEDULER"
set-alias wmSchedOn "export WM_SCHEDULER=\$WM_PROJECT_DIR/wmake/wmakeScheduler"
set-alias wmSet ". \$WM_PROJECT_DIR/etc/bashrc"
set-alias wmSP "wmSet WM_PRECISION_OPTION=SP"
set-alias wmUnset ". \$WM_PROJECT_DIR/etc/config.sh/unset"

set-alias cc "/opt/gcc/4.8.4/bin/gcc"

prepend-path PATH "/opt/openfoam/dev/ThirdParty-dev/platforms/linux64Gcc/gperftools-svn/bin:/opt/openfoam/dev/ThirdParty-dev/platforms/linux64Gcc/ParaView-5.0.1/bin:/opt/openfoam/dev/ThirdParty-dev/platforms/linux64Gcc/openmpi-2.0.2/bin:$home/OpenFOAM/$user-dev/platforms/linux64GccDPInt32Opt/bin:/opt/openfoam/dev/site/dev/platforms/linux64GccDPInt32Opt/bin:/opt/openfoam/dev/OpenFOAM-dev/platforms/linux64GccDPInt32Opt/bin:/opt/openfoam/dev/OpenFOAM-dev/bin:/opt/openfoam/dev/OpenFOAM-dev/wmake:/opt/qt/4.8.6/bin:/opt/cmake/2.8.12.2/bin:/opt/gcc/4.8.4/bin"
prepend-path LD_LIBRARY_PATH "/opt/gcc/4.8.4/lib64:/opt/openfoam/dev/ThirdParty-dev/platforms/linux64Gcc/gperftools-svn/lib:/opt/openfoam/dev/ThirdParty-dev/platforms/linux64Gcc/ParaView-5.0.1/lib/paraview-5.0:/opt/openfoam/dev/OpenFOAM-dev/platforms/linux64GccDPInt32Opt/lib/openmpi-2.0.2:/opt/openfoam/dev/ThirdParty-dev/platforms/linux64GccDPInt32/lib/openmpi-2.0.2:/opt/openfoam/dev/ThirdParty-dev/platforms/linux64Gcc/openmpi-2.0.2/lib:/opt/openfoam/dev/ThirdParty-dev/platforms/linux64Gcc/openmpi-2.0.2/lib64:$home/OpenFOAM/$user-dev/platforms/linux64GccDPInt32Opt/lib:/opt/openfoam/dev/site/dev/platforms/linux64GccDPInt32Opt/lib:/opt/openfoam/dev/OpenFOAM-dev/platforms/linux64GccDPInt32Opt/lib:/opt/openfoam/dev/ThirdParty-dev/platforms/linux64GccDPInt32/lib:/opt/openfoam/dev/OpenFOAM-dev/platforms/linux64GccDPInt32Opt/lib/dummy:/opt/qt/4.8.6/lib:/opt/mpc/1.0.1/lib:/opt/gmp/5.1.2/lib:/opt/mpfr/3.1.2/lib:/opt/gcc/4.8.4/lib"
setenv CMAKE_ROOT_DIR "/opt/cmake/2.8.12.2"
setenv CPLUS_INCLUDE_PATH "/opt/mpc/1.0.1/include:/opt/gmp/5.1.2/include:/opt/mpfr/3.1.2/include:/opt/gcc/4.8.4/include"
setenv CPPFLAGS "-I/opt/mpc/1.0.1/include:-I/opt/gmp/5.1.2/include:-I/opt/mpfr/3.1.2/include:-L/opt/gcc/4.8.4/lib:-I/opt/gcc/4.8.4/include"
setenv FOAM_APPBIN "/opt/openfoam/dev/OpenFOAM-dev/platforms/linux64GccDPInt32Opt/bin"
setenv FOAM_APP "/opt/openfoam/dev/OpenFOAM-dev/applications"
setenv FOAM_ETC "/opt/openfoam/dev/OpenFOAM-dev/etc"
setenv FOAM_EXT_LIBBIN "/opt/openfoam/dev/ThirdParty-dev/platforms/linux64GccDPInt32/lib"
setenv FOAM_INST_DIR "/opt/openfoam/dev"
setenv FOAM_JOB_DIR "/opt/openfoam/dev/jobControl"
setenv FOAM_LIBBIN "/opt/openfoam/dev/OpenFOAM-dev/platforms/linux64GccDPInt32Opt/lib"
setenv FOAM_MPI "openmpi-2.0.2"
setenv FOAM_RUN "$home/OpenFOAM/$user-dev/run"
setenv FOAM_SETTINGS ""
setenv FOAM_SIGFPE ""
setenv FOAM_SITE_APPBIN "/opt/openfoam/dev/site/dev/platforms/linux64GccDPInt32Opt/bin"
setenv FOAM_SITE_LIBBIN "/opt/openfoam/dev/site/dev/platforms/linux64GccDPInt32Opt/lib"
setenv FOAM_SOLVERS "/opt/openfoam/dev/OpenFOAM-dev/applications/solvers"
setenv FOAM_SRC "/opt/openfoam/dev/OpenFOAM-dev/src"
setenv FOAM_TUTORIALS "/opt/openfoam/dev/OpenFOAM-dev/tutorials"
setenv FOAM_USER_APPBIN "$home/OpenFOAM/$user-dev/platforms/linux64GccDPInt32Opt/bin"
setenv FOAM_USER_LIBBIN "$home/OpenFOAM/$user-dev/platforms/linux64GccDPInt32Opt/lib"
setenv FOAM_UTILITIES "/opt/openfoam/dev/OpenFOAM-dev/applications/utilities"

setenv GMP_INCLUDE_DIR "/opt/gmp/5.1.2/include"
setenv GMP_LIBRARIES "/opt/gmp/5.1.2/lib"
setenv LIBS "-L/opt/mpc/1.0.1/lib:-L/opt/gmp/5.1.2/lib:-L/opt/mpfr/3.1.2/lib"
setenv MAKEFLAGS "-j 3"
setenv MANPATH "/opt/openfoam/dev/ThirdParty-dev/platforms/linux64Gcc/openmpi-2.0.2/share/man:/opt/gcc/4.8.4/share/man:"
setenv MPFR_INCLUDE_DIR "/opt/mpfr/3.1.2/include"
setenv MPFR_LIBRARIES "/opt/mpfr/3.1.2/lib"
setenv MPI_ARCH_PATH "/opt/openfoam/dev/ThirdParty-dev/platforms/linux64Gcc/openmpi-2.0.2"
setenv MPI_BUFFER_SIZE "20000000"
setenv OPAL_PREFIX "/opt/openfoam/dev/ThirdParty-dev/platforms/linux64Gcc/openmpi-2.0.2"
setenv ParaView_DIR "/opt/openfoam/dev/ThirdParty-dev/platforms/linux64Gcc/ParaView-5.0.1"
setenv ParaView_INCLUDE_DIR "/opt/openfoam/dev/ThirdParty-dev/platforms/linux64Gcc/ParaView-5.0.1/include/paraview-5.0"
setenv ParaView_MAJOR "5.0"
setenv ParaView_VERSION "5.0.1"
setenv PV_PLUGIN_PATH "/opt/openfoam/dev/OpenFOAM-dev/platforms/linux64GccDPInt32Opt/lib/paraview-5.0"
setenv QT4_ROOT_DIR "/opt/qt/4.8.6"
setenv QT_BIN_DIR "/opt/qt/4.8.6/bin"
setenv QTDIR "/opt/qt/4.8.6"
setenv QTINC "/opt/qt/4.8.6/include"
setenv QTLIB "/opt/qt/4.8.6/lib"
setenv QT_PLUGIN_PATH "/opt/qt/4.8.6/plugins"
setenv WM_ARCH "linux64"
setenv WM_ARCH_OPTION "64"
setenv WM_CC "gcc"
setenv WM_CFLAGS "-m64 -fPIC"
setenv WM_COMPILE_OPTION "Opt"
setenv WM_COMPILER "Gcc"
setenv WM_COMPILER_LIB_ARCH "64"
setenv WM_COMPILER_TYPE "system"
setenv WM_CXXFLAGS "-m64 -fPIC -std \"c++0x\""
setenv WM_CXX "g++"
setenv WM_DIR "/opt/openfoam/dev/OpenFOAM-dev/wmake"
setenv WM_LABEL_OPTION "Int32"
setenv WM_LABEL_SIZE "32"
setenv WM_LDFLAGS "-m64"
setenv WM_LINK_LANGUAGE "c++"
setenv WM_MPLIB "OPENMPI"
setenv WM_OPTIONS "linux64GccDPInt32Opt"
setenv WM_OSTYPE "POSIX"
setenv WM_PRECISION_OPTION "DP"
setenv WM_PROJECT_DIR "/opt/openfoam/dev/OpenFOAM-dev"
setenv WM_PROJECT_INST_DIR "/opt/openfoam/dev"
setenv WM_PROJECT "OpenFOAM"
setenv WM_PROJECT_USER_DIR "$home/OpenFOAM/$user-dev"
setenv WM_PROJECT_VERSION "dev"
setenv WM_THIRD_PARTY_DIR "/opt/openfoam/dev/ThirdParty-dev"

Standalone gcc 4.8.4 with mpc, mpfr and gmp on CentOS 6.x

Install gmp 5.1.2

wget https://ftp.gnu.org/gnu/gmp/gmp-5.1.2.tar.bz2
 tar -xjvf gmp-5.1.2.tar.bz2
 cd gmp-5.1.2
 ./configure --exec-prefix=/opt/gmp/5.1.2 --datarootdir=/opt/gmp/5.1.2/share --datadir=/opt/gmp/5.1.2/share --infodir=/opt/gmp/5.1.2/share/info --includedir=/opt/gmp/5.1.2/include --oldincludedir=/opt/gmp/5.1.2/include --prefix=/opt/gmp/5.1.2
 make
 make install

Module file: /etc/modulefiles/gmp/5.1.2

#%Module1.0####################################################################
##
## Discretizer AB modulefile
##
##

#Add directory to the path
#prepend-path PATH /opt/gmp/5.1.2/bin
prepend-path LD_LIBRARY_PATH /opt/gmp/5.1.2/lib
prepend-path CPLUS_INCLUDE_PATH /opt/gmp/5.1.2/include
prepend-path CPPFLAGS -I/opt/gmp/5.1.2/include
prepend-path LIBS -L/opt/gmp/5.1.2/lib
prepend-path GMP_LIBRARIES /opt/gmp/5.1.2/lib
prepend-path GMP_INCLUDE_DIR /opt/gmp/5.1.2/include
pre

Install mpfr 3.1.2

wget http://www.mpfr.org/mpfr-3.1.2/mpfr-3.1.2.tar.gz
tar -xzvf mpfr-3.1.2.tar.gz
cd mpfr-3.1.2
./configure --exec-prefix=/opt/mpfr/3.1.2 --datarootdir=/opt/mpfr/3.1.2/share --datadir=/opt/mpfr/3.1.2/share --infodir=/opt/mpfr/3.1.2/share/info --includedir=/opt/mpfr/3.1.2/include --oldincludedir=/opt/mpfr/3.1.2/include
make
make install

Module file: /etc/modulefiles/mpfr/3.1.2

#%Module1.0####################################################################
##
## Discretizer AB modulefile
##
##


## Add directory to the path
#prepend-path PATH /opt/mpfr/3.1.2/bin
prepend-path LD_LIBRARY_PATH /opt/mpfr/3.1.2/lib
prepend-path CPLUS_INCLUDE_PATH /opt/mpfr/3.1.2/include
prepend-path CPPFLAGS -I/opt/mpfr/3.1.2/include
prepend-path LIBS -L/opt/mpfr/3.1.2/lib
prepend-path MPFR_LIBRARIES /opt/mpfr/3.1.2/lib
prepend-path MPFR_INCLUDE_DIR /opt/mpfr/3.1.2/include
prepend-path LD_RUN_PATH /opt/mpfr/3.1.2/lib

Install mpc 1.0.1

wget https://ftp.gnu.org/gnu/mpc/mpc-1.0.1.tar.gz
tar -xzvf mpc-1.0.1.tar.gz
cd mpc-1.0.1
./configure --exec-prefix=/opt/mpc/1.0.1 --datarootdir=/opt/mpc/1.0.1/share --datadir=/opt/mpc/1.0.1/share --infodir=/opt/mpc/1.0.1/share/info --includedir=/opt/mpc/1.0.1/include --oldincludedir=/opt/mpc/1.0.1/include --with-gmp=/opt/gmp/5.1.2/ --with-mpfr=/opt/mpfr/3.1.2/
make
make install

Module file: /etc/modulefiles/mpc/1.0.1

#%Module1.0####################################################################
##
## Discretizer AB modulefile
##
##

## Add directory to the path
#prepend-path PATH /opt/mpc/1.0.1/bin
prepend-path LD_LIBRARY_PATH /opt/mpc/1.0.1/lib
prepend-path CPLUS_INCLUDE_PATH /opt/mpc/1.0.1/include
prepend-path CPPFLAGS -I/opt/mpc/1.0.1/include
prepend-path LIBS -L/opt/mpc/1.0.1/lib

Install isl 0.11.1

wget ftp://ftp.irisa.fr/pub/mirrors/gcc.gnu.org/gcc/infrastructure/isl-0.11.1.tar.bz2
tar -xjvf isl-0.11.1.tar.bz2
cd isl-0.11.1
./configure --exec-prefix=/opt/isl/0.11.1 --datarootdir=/opt/isl/0.11.1/share --datadir=/opt/isl/0.11.1/share --infodir=/opt/isl/0.11.1/share/info --includedir=/opt/isl/0.11.1/include --oldincludedir=/opt/isl/0.11.1/include --with-gmp-prefix=/opt/gmp/5.1.2/ 
make make install

Module file: /etc/modulefiles/isl/0.11.1

#%Module1.0####################################################################
##
## Discretizer AB modulefile
##
##

#Add directory to the path
#prepend-path PATH /opt/isl/0.11.1/bin
prepend-path LD_LIBRARY_PATH /opt/isl/0.11.1/lib
prepend-path CPLUS_INCLUDE_PATH /opt/isl/0.11.1/include
prepend-path CPPFLAGS -I/opt/isl/0.11.1/include
prepend-path LIBS -L/opt/isl/0.11.1/lib
prepend-path LD_RUN_PATH /opt/isl/0.11.1/lib

Install cloog 0.18.0

wget ftp://ftp.irisa.fr/pub/mirrors/gcc.gnu.org/gcc/infrastructure/cloog-0.18.0.tar.gz
tar -xzvf cloog-0.18.0.tar.gz
cd cloog-0.18.0
./configure --exec-prefix=/opt/cloog/0.18.0 --datarootdir=/opt/cloog/0.18.0/share --datadir=/opt/cloog/0.18.0/share --infodir=/opt/cloog/0.18.0/share/info --includedir=/opt/cloog/0.18.0/include --oldincludedir=/opt/cloog/0.18.0/include --with-gmp-prefix=/opt/gmp/5.1.2/
makemake install

Module file: /etc/modulefiles/cloog/0.18.0

#%Module1.0####################################################################
##
## Discretizer AB modulefile
##
##

#Add directory to the path
#prepend-path PATH /opt/cloog/0.18.0/bin
prepend-path LD_LIBRARY_PATH /opt/cloog/0.18.0/lib
prepend-path CPLUS_INCLUDE_PATH /opt/cloog/0.18.0/include
prepend-path CPPFLAGS -I/opt/cloog/0.18.0/include
prepend-path LIBS -L/opt/cloog/0.18.0/lib
prepend-path LD_RUN_PATH /opt/cloog/0.18.0/lib

Install gcc 4.8.4

I had to install 32 bit glibc-devel:
 yum install glibc-devel.i686

module load gmp/5.1.2
module load mpfr/3.1.2 
module load mpc/1.0.1 
module load isl/0.11.1
module load cloog/0.18.0
wget https://ftp.gnu.org/gnu/gcc/gcc-4.8.4/gcc-4.8.4.tar.bz2
tar -xjvf gcc-4.8.4.tar.bz2
cd gcc-4.8.4
./configure --prefix=/opt/gcc/4.8.4 --exec-prefix=/opt/gcc/4.8.4 --datarootdir=/opt/gcc/4.8.4/share --datadir=/opt/gcc/4.8.4/share --infodir=/opt/gcc/4.8.4/share/info --includedir=/opt/gcc/4.8.4/include --oldincludedir=/opt/gcc/4.8.4/include --with-gmp=/opt/gmp/5.1.2/ --with-mpfr=/opt/mpfr/3.1.2/ --with-mpc=/opt/mpc/1.0.1/ --with-isl=/opt/isl/0.11.1/ --with-cloog=/opt/cloog/0.18.0/ --disable-isl-version-check
 make 
make install

Module file: /etc/modulefiles/gcc/4.8.4

#%Module1.0####################################################################
##
## gcc modulefile
##
## 
##

prepend-path PATH /opt/gcc/4.8.4/bin
#prepend-path PATH /opt/gcc/4.8.4/libexec/gcc/x86_64-unknown-linux-gnu/4.8.4/
set-alias "cc" "/opt/gcc/4.8.4/bin/gcc"
prepend-path LD_LIBRARY_PATH /opt/gcc/4.8.4/lib/../lib64 
prepend-path LD_RUN_PATH /opt/gcc/4.8.4/lib/../lib64 
#prepend-path LIBS -I/opt/gcc/4.8.4/lib/gcc/x86_64-unknown-linux-gnu/4.8.4/include
prepend-path MANPATH /opt/gcc/4.8.4/share/man

prepend-path CPLUS_INCLUDE_PATH /opt/gcc/4.8.4/include
#prepend-path CPLUS_INCLUDE_PATH /opt/gcc/4.8.4/lib/gcc/x86_64-unknown-linux-gnu/4.8.4/include/ssp
prepend-path CPPFLAGS -I/opt/gcc/4.8.4/include
prepend-path CPPFLAGS -L/opt/gcc/4.8.4/lib
#prepend-path LIBS -L/opt/gcc/4.8.4/lib64
#prepend-path LIBS -L/opt/gcc/4.8.4/lib/gcc/x86_64-unknown-linux-gnu/4.8.4/
#prepend-path LIBS -B/opt/gcc/4.8.4/lib/gcc/x86_64-unknown-linux-gnu/4.8.4/
#prepend-path GCC_EXEC_PREFIX -L/opt/gcc/4.8.4/libexec/gcc/x86_64-unknown-linux-gnu/4.8.4
#prepend-path GCC_EXEC_PREFIX -L/opt/gcc/4.8.4/lib/gcc/x86_64-unknown-linux-gnu/4.8.4/
#prepend-path LIBS -L/opt/gcc/4.8.4/lib/
#prepend-path LIBS -B/opt/gcc/4.8.4/lib/
#prepend-path GCC_EXEC_PREFIX -L/opt/gcc/4.8.4/libexec/gcc/
#prepend-path GCC_EXEC_PREFIX -L/opt/gcc/4.8.4/lib/gcc/

Install OpenFOAM v1612+ on CentOS 6.x from source

Download:

mkdir -p /opt/openfoam/v1612+
cd /opt/openfoam/v1612+

wget https://sourceforge.net/projects/openfoamplus/files/v1612+/OpenFOAM-v1612+.tgz
wget https://sourceforge.net/projects/openfoamplus/files/v1612+/ThirdParty-v1612+.tgz

Unpack:

tar -xzvf OpenFOAM-v1612+.tgz ;tar -xzvf ThirdParty-v1612+.tgz

Edit file OpenFOAM-v1612+/etc/bashrc

change FOAM_INST_DIR to
 FOAM_INST_DIR=/opt/openfoam/v1612+
and:
export WM_MPLIB=OPENMPI

Load modules

module load gcc/4.8.4            # installation Standalone gcc 4.8.4 with mpc, mpfr and gmp on CentOS 6.x
 module load mpfr/3.1.2 
 module load gmp/5.1.2
 module load mpc/1.0.1 
 module load cmake/2.8.12.2  # installation Standalone cmake 2.8 on CentOS

Source bashrc

. ../OpenFOAM-v1612+/etc/bashrc

Compile on many cores if you have

export MAKEFLAGS='-j 60'
export WM_NCOMPPROCS=60

Now compile ThirdParty essentials

first install boost 1.48
yum install boost148 boost148-devel
I have not been able to use the compiled versions of gmp and mpfr...
 yum install gmp-devel mpfr-devel
cd  ThirdParty-v1612+
./Allwmake

Compile ParaView

module load qt/4.8.6       # installation Standalone QT 4.8 installation on Centos
 ./makeParaView
note: paraview need the path to gcc glibc: 
export LD_LIBRARY_PATH=/opt/gcc/4.8.4/lib64:$LD_LIBRARY_PATH

Compile ADIOS parallell IO

wget http://users.nccs.gov/~pnorbert/adios-1.11.0.tar.gz
 tar -xzvf adios-1.11.0.tar.gz
 mv adios-1.11.0 ADIOS-1.11.0
 ./makeADIOS

Compile ccmio

 wget http://portal.nersc.gov/svn/visit/trunk/third_party/libccmio-2.6.1.tar.gz
tar -xzvf libccmio-2.6.1.tar.gz
./makeCCMIO

Compile OpenFOAM

cd ../OpenFOAM-v1612+
./Allwmake

Create module file

Create the file: /etc/modulefiles/openfoam/v1612+

put the following content in the file

/etc/modulefiles/openfoam/v1612+

#%Module1.0####################################################################
##
## openfoam/v1612+ modulefile
##
## 
##
proc ModulesHelp { } {
 puts stderr "\tSet OpenFOAM v1612+ environment."
}

## Create a whatis file.
module-whatis "Adds OpenFOAM links, aliases and paths"

set home $env(HOME)
set user $env(USER)


set-alias app "cd \$FOAM_APP"
#set-alias foam3rdParty "cd \$WM_THIRD_PARTY_DIR"
#set-alias foamApps "cd \$FOAM_APP"
set-alias foam "cd \$WM_PROJECT_DIR"
set-alias foamfv "cd \$FOAM_SRC/finiteVolume"
set-alias foamSite "cd \$WM_PROJECT_INST_DIR/site"
set-alias foamSol "cd \$FOAM_SOLVERS"
set-alias foamsrc "cd \$FOAM_SRC/\$WM_PROJECT"
set-alias foamTuts "cd \$FOAM_TUTORIALS"
set-alias foamUtils "cd \$FOAM_UTILITIES"
set-alias lib "cd \$FOAM_LIBBIN"
set-alias run "cd \$FOAM_RUN"
set-alias sol "cd \$FOAM_SOLVERS"
set-alias src "cd \$FOAM_SRC"
set-alias tut "cd \$FOAM_TUTORIALS"
set-alias util "cd \$FOAM_UTILITIES"
#set-alias wm32 "wmSET WM_ARCH_OPTION \"32\""
#set-alias wm64 "wmSET WM_ARCH_OPTION \"64\""
set-alias wmDP "wmSET WM_PRECISION_OPTION \"DP\""
set-alias wmREFRESH "wmSET \$FOAM_SETTINGS"
set-alias wmSchedOFF "unset WM_SCHEDULER"
set-alias wmSchedON "export WM_SCHEDULER \$WM_PROJECT_DIR/wmake/wmakeScheduler"
set-alias wmSET ". \$WM_PROJECT_DIR/etc/bashrc"
set-alias wmSP "wmSET WM_PRECISION_OPTION \"SP\""
set-alias wmUNSET ". \$WM_PROJECT_DIR/etc/config.sh/unset"

set-alias cc "/opt/gcc/4.8.4/bin/gcc"
set-alias wmInt32 "wmSet WM_LABEL_SIZE \"32\""
set-alias wmInt64 "wmSet WM_LABEL_SIZE \"64\""

prepend-path PATH "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/gperftools-2.5/bin:/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/ParaView-5.0.1/bin:/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/openmpi-1.10.4/bin:$home/OpenFOAM/$user-v1612+/platforms/linux64GccDPInt32Opt/bin:/opt/openfoam/v1612+/site/v1612+/platforms/linux64GccDPInt32Opt/bin:/opt/openfoam/v1612+/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/bin:/opt/openfoam/v1612+/OpenFOAM-v1612+/bin:/opt/openfoam/v1612+/OpenFOAM-v1612+/wmake:/opt/qt/4.8.6/bin:/opt/cmake/2.8.12.2/bin:/opt/gcc/4.8.4/bin"
prepend-path LD_LIBRARY_PATH "/opt/gcc/4.8.4/lib64:/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/fftw-3.3.5/lib64:/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/CGAL-4.9/lib64:/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/boost_1_62_0/lib64:/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/gperftools-2.5/lib64:/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/ParaView-5.0.1/lib/paraview-5.0:/opt/openfoam/v1612+/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/lib/openmpi-1.10.4:/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64GccDPInt32/lib/openmpi-1.10.4:/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/openmpi-1.10.4/lib64:$home/OpenFOAM/$user-v1612+/platforms/linux64GccDPInt32Opt/lib:/opt/openfoam/v1612+/site/v1612+/platforms/linux64GccDPInt32Opt/lib:/opt/openfoam/v1612+/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/lib:/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64GccDPInt32/lib:/opt/openfoam/v1612+/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/lib/dummy:/opt/qt/4.8.6/lib:/opt/mpc/1.0.1/lib:/opt/gmp/5.1.2/lib:/opt/mpfr/3.1.2/lib:/opt/gcc/4.8.4/lib"
prepend-path MANPATH "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/openmpi-1.10.4/share/man:/opt/gcc/4.8.4/share/man:"

setenv BOOST_ARCH_PATH "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/boost_1_62_0"
setenv CGAL_ARCH_PATH "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/CGAL-4.9"
setenv CMAKE_ROOT_DIR "/opt/cmake/2.8.12.2"
setenv CPLUS_INCLUDE_PATH "/opt/mpc/1.0.1/include:/opt/gmp/5.1.2/include:/opt/mpfr/3.1.2/include:/opt/gcc/4.8.4/include"
setenv CPPFLAGS "-I/opt/mpc/1.0.1/include:-I/opt/gmp/5.1.2/include:-I/opt/mpfr/3.1.2/include:-L/opt/gcc/4.8.4/lib:-I/opt/gcc/4.8.4/include"
setenv FFTW_ARCH_PATH "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/fftw-3.3.5"
setenv FOAM_APPBIN "/opt/openfoam/v1612+/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/bin"
setenv FOAM_APP "/opt/openfoam/v1612+/OpenFOAM-v1612+/applications"
setenv FOAM_ETC "/opt/openfoam/v1612+/OpenFOAM-v1612+/etc"
setenv FOAM_EXT_LIBBIN "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64GccDPInt32/lib"
setenv FOAM_INST_DIR "/opt/openfoam/v1612+"
setenv FOAM_JOB_DIR "/opt/openfoam/v1612+/jobControl"
setenv FOAM_LIBBIN "/opt/openfoam/v1612+/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/lib"
setenv FOAM_MPI "openmpi-1.10.4"
setenv FOAM_RUN "$home/OpenFOAM/$user-v1612+/run"
setenv FOAM_SETTINGS ""
setenv FOAM_SIGFPE ""
setenv FOAM_SITE_APPBIN "/opt/openfoam/v1612+/site/v1612+/platforms/linux64GccDPInt32Opt/bin"
setenv FOAM_SITE_LIBBIN "/opt/openfoam/v1612+/site/v1612+/platforms/linux64GccDPInt32Opt/lib"
setenv FOAM_SOLVERS "/opt/openfoam/v1612+/OpenFOAM-v1612+/applications/solvers"
setenv FOAM_SRC "/opt/openfoam/v1612+/OpenFOAM-v1612+/src"
setenv FOAM_TUTORIALS "/opt/openfoam/v1612+/OpenFOAM-v1612+/tutorials"
setenv FOAM_USER_APPBIN "$home/OpenFOAM/$user-v1612+/platforms/linux64GccDPInt32Opt/bin"
setenv FOAM_USER_LIBBIN "$home/OpenFOAM/$user-v1612+/platforms/linux64GccDPInt32Opt/lib"
setenv FOAM_UTILITIES "/opt/openfoam/v1612+/OpenFOAM-v1612+/applications/utilities"
setenv GMP_INCLUDE_DIR "/opt/gmp/5.1.2/include"
setenv GMP_LIBRARIES "/opt/gmp/5.1.2/lib"
setenv LIBS "-L/opt/mpc/1.0.1/lib:-L/opt/gmp/5.1.2/lib:-L/opt/mpfr/3.1.2/lib"
setenv MAKEFLAGS "-j 60"
setenv MPFR_INCLUDE_DIR "/opt/mpfr/3.1.2/include"
setenv MPFR_LIBRARIES "/opt/mpfr/3.1.2/lib"
setenv MPI_ARCH_PATH "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/openmpi-1.10.4"
setenv MPI_BUFFER_SIZE "20000000"
setenv OPAL_PREFIX "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/openmpi-1.10.4"
setenv ParaView_DIR "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/ParaView-5.0.1"
setenv ParaView_INCLUDE_DIR "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/ParaView-5.0.1/include/paraview-5.0"
setenv PV_PLUGIN_PATH "/opt/openfoam/v1612+/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/lib/paraview-5.0"
setenv QT4_ROOT_DIR "/opt/qt/4.8.6"
setenv QT_BIN_DIR "/opt/qt/4.8.6/bin"
setenv QTDIR "/opt/qt/4.8.6"
setenv QTINC "/opt/qt/4.8.6/include"
setenv QTLIB "/opt/qt/4.8.6/lib"
setenv QT_PLUGIN_PATH "/opt/qt/4.8.6/plugins"
setenv SCOTCH_ARCH_PATH "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64GccDPInt32/scotch_6.0.3"
setenv WM_ARCH "linux64"
setenv WM_ARCH_OPTION "64"
setenv WM_CC "gcc"
setenv WM_CFLAGS "-m64 -fPIC"
setenv WM_COMPILE_OPTION "Opt"
setenv WM_COMPILER "Gcc"
setenv WM_COMPILER_LIB_ARCH "64"
setenv WM_COMPILER_TYPE "system"
setenv WM_CXXFLAGS "-m64 -fPIC -std \"c++0x\""
setenv WM_CXX "g++"
setenv WM_DIR "/opt/openfoam/v1612+/OpenFOAM-v1612+/wmake"
setenv WM_LABEL_OPTION "Int32"
setenv WM_LABEL_SIZE "32"
setenv WM_LDFLAGS "-m64"
setenv WM_LINK_LANGUAGE "c++"
setenv WM_MPLIB "OPENMPI"
setenv WM_NCOMPPROCS "60"
setenv WM_OPTIONS "linux64GccDPInt32Opt"
setenv WM_OSTYPE "POSIX"
setenv WM_PRECISION_OPTION "DP"
setenv WM_PROJECT_DIR "/opt/openfoam/v1612+/OpenFOAM-v1612+"
setenv WM_PROJECT_INST_DIR "/opt/openfoam/v1612+"
setenv WM_PROJECT "OpenFOAM"
setenv WM_PROJECT_USER_DIR "$home/OpenFOAM/$user-v1612+"
setenv WM_PROJECT_VERSION "v1612+"
setenv WM_THIRD_PARTY_DIR "/opt/openfoam/v1612+/ThirdParty-v1612+"

Build OpenFOAM 3.0.0 on CentOS 6.6

Download from http://www.openfoam.org/download/source.php:

OpenFOAM-3.0.0.tgz and ThirdParty-3.0.0.tgz
create directory /opt/openfoam/3.0.0/ and unpack

In /opt/openfoam/3.0.0/OpenFOAM-3.0.0/etc/bashrc

foamInstall=/opt/openfoam/$WM_PROJECT_VERSION
and
foamCompiler=ThirdParty
export WM_MPLIB=OPENMPI
wget ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-4.8.4/gcc-4.8.4.tar.bz2
tar -xjvf gcc-4.8.4.tar.bz2
cd /opt/openfoam/3.0.0/ThirdParty-3.0.0
module load gmp/5.1.2
module load mpfr/3.1.2
module load mpc/1.0.1
export GMP_ARCH_PATH=/opt/gmp/5.1.2
export MPFR_ARCH_PATH=/opt/mpfr/3.1.2
export MPC_ARCH_PATH=/opt/mpc/1.0.1

uncomment the ARCH_PATH’s in makeGcc file

#GMP_ARCH_PATH=$installBASE/$gmpPACKAGE
#MPFR_ARCH_PATH=$installBASE/$mpfrPACKAGE
#MPC_ARCH_PATH=$installBASE/$mpcPACKAGE
./makeGcc gcc-4.8.4

Change in /opt/openfoam/3.0.0/OpenFOAM-3.0.0/etc/config/settings.sh

from

gmpDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$gmp_version
mpfrDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$mpfr_version
mpcDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$mpc_version

to

gmpDir=/opt/gmp/5.1.2
mpfrDir=/opt/mpfr/3.1.2
mpcDir=/opt/mpc/1.0.1

now source bashrc again

. /opt/openfoam/3.0.0/OpenFOAM-3.0.0/etc/bashrc

check which compiler

which gcc
/opt/openfoam/3.0.0/ThirdParty-3.0.0/platforms/linux64/gcc-4.8.4/bin/gcc

in makeCGAL uncomment
#GMP_ARCH_PATH=$installBASE/$gmpPACKAGE
#MPFR_ARCH_PATH=$installBASE/$mpfrPACKAGE

module load mpc/1.0.1
module load mpfr/3.1.2
module load boost/1.49.0
module load cmake/2.8.12.2
module load gmp/5.1.2

./Allwmake

. /opt/openfoam/3.0.0/OpenFOAM-3.0.0/etc/bashrc
./makeParaView4 -mpi -python

module list
Currently Loaded Modulefiles:
1) mpc/1.0.1 3) boost/1.49.0 5) gmp/5.1.2
2) mpfr/3.1.2 4) cmake/2.8.12.2 6) qt/4.8.6

in file /opt/openfoam/3.0.0/OpenFOAM-3.0.0/etc/config/CGAL.sh

#export BOOST_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$boost_version
export BOOST_ARCH_PATH=/opt/boost/1.49.0/stage

cd /opt/openfoam/3.0.0/OpenFOAM-3.0.0
./Allwmake

 

cd ../ThirdParty-3.0.0
wmake http://portal.nersc.gov/svn/visit/trunk/third_party/libccmio-2.6.1.tar.gz
tar -xzvf libccmio-2.6.1.tar.gz
cd libccmio-2.6.1
make
#copy generated files to LIBBIN
echo $FOAM_LIBBIN
cp ./lib/linux64_2.4-x86-glibc_2.2.5/debug-shared/* /opt/openfoam/3.0.0/OpenFOAM-3.0.0/platforms/linux64GccDPInt32Opt/lib

#%Module1.0####################################################################
##
##  openfoam/3.0.0 modulefile
##
##  
##
proc ModulesHelp { } {
        puts stderr "\tSet OpenFOAM 3.0.0 environment."
}

## Create a whatis file.
module-whatis   "Adds OpenFOAM links, aliases and paths"

set home $env(HOME)
set user $env(USER)

set-alias app "cd \$FOAM_APP"
set-alias foam3rdParty "cd \$WM_THIRD_PARTY_DIR"
set-alias foamApps "cd \$FOAM_APP"
set-alias foam "cd \$WM_PROJECT_DIR"
set-alias foamfv "cd \$FOAM_SRC/finiteVolume"
set-alias foamSite "cd \$WM_PROJECT_INST_DIR/site"
set-alias foamSol "cd \$FOAM_SOLVERS"
set-alias foamsrc "cd \$FOAM_SRC/\$WM_PROJECT"
set-alias foamTuts "cd \$FOAM_TUTORIALS"
set-alias foamUtils "cd \$FOAM_UTILITIES"
set-alias lib "cd \$FOAM_LIBBIN"
set-alias run "cd \$FOAM_RUN"
set-alias sol "cd \$FOAM_SOLVERS"
set-alias src "cd \$FOAM_SRC"
set-alias tut "cd \$FOAM_TUTORIALS"
set-alias util "cd \$FOAM_UTILITIES"
set-alias wm32 "wmSET WM_ARCH_OPTION \"32\""
set-alias wm64 "wmSET WM_ARCH_OPTION \"64\""
set-alias wmDP "wmSET WM_PRECISION_OPTION \"DP\""
set-alias wmREFRESH "wmSET \$FOAM_SETTINGS"
set-alias wmSchedOFF "unset WM_SCHEDULER"
set-alias wmSchedON "export WM_SCHEDULER \"\$WM_PROJECT_DIR/wmake/wmakeScheduler\""
set-alias wmSET ". \$WM_PROJECT_DIR/etc/bashrc"
set-alias wmSP "wmSET WM_PRECISION_OPTION \"SP\""
set-alias wmUNSET ". \$WM_PROJECT_DIR/etc/config/unset.sh"

prepend-path  PATH "/opt/openfoam/3.0.0/ThirdParty-3.0.0/platforms/linux64Gcc/gperftools-svn/bin:/opt/openfoam/3.0.0/ThirdParty-3.0.0/platforms/linux64Gcc/ParaView-4.4.0/bin:/opt/openfoam/3.0.0/ThirdParty-3.0.0/platforms/linux64Gcc/openmpi-1.10.0/bin:/opt/openfoam/3.0.0/ThirdParty-3.0.0/platforms/linux64/gcc-4.8.4/bin:$home/OpenFOAM/$user-3.0.0/platforms/linux64GccDPInt32Opt/bin:/opt/openfoam/3.0.0/site/3.0.0/platforms/linux64GccDPInt32Opt/bin:/opt/openfoam/3.0.0/OpenFOAM-3.0.0/platforms/linux64GccDPInt32Opt/bin:/opt/openfoam/3.0.0/OpenFOAM-3.0.0/bin:/opt/openfoam/3.0.0/OpenFOAM-3.0.0/wmake:/opt/qt/4.8.6/bin:/opt/cmake/2.8.12.2/bin"
prepend-path  LD_LIBRARY_PATH "/opt/boost/1.49.0/stage//lib:/opt/openfoam/3.0.0/ThirdParty-3.0.0/platforms/linux64Gcc/CGAL-4.7/lib:/opt/openfoam/3.0.0/ThirdParty-3.0.0/platforms/linux64Gcc/gperftools-svn/lib:/opt/openfoam/3.0.0/ThirdParty-3.0.0/platforms/linux64Gcc/ParaView-4.4.0/lib/paraview-4.4:/opt/openfoam/3.0.0/OpenFOAM-3.0.0/platforms/linux64GccDPInt32Opt/lib/openmpi-1.10.0:/opt/openfoam/3.0.0/ThirdParty-3.0.0/platforms/linux64GccDPInt32Opt/lib/openmpi-1.10.0:/opt/openfoam/3.0.0/ThirdParty-3.0.0/platforms/linux64Gcc/openmpi-1.10.0/lib:/opt/openfoam/3.0.0/ThirdParty-3.0.0/platforms/linux64Gcc/openmpi-1.10.0/lib64:/opt/mpc/1.0.1/lib:/opt/mpfr/3.1.2/lib:/opt/gmp/5.1.2/lib:/opt/openfoam/3.0.0/ThirdParty-3.0.0/platforms/linux64/gcc-4.8.4/lib64:$home/OpenFOAM/$user-3.0.0/platforms/linux64GccDPInt32Opt/lib:/opt/openfoam/3.0.0/site/3.0.0/platforms/linux64GccDPInt32Opt/lib:/opt/openfoam/3.0.0/OpenFOAM-3.0.0/platforms/linux64GccDPInt32Opt/lib:/opt/openfoam/3.0.0/ThirdParty-3.0.0/platforms/linux64GccDPInt32Opt/lib:/opt/openfoam/3.0.0/OpenFOAM-3.0.0/platforms/linux64GccDPInt32Opt/lib/dummy:/opt/boost/1.49.0/stage/lib//lib:/opt/qt/4.8.6/lib:/opt/boost/1.49.0/stage/lib"

setenv  BOOST_ARCH_PATH "/opt/boost/1.49.0/stage/"
setenv  CGAL_ARCH_PATH "/opt/openfoam/3.0.0/ThirdParty-3.0.0/platforms/linux64Gcc/CGAL-4.7"
setenv  CMAKE_ROOT_DIR "/opt/cmake/2.8.12.2"
setenv  CPLUS_INCLUDE_PATH "/opt/gmp/5.1.2/include:/opt/mpfr/3.1.2/include:/opt/mpc/1.0.1/include"
setenv  CPPFLAGS "-I/opt/gmp/5.1.2/include:-I/opt/mpfr/3.1.2/include:-I/opt/mpc/1.0.1/include"
setenv  FOAM_APPBIN "/opt/openfoam/3.0.0/OpenFOAM-3.0.0/platforms/linux64GccDPInt32Opt/bin"
setenv  FOAM_APP "/opt/openfoam/3.0.0/OpenFOAM-3.0.0/applications"
setenv  FOAM_ETC "/opt/openfoam/3.0.0/OpenFOAM-3.0.0/etc"
setenv  FOAM_EXT_LIBBIN "/opt/openfoam/3.0.0/ThirdParty-3.0.0/platforms/linux64GccDPInt32Opt/lib"
setenv  FOAM_INST_DIR "/opt/openfoam/3.0.0"
setenv  FOAM_JOB_DIR "/opt/openfoam/3.0.0/jobControl"
setenv  FOAM_LIBBIN "/opt/openfoam/3.0.0/OpenFOAM-3.0.0/platforms/linux64GccDPInt32Opt/lib"
setenv  FOAM_MPI "openmpi-1.10.0"
setenv  FOAM_RUN "$home/OpenFOAM/$user-3.0.0/run"
setenv  FOAM_SETTINGS ""
setenv  FOAM_SIGFPE ""
setenv  FOAM_SITE_APPBIN "/opt/openfoam/3.0.0/site/3.0.0/platforms/linux64GccDPInt32Opt/bin"
setenv  FOAM_SITE_LIBBIN "/opt/openfoam/3.0.0/site/3.0.0/platforms/linux64GccDPInt32Opt/lib"
setenv  FOAM_SOLVERS "/opt/openfoam/3.0.0/OpenFOAM-3.0.0/applications/solvers"
setenv  FOAM_SRC "/opt/openfoam/3.0.0/OpenFOAM-3.0.0/src"
setenv  FOAM_TUTORIALS "/opt/openfoam/3.0.0/OpenFOAM-3.0.0/tutorials"
setenv  FOAM_USER_APPBIN "$home/OpenFOAM/$user-3.0.0/platforms/linux64GccDPInt32Opt/bin"
setenv  FOAM_USER_LIBBIN "$home/OpenFOAM/$user-3.0.0/platforms/linux64GccDPInt32Opt/lib"
setenv  FOAM_UTILITIES "/opt/openfoam/3.0.0/OpenFOAM-3.0.0/applications/utilities"
setenv  GMP_ARCH_PATH "/opt/gmp/5.1.2"
setenv  GMP_INCLUDE_DIR "/opt/gmp/5.1.2/include"
setenv  GMP_LIBRARIES "/opt/gmp/5.1.2/lib"
setenv  LIBS "-L/opt/gmp/5.1.2/lib:-L/opt/mpfr/3.1.2/lib:-L/opt/mpc/1.0.1/lib"
setenv  _LMFILES_ "/etc/modulefiles/mpc/1.0.1:/etc/modulefiles/mpfr/3.1.2:/etc/modulefiles/boost/1.49.0:/etc/modulefiles/cmake/2.8.12.2:/etc/modulefiles/gmp/5.1.2:/etc/modulefiles/qt/4.8.6"
setenv  MANPATH "/opt/openfoam/3.0.0/ThirdParty-3.0.0/platforms/linux64Gcc/openmpi-1.10.0/share/man:/opt/openfoam/3.0.0/ThirdParty-3.0.0/platforms/linux64/gcc-4.8.4/man:"
setenv  MPC_ARCH_PATH "/opt/mpc/1.0.1"
setenv  MPFR_ARCH_PATH "/opt/mpfr/3.1.2"
setenv  MPFR_INCLUDE_DIR "/opt/mpfr/3.1.2/include"
setenv  MPFR_LIBRARIES "/opt/mpfr/3.1.2/lib"
setenv  MPI_ARCH_PATH "/opt/openfoam/3.0.0/ThirdParty-3.0.0/platforms/linux64Gcc/openmpi-1.10.0"
setenv  MPI_BUFFER_SIZE "20000000"
setenv  OPAL_PREFIX "/opt/openfoam/3.0.0/ThirdParty-3.0.0/platforms/linux64Gcc/openmpi-1.10.0"
setenv  ParaView_DIR "/opt/openfoam/3.0.0/ThirdParty-3.0.0/platforms/linux64Gcc/ParaView-4.4.0"
setenv  ParaView_INCLUDE_DIR "/opt/openfoam/3.0.0/ThirdParty-3.0.0/platforms/linux64Gcc/ParaView-4.4.0/include/paraview-4.4"
setenv  ParaView_MAJOR "4.4"
setenv  ParaView_VERSION "4.4.0"
setenv  PV_PLUGIN_PATH "/opt/openfoam/3.0.0/OpenFOAM-3.0.0/platforms/linux64GccDPInt32Opt/lib/paraview-4.4"
setenv  PYTHON_LIBRARY "/opt/python/2.7.6/"
setenv  QT4_ROOT_DIR "/opt/qt/4.8.6"
setenv  QT_BIN_DIR "/opt/qt/4.8.6/bin"
setenv  QTDIR "/opt/qt/4.8.6"
setenv  QTINC "/opt/qt/4.8.6/include"
setenv  QTLIB "/opt/qt/4.8.6/lib"
setenv  QT_PLUGIN_PATH "/opt/qt/4.8.6/plugins"
setenv  WM_ARCH "linux64"
setenv  WM_ARCH_OPTION "64"
setenv  WM_CC "gcc"
setenv  WM_CFLAGS "-m64 -fPIC"
setenv  WM_COMPILE_OPTION "Opt"
setenv  WM_COMPILER "Gcc"
setenv  WM_COMPILER_LIB_ARCH "64"
setenv  WM_CXXFLAGS "-m64 -fPIC"
setenv  WM_CXX "g++"
setenv  WM_DIR "/opt/openfoam/3.0.0/OpenFOAM-3.0.0/wmake"
setenv  WM_LABEL_OPTION "Int32"
setenv  WM_LABEL_SIZE "32"
setenv  WM_LDFLAGS "-m64"
setenv  WM_LINK_LANGUAGE "c++"
setenv  WM_MPLIB "OPENMPI"
setenv  WM_OPTIONS "linux64GccDPInt32Opt"
setenv  WM_OSTYPE "POSIX"
setenv  WM_PRECISION_OPTION "DP"
setenv  WM_PROJECT_DIR "/opt/openfoam/3.0.0/OpenFOAM-3.0.0"
setenv  WM_PROJECT_INST_DIR "/opt/openfoam/3.0.0"
setenv  WM_PROJECT "OpenFOAM"
setenv  WM_PROJECT_USER_DIR "$home/OpenFOAM/$user-3.0.0"
setenv  WM_PROJECT_VERSION "3.0.0"
setenv  WM_THIRD_PARTY_DIR "/opt/openfoam/3.0.0/ThirdParty-3.0.0"

install cfMesh

wget http://sourceforge.net/projects/cfmesh/files/v1.1.1/cfMesh-v1.1.1.tgz/download
mv download cfMesh-v1.1.1.tgz
tar -xzvf cfMesh-v1.1.1.tgz
cd cfMesh-v1.1.1
find . -name files -exec sed -i ‘s/_USER//’ {} +
module load openfoam/3.0.0
./Allwmake

Parametric Turbine model with OpenFOAM+cfMesh case ready to run

I’ve made a parametric turbine case avaliable. Thank’s to my company Minesto for letting me do that.

I’ve done a parametric turbine using Ruby scripting language,
Have set up script for running the entire simulation using cfMesh for volume meshing, OpenFOAM for simulating fields. Openscad for watertunnel-geometry.

geometry simulation

The turbine geometry has pitch as input parameter, you can easily modify to suit your needs.

The simulation has watertunnel size as input parameter.

It’s a steady state MRF model and it runs in 5-10 minutes on a i7-processor. Refine to suit your needs…

 

Case:
turbine_model_bjorn_bergqvist_minesto_ab.tar

Readme file:

Author to this method is Bjorn Bergqvist. Please refer to me or communicate if
you use the turbine geometry model in your work.

Prerequisites:
OpenFOAM 2.?.? (used by 3_run_simulation.sh)
cfMesh (used by 2_create_volume_mesh.sh)
OpenSCAD (used by 2_create_volume_mesh.sh, tunnelfactor 1 is already
generated)
Ruby 2 with spliner gem (for splined pitch, otherwise any Ruby will do)
   (install with: "gem install spliner")

Description of files and directories:
Allrun
   Run through script 1_ to 3_

1_create_geometry.sh
   Not necessary to run. Turbine geometry with pitchmod=0 is
   already generated in geom/turbine.stl.
   Usage: ./1_create_geometry <pitchmod>
   were <pitchmod> is modification of turbine blade pich
   if you are unsure: use pitchmod=0

2_create_volume_mesh.sh
   Usage: ./1_create_volume_mesh.sh <tunnelfactor>
   where <tunnelfactor> is the size of the tunnel where the turbine is simulated
   if you are unsure: use tunnelfactor=1

3_run_simulation.sh
   Usage: ./3_run_simulation.sh <tunnelfactor>
   will run on 4 cpus
   (change in decomposeParDict and 3_run_simulation.sh for other cpu count)

post_moment_table.sh
   Averages moments and forces from 990 to 1000 iterations.

Allclean
   Removes generated mesh and simulation.

turbine_geometry
   The Bjorn Bergqvist(C) turbine geometry.

cfMesh.template
   Directory with files used by cfMesh.

simpleFoam.template
   Directory for simulation (steady state, MRF)

Install Octave 4.0.0 on CentOS 6.6

Download from: ftp://ftp.gnu.org/gnu/octave/octave-4.0.0.tar.gz

tar -xzvf octave-4.0.0.tar.gz
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.51-1.b16.el6_7.x86_64
./configure --exec-prefix=/opt/octave/4.0.0 --datarootdir=/opt/octave/4.0.0/share --datadir=/opt/octave/4.0.0/share --infodir=/opt/octave/4.0.0/share/info --includedir=/opt/octave/4.0.0/include --oldincludedir=/opt/octave/4.0.0/include
make -j64 # if you want to compile on 64 cores...
make install

Create module file /etc/modulefiles/octave/4.0.0:

#%Module1.0####################################################################
##
## octave modulefile
##
##
##
prepend-path PATH /opt/octave/4.0.0/bin
prepend-path LD_LIBRARY_PATH /opt/octave/4.0.0/lib
prepend-path MANPATH /opt/octave/4.0.0/share/man