User Tools

Site Tools


howto:openfoam

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
howto:openfoam [2019/02/08 12:33]
ccrosby [Running OpenFOAM]
howto:openfoam [2019/02/08 12:43] (current)
ccrosby [Running OpenFOAM]
Line 9: Line 9:
 ===== Running OpenFOAM ===== ===== Running OpenFOAM =====
  
-This section describes how to run OpenFOAM on the clusters at CHPC. Versions 2.2.2, 2.3.0, 2.4.0, 3.0.1, 4.0, 5.0, 6.0, v1606+, v1612+, v1706, v1712 and v1806 and foam-extend-3.1 are installed in ''/​apps/​chpc/​compmech/​CFD/​OpenFOAM''​. ​ Source the required environment from one of the files OF222, OF240, OF301, OF40, OF50, OF60, OF1606+, OF1612+, OF1706, OF1712 ​or OF1806 respectively,​ as illustrated in the example job scripts below. ​ Also, you may need to source the file from your .bashrc file, to ensure that the compute nodes have the right environment. ​ This ** may ** not be necessary, but it is sometimes a useful workaround if you experience MPI troubles. ​ It is assumed that you are familiar with running OpenFOAM solvers in parallel, and have already set up the case directory. The Gmsh and cfMesh meshing utilities are also installed and are added to the executable path when any of the OFxxx files are sourced. OpenFOAM-extend-3.1 has been installed on an experimental basis. ​ To enable it, source the file /​apps/​chpc/​compmech/​CFD/​OpenFOAM/​OFxt31 .+This section describes how to run OpenFOAM on the clusters at CHPC. Versions 2.2.2, 2.3.0, 2.4.0, 3.0.1, 4.0, 5.0, 6.0, v1606+, v1612+, v1706, v1712v1806, v1812 and foam-extend-3.1 are installed in ''/​apps/​chpc/​compmech/​CFD/​OpenFOAM''​. ​ Source the required environment from one of the files OF222, OF240, OF301, OF40, OF50, OF60, OF1606+, OF1612+, OF1706, OF1712OF1806 ​or OF1812 ​respectively,​ as illustrated in the example job scripts below.  Please be aware that v1812 uses MPICH rather than OpenMPI, and the mpirun command ** has to ** select the use of the Infiniband network interface.  Also, you may need to source the file from your .bashrc file, to ensure that the compute nodes have the right environment. ​ This ** should ​** not be necessary, but it is sometimes a useful workaround if you experience MPI troubles. ​ It is assumed that you are familiar with running OpenFOAM solvers in parallel, and have already set up the case directory. The Gmsh and cfMesh meshing utilities are also installed and are added to the executable path when any of the OFxxx files are sourced. OpenFOAM-extend-3.1 has been installed on an experimental basis. ​ To enable it, source the file /​apps/​chpc/​compmech/​CFD/​OpenFOAM/​OFxt31 .
  
 === Using MPICH instead of OpenMPI === === Using MPICH instead of OpenMPI ===
-As an experiment, we have added a version of OpenFOAM-5.0 that uses MPICH-3.2 rather than OpenMPI.  ​We have experienced better performance and stability ​with MPICH than with OpenMPI on some other codes, therefore it was regarded as worthwhile to also try this with OpenFOAM.  The source file for this version is OF50mpich , and the mpirun command in the script ** must ** be modified to read ''​mpirun -iface ib0'',​ to force mpich to use the Infiniband network rather than Ethernet.  ​It is also not necessary to source the OF50mpich script from the .bashrc file, it only needs to be done in the job script.+There is an addition ​version of OpenFOAM-5.0 that uses MPICH-3.2 rather than OpenMPI.  ​The v1812 installation is only available ​with MPICH. ​ The source file for the OpenFOAM-5.0 ​version is OF50mpich , and the mpirun command in the script ** must ** be modified to read ''​mpirun -iface ib0'',​ to force mpich to use the Infiniband network rather than Ethernet.  ​
  
 === OpenFOAM versions === === OpenFOAM versions ===
Line 42: Line 42:
 #PBS -m abe #PBS -m abe
 #PBS -M username@email.co.za #PBS -M username@email.co.za
-### Source the openFOAM environment: ​Also place the following line in your .bashrc file +### Source the openFOAM environment:​ 
-###  Actually, this line should really be omitted, because it HAS to be in the .bashrc file anyway +. /​apps/​chpc/​compmech/​CFD/​OpenFOAM/​OF1812
-. /​apps/​chpc/​compmech/​CFD/​OpenFOAM/​OF1806+
 ##### Running commands ##### Running commands
 # Set this environment variable explicitly. # Set this environment variable explicitly.
Line 65: Line 64:
 #### End of decomposeParDict file  #### End of decomposeParDict file 
 decomposePar -force > decompose.out decomposePar -force > decompose.out
-mpirun -np $nproc -machinefile $PBS_NODEFILE $exe -parallel > foam.out+## Issue the MPIRUN command. ​ Omit -iface ib0 when using OpenMPI versions 
 +mpirun ​-iface ib0 -np $nproc -machinefile $PBS_NODEFILE $exe -parallel > foam.out
 reconstructPar -latestTime > reconstruct.out reconstructPar -latestTime > reconstruct.out
 rm -rf processor* rm -rf processor*
/var/www/wiki/data/pages/howto/openfoam.txt · Last modified: 2019/02/08 12:43 by ccrosby