Kategoriarkiv: OpenFOAM

”The” open source CFD tool http://www.openfoam.org

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+"

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"

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 OpenFOAM 2.4.0 on CentOS 6.6

First install boost, qt and cmake

Get it:

mkdir -p /opt/openfoam/2.4.0
cd /opt/openfoam/2.4.0
wget http://downloads.sourceforge.net/foam/OpenFOAM-2.4.0.tgz?use_mirror=mesh
wget http://downloads.sourceforge.net/foam/ThirdParty-2.4.0.tgz?use_mirror=mesh
mv OpenFOAM-2.4.0.tgz\?use_mirror\=mesh OpenFOAM-2.4.0.tgz
mv ThirdParty-2.4.0.tgz\?use_mirror\=mesh ThirdParty-2.4.0.tgz
tar -xzvf OpenFOAM-2.4.0.tgz
tar -xzvf ThirdParty-2.4.0.tgz

Prepare:

yum install qtwebkit qtwebkit-devel  #from epel
module load boost/1.49.0    #installation
module load qt/4.8.6        #installation
module load openmpi-x86_64  #from openmpi-1.8.1-1.el6.x86_64
module load cmake/2.8.12.2  #installation

In OpenFOAM-2.4.0/etc/bashrc

foamInstall=/opt/openfoam/$WM_PROJECT_VERSION
#and
foamCompiler=ThirdParty

In OpenFOAM-2.4.0/etc/config/settings.sh

gcc_version=gcc-4.8.4  #from gcc-4.8.2

Source it:

. OpenFOAM-2.4.0/etc/bashrc

Compile on all cores:

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

Compile gcc:

cd ThirdParty-2.4.0
wget ftp://ftp.gnu.org/gnu/gmp/gmp-5.1.2.tar.bz2
tar -xjvf gmp-5.1.2.tar.bz2
wget ftp://ftp.gnu.org/gnu/mpfr/mpfr-3.1.2.tar.bz2
tar -xjvf mpfr-3.1.2.tar.bz2
wget http://www.multiprecision.org/mpc/download/mpc-1.0.1.tar.gz
tar -xzvf mpc-1.0.1.tar.gz
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

edit makeGcc:

gccPACKAGE=gcc-4.8.4
./makeGcc

Control if gcc works after sourcing baschrc again ”. ../OpenFOAM-2.4.0/etc/bashrc”

which gcc
output:/opt/openfoam/2.4.0/ThirdParty-2.4.0/platforms/linux64/gcc-4.8.4/bin/gcc

Continue in ThirdParty:

./Allwmake
 ./makeParaView4

Time to compile OpenFOAM 2.4.0!!!

cd ../OpenFOAM-2.4.0
 ./Allwmake > build.log|tail -f build.log

The module file: /etc/modulefiles/openfoam/2.4.0

 

#%Module1.0####################################################################
##
## openfoam/2.4.0 modulefile
##
## 
##
proc ModulesHelp { } {
 puts stderr "\tSet OpenFOAM 2.4.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/2.4.0/ThirdParty-2.4.0/platforms/linux64Gcc/gperftools-svn/bin:/opt/openfoam/2.4.0/ThirdParty-2.4.0/platforms/linux64Gcc/ParaView-4.1.0/bin:/opt/openfoam/2.4.0/ThirdParty-2.4.0/platforms/linux64/gcc-4.8.4/bin:$home/OpenFOAM/$user-2.4.0/platforms/linux64GccDPOpt/bin:/opt/openfoam/2.4.0/site/2.4.0/platforms/linux64GccDPOpt/bin:/opt/openfoam/2.4.0/OpenFOAM-2.4.0/platforms/linux64GccDPOpt/bin:/opt/openfoam/2.4.0/OpenFOAM-2.4.0/bin:/opt/openfoam/2.4.0/OpenFOAM-2.4.0/wmake:/usr/lib64/openmpi/bin"
prepend-path LD_LIBRARY_PATH "/opt/openfoam/2.4.0/ThirdParty-2.4.0/platforms/linux64Gcc/gperftools-svn/lib:/opt/openfoam/2.4.0/ThirdParty-2.4.0/platforms/linux64Gcc/ParaView-4.1.0/lib/paraview-4.1:/opt/openfoam/2.4.0/OpenFOAM-2.4.0/platforms/linux64GccDPOpt/lib/openmpi-system:/opt/openfoam/2.4.0/ThirdParty-2.4.0/platforms/linux64GccDPOpt/lib/openmpi-system:/usr/lib64/openmpi/lib:/opt/openfoam/2.4.0/ThirdParty-2.4.0/platforms/linux64/mpc-1.0.1/lib:/opt/openfoam/2.4.0/ThirdParty-2.4.0/platforms/linux64/mpfr-3.1.2/lib:/opt/openfoam/2.4.0/ThirdParty-2.4.0/platforms/linux64/gmp-5.1.2/lib:/opt/openfoam/2.4.0/ThirdParty-2.4.0/platforms/linux64/gcc-4.8.4/lib64:$home/OpenFOAM/$user-2.4.0/platforms/linux64GccDPOpt/lib:/opt/openfoam/2.4.0/site/2.4.0/platforms/linux64GccDPOpt/lib:/opt/openfoam/2.4.0/OpenFOAM-2.4.0/platforms/linux64GccDPOpt/lib:/opt/openfoam/2.4.0/ThirdParty-2.4.0/platforms/linux64GccDPOpt/lib:/opt/openfoam/2.4.0/OpenFOAM-2.4.0/platforms/linux64GccDPOpt/lib/dummy"
setenv BOOST_ARCH_PATH "/opt/openfoam/2.4.0/ThirdParty-2.4.0/platforms/linux64Gcc/boost-system"
setenv CGAL_ARCH_PATH "/opt/openfoam/2.4.0/ThirdParty-2.4.0/platforms/linux64Gcc/CGAL-4.6"
setenv FOAM_APPBIN "/opt/openfoam/2.4.0/OpenFOAM-2.4.0/platforms/linux64GccDPOpt/bin"
setenv FOAM_APP "/opt/openfoam/2.4.0/OpenFOAM-2.4.0/applications"
setenv FOAM_ETC "/opt/openfoam/2.4.0/OpenFOAM-2.4.0/etc"
setenv FOAM_EXT_LIBBIN "/opt/openfoam/2.4.0/ThirdParty-2.4.0/platforms/linux64GccDPOpt/lib"
setenv FOAM_INST_DIR "/opt/openfoam/2.4.0"
setenv FOAM_JOB_DIR "/opt/openfoam/2.4.0/jobControl"
setenv FOAM_LIBBIN "/opt/openfoam/2.4.0/OpenFOAM-2.4.0/platforms/linux64GccDPOpt/lib"
setenv FOAM_MPI "openmpi-system"
setenv FOAM_RUN "$home/OpenFOAM/$user-2.4.0/run"
setenv FOAM_SETTINGS ""
setenv FOAM_SIGFPE ""
setenv FOAM_SITE_APPBIN "/opt/openfoam/2.4.0/site/2.4.0/platforms/linux64GccDPOpt/bin"
setenv FOAM_SITE_LIBBIN "/opt/openfoam/2.4.0/site/2.4.0/platforms/linux64GccDPOpt/lib"
setenv FOAM_SOLVERS "/opt/openfoam/2.4.0/OpenFOAM-2.4.0/applications/solvers"
setenv FOAM_SRC "/opt/openfoam/2.4.0/OpenFOAM-2.4.0/src"
setenv FOAM_TUTORIALS "/opt/openfoam/2.4.0/OpenFOAM-2.4.0/tutorials"
setenv FOAM_USER_APPBIN "$home/OpenFOAM/$user-2.4.0/platforms/linux64GccDPOpt/bin"
setenv FOAM_USER_LIBBIN "$home/OpenFOAM/$user-2.4.0/platforms/linux64GccDPOpt/lib"
setenv FOAM_UTILITIES "/opt/openfoam/2.4.0/OpenFOAM-2.4.0/applications/utilities"
setenv GMP_ARCH_PATH "/opt/openfoam/2.4.0/ThirdParty-2.4.0/platforms/linux64/gmp-5.1.2"
setenv MANPATH "/opt/openfoam/2.4.0/ThirdParty-2.4.0/platforms/linux64/gcc-4.8.4/man:"
setenv MPFR_ARCH_PATH "/opt/openfoam/2.4.0/ThirdParty-2.4.0/platforms/linux64/mpfr-3.1.2"
setenv MPI_ARCH_PATH "/usr/lib64/openmpi"
setenv MPI_BIN "/usr/lib64/openmpi/bin"
setenv MPI_BUFFER_SIZE "20000000"
setenv MPI_COMPILER "openmpi-x86_64"
setenv MPI_FORTRAN_MOD_DIR "/usr/lib64/gfortran/modules/openmpi-x86_64"
setenv MPI_INCLUDE "/usr/include/openmpi-x86_64"
setenv MPI_LIB "/usr/lib64/openmpi/lib"
setenv MPI_MAN "/usr/share/man/openmpi-x86_64"
setenv MPI_PYTHON_SITEARCH "/usr/lib64/python2.6/site-packages/openmpi"
setenv MPI_SUFFIX "_openmpi"
setenv MPI_SYSCONFIG "/etc/openmpi-x86_64"
setenv ParaView_DIR "/opt/openfoam/2.4.0/ThirdParty-2.4.0/platforms/linux64Gcc/ParaView-4.1.0"
setenv ParaView_INCLUDE_DIR "/opt/openfoam/2.4.0/ThirdParty-2.4.0/platforms/linux64Gcc/ParaView-4.1.0/include/paraview-4.1"
setenv ParaView_MAJOR "4.1"
setenv ParaView_VERSION "4.1.0"
setenv PV_PLUGIN_PATH "/opt/openfoam/2.4.0/OpenFOAM-2.4.0/platforms/linux64GccDPOpt/lib/paraview-4.1"
setenv PYTHONPATH "/usr/lib64/python2.6/site-packages/openmpi"
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/2.4.0/OpenFOAM-2.4.0/wmake"
setenv WM_LDFLAGS "-m64"
setenv WM_LINK_LANGUAGE "c++"
setenv WM_MPLIB "SYSTEMOPENMPI"
setenv WM_OPTIONS "linux64GccDPOpt"
setenv WM_OSTYPE "POSIX"
setenv WM_PRECISION_OPTION "DP"
setenv WM_PROJECT_DIR "/opt/openfoam/2.4.0/OpenFOAM-2.4.0"
setenv WM_PROJECT_INST_DIR "/opt/openfoam/2.4.0"
setenv WM_PROJECT "OpenFOAM"
setenv WM_PROJECT_USER_DIR "$home/OpenFOAM/$user-2.4.0"
setenv WM_PROJECT_VERSION "2.4.0"
setenv WM_THIRD_PARTY_DIR "/opt/openfoam/2.4.0/ThirdParty-2.4.0"

Calculate pressure on incompressible

Install foamCalcEx

#(if necessary yum install mercurial)
hg clone https://code.google.com/p/foamcalcex/
cd foamcalcex
./Allwmake
#usage
foamCalcEx multiplyDivide p multiply -value 1000 -latestTime   #creates p_multiply_value
ptot -latestTime  #creates ptot based on p
foamCalcEx multiplyDivide ptot multiply -value 1000 -latestTime  #creates ptot_multiply_value

Dirty script for dirty meshes

If you have a messy polyMesh you might use this script. Modify it to suit your needs.

#!/bin/sh
# dirty script for dirty meshes
# author Bjorn Bergqvist
# http://www.discretizer.se
# removes cells which is/have:
# zeroVolumeCells, skewFaces, underdeterminedCells and lowQualityTetFaces
#
# if you have to type something before OpenFOAM commands
# qsub... or somthing
submit=""

# create a batch file for setSet
createBatchFile() {
  counter=0
  echo "cellSet cellsToKeep new" > $2
  for i in `grep Writing $1 |awk '{ print $NF }'`
    do

      if [ $i == "zeroVolumeCells" ]; then
        echo "cellSet cellsToKeep add cellToCell zeroVolumeCells any" >> $2
        echo `grep $i log.checkMesh`
        counter=$((counter+1)) 
      fi
      if [ $i == "skewFaces" ]; then
        echo "cellSet cellsToKeep add faceToCell skewFaces any" >> $2
        echo `grep $i log.checkMesh`
        counter=$((counter+1)) 
      fi
      if [ $i == "underdeterminedCells" ]; then
        echo "cellSet cellsToKeep add cellToCell underdeterminedCells any" >> $2
        echo `grep $i log.checkMesh`
        counter=$((counter+1)) 
      fi
      if [ $i == "lowQualityTetFaces" ]; then
        echo "cellSet cellsToKeep add faceToCell lowQualityTetFaces any" >> $2
        echo `grep $i log.checkMesh`
        counter=$((counter+1)) 
      fi
    done
    echo "cellSet cellsToKeep invert" >> $2
    echo "cellSet cellsToKeep subset" >> $2
    echo "quit" >> $2
    return $counter
}

logfile=log.txt
echo "" > $logfile

while :
do
  $submit checkMesh -allGeometry -allTopology -latestTime > log.checkMesh
  checkString=`grep 'The mesh has multiple regions' log.checkMesh`
  if [ ! ${#checkString} == 0 ]; then
    echo "multiple regions: splitMeshRegions"
    $submit splitMeshRegions -largestOnly >> $logfile
    $submit subsetMesh -overwrite region0 >> $logfile
    $submit createPatch -overwrite >> $logfile
    echo "rerun checkMesh"
    $submit checkMesh -allGeometry -allTopology -latestTime > log.checkMesh
  fi
  createBatchFile log.checkMesh batchForDeleting
  fileOk=$?
  echo "fileOk $fileOk"
  if [ $fileOk == 0 ]; then
    echo "nothing to do"
    exit 0
  fi
  $submit setSet -latestTime -batch batchForDeleting > $logfile
  $submit subsetMesh cellsToKeep >> $logfile
  $submit createPatch -overwrite >> $logfile
done

Typical output:

<<Writing 4 zero volume cells to set zeroVolumeCells
<<Writing 232 skew faces to set skewFaces
<<Writing 118 faces with low quality or negative volume decomposition tets to set lowQualityTetFaces
<<Writing 3806 under-determined cells to set underdeterminedCells
fileOk 4
multiple regions: splitMeshRegions
rerun checkMesh
<<Writing 114 skew faces to set skewFaces
<<Writing 1732 under-determined cells to set underdeterminedCells
fileOk 2
multiple regions: splitMeshRegions
rerun checkMesh
<<Writing 6 skew faces to set skewFaces
<<Writing 608 under-determined cells to set underdeterminedCells
fileOk 2
multiple regions: splitMeshRegions
rerun checkMesh
<<Writing 247 under-determined cells to set underdeterminedCells
fileOk 1
multiple regions: splitMeshRegions
rerun checkMesh
<<Writing 125 under-determined cells to set underdeterminedCells
fileOk 1
<<Writing 72 under-determined cells to set underdeterminedCells
fileOk 1
<<Writing 44 under-determined cells to set underdeterminedCells
fileOk 1
<<Writing 27 under-determined cells to set underdeterminedCells
fileOk 1
<<Writing 20 under-determined cells to set underdeterminedCells
fileOk 1
<<Writing 12 under-determined cells to set underdeterminedCells
fileOk 1
<<Writing 5 under-determined cells to set underdeterminedCells
fileOk 1
<<Writing 3 under-determined cells to set underdeterminedCells
fileOk 1
<<Writing 1 under-determined cells to set underdeterminedCells
fileOk 1
<<Writing 1 under-determined cells to set underdeterminedCells
fileOk 1
fileOk 0
nothing to do