Source pack installation of OpenFOAM v3.0+ into RHL

12
Source pack installa0on of OpenFOAM v3.0+ into RHL Open CAE Local Study Mee0ng Y. Takagi Jan. 16, 2016

Transcript of Source pack installation of OpenFOAM v3.0+ into RHL

Page 1: Source pack installation of OpenFOAM v3.0+ into RHL

Source  pack  installa0on  of  OpenFOAM  v3.0+  into  RHL

Open  CAE  Local  Study  Mee0ng  Y.  Takagi  

Jan.  16,  2016

Page 2: Source pack installation of OpenFOAM v3.0+ into RHL

Download  the  packages  from  the  official  website

Page 3: Source pack installation of OpenFOAM v3.0+ into RHL

Procedure  of  installa0on

Assump0on:  OpenFOAM  3.0.x  has  already  been  installed.  

1.  Download  the  source  packages  and  extract  them.  2.  Edit  the  configura0on/seUng  files.  3.  Allwmake  4.  Test  (foamInstallationTest)  

Page 4: Source pack installation of OpenFOAM v3.0+ into RHL

Directory  configura0on

•  Under  OpenFOAM-­‐v3.0+  

•  Under  ThirdParty-­‐v3.0+:  Same  as  3.0.x

Allwmake*  README.md  bin/    etc/    pla\orms/  tutorials/  COPYING    applica0ons/  doc/    src/    wmake/  

Red: make by yourself Blue: generated later

Page 5: Source pack installation of OpenFOAM v3.0+ into RHL

Download  the  source  packages  and  extract  them

•  OpenFOAM  main  source  code:  A`er  downloading,    

•  OpenFOAM  ThirdParty:  

•  No  compiling  ThirdParty  so`wares.  

$   tar  zxvf  OpenFOAM-­‐v3.0+.tgz  

$   ln  -­‐s  ThirdParty-­‐3.0.1  ThirdParty-­‐v3.0+  

Page 6: Source pack installation of OpenFOAM v3.0+ into RHL

Edit  the  configura0on/seUng  files

•  Edit  OpenFOAM-­‐v3.0p  environment  file  

$   cd  /opt/OpenFOAM-­‐v3.0+  $   vi  etc/bashrc  

#  Location  of  the  OpenFOAM  installation  #  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  #  foamInstall=$HOME/$WM_PROJECT  #  foamInstall=~$WM_PROJECT  foamInstall=/opt/$WM_PROJECT  #  foamInstall=/usr/local/$WM_PROJECT  

#-­‐  Compiler  location:  #        foamCompiler=  system  |  ThirdParty  (OpenFOAM)  foamCompiler=ThirdParty  

Page 7: Source pack installation of OpenFOAM v3.0+ into RHL

Edit  the  configura0on/seUng  files

$   vi  ../OpenFOAM-­‐v3.0+/etc/bashrc  

#-­‐  Label  size:  #        WM_LABEL_SIZE  =  32  |  64  export  WM_LABEL_SIZE=64  

#-­‐  MPI  implementation:  #        WM_MPLIB  =  SYSTEMOPENMPI  |  OPENMPI  |  SYSTEMMPI  |  \  MPICH  |  MPICH-­‐GM  |  HPMPI  #                              |  MPI  |  QSMPI  |  SGIMPI  export  WM_MPLIB=OPENMPI  

Page 8: Source pack installation of OpenFOAM v3.0+ into RHL

Edit  the  configura0on/seUng  files

•  Edit  OpenFOAM-­‐v3.0+  compiler/libraries  seUng  file  

$   vi  etc/config/settings.sh  

case  "${foamCompiler}"  in  OpenFOAM  |  ThirdParty)          case  "$WM_COMPILER"  in          Gcc  |  Gcc48)                  gcc_version=gcc-­‐4.8.4                  gmp_version=gmp-­‐5.1.2                  mpfr_version=mpfr-­‐3.1.2                  mpc_version=mpc-­‐1.0.1  

Page 9: Source pack installation of OpenFOAM v3.0+ into RHL

Edit  the  configura0on/seUng  files

•  Edit  CGAL.sh  $   vi  etc/config/CGAL.sh  

#  Description  #          Setup  file  for  CGAL  (&  boost)  include/libraries.  #          Sourced  from  OpenFOAM-­‐<VERSION>/etc/bashrc  #-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐  

boost_version=boost_1_58_0  cgal_version=CGAL-­‐4.7  

Page 10: Source pack installation of OpenFOAM v3.0+ into RHL

Compile  the  tools/libraries  

•  Build  OpenFOAM:  

•  A`er  the  compiling,  check  it:  

$   .  /opt/OpenFOAM/OpenFOAM-­‐v3.0+/etc/bashrc  $   cd  /opt/OpenFOAM/OpenFOAM-­‐v3.0+/  $   export  WM_NCOMPPROCS=4  #  depending  on  your  machine  $   ./Allwmake  

$   .  /opt/OpenFOAM/OpenFOAM-­‐v3.0+/etc/bashrc  $   foamInstallationTest  

Page 11: Source pack installation of OpenFOAM v3.0+ into RHL

Compile  the  tools/libraries

•  A`er  the  compiling,  check  a  tutorial  run  (pitzDaily):  

$   .  /opt/OpenFOAM/OpenFOAM-­‐3.0.x/etc/bashrc  $   mkdir  –p  $FOAM_RUN  $   run  $   cp  –r  $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily  ./  $   blockMesh  $   simpleFoam  $   paraFoam  

Page 12: Source pack installation of OpenFOAM v3.0+ into RHL

Here  we  go!  Enjoy!