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 [2020/05/21 13:59]
ccrosby [Running OpenFOAM]
howto:openfoam [2020/07/08 09:12] (current)
ccrosby [Running OpenFOAM]
Line 18: Line 18:
 ===== Running OpenFOAM ===== ===== Running OpenFOAM =====
  
-This section describes how to run OpenFOAM on the clusters at CHPC. Versions 2.4.0, 3.0.1, 4.0, 5.0, 6.0, 7.0, v1706, v1712, v1806, v1812, v1906, v1912 and foam-extend-3.1,​ 3.2 and 4.0 are installed in ''/​apps/​chpc/​compmech/​CFD/​OpenFOAM''​. ​ Source the required environment from one of the files OF240, OF301, OF40, OF50, OF60, OF1706, OF1712, OF1806, OF1906 ​or OF1912 respectively,​ as illustrated in the example job scripts below. ​ Please be aware that versions after 5.0 and 18.06 use 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-* has been installed on an experimental basis. ​ To enable it, source the appropriate file in /​apps/​chpc/​compmech/​CFD/​OpenFOAM/,​ such as OFextend32.+This section describes how to run OpenFOAM on the clusters at CHPC. Versions 2.4.0, 3.0.1, 4.0, 5.0, 6.0, 7.0, v1706, v1712, v1806, v1812, v1906, v1912, v2006 and foam-extend-3.1,​ 3.2 and 4.0 are installed in ''/​apps/​chpc/​compmech/​CFD/​OpenFOAM''​. ​ Source the required environment from one of the files OF240, OF301, OF40, OF50, OF60, OF1706, OF1712, OF1806, OF1906OF1912 ​or OF2006 ​respectively,​ as illustrated in the example job scripts below. ​ Please be aware that versions after 5.0 and 18.06 use 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-* has been installed on an experimental basis. ​ To enable it, source the appropriate file in /​apps/​chpc/​compmech/​CFD/​OpenFOAM/,​ such as OFextend32.
  
 === Using MPICH instead of OpenMPI === === Using MPICH instead of OpenMPI ===
-There is an additional version of OpenFOAM-5.0 that uses MPICH-3.2 rather than OpenMPI. ​ The Open-FOAM-6.0,​ OpenFOAM-7.0,​ v1812, v1906 and v1912 installations are 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.  ​+There is an additional version of OpenFOAM-5.0 that uses MPICH-3.2 rather than OpenMPI. ​ The Open-FOAM-6.0,​ OpenFOAM-7.0,​ v1812, v1906v1912 andv2006 ​installations are 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 28: Line 28:
 === Step 1 === === Step 1 ===
  
-Copy the case directory you want to run into your lustre folder (''/​mnt/​lustre/<​username>''​). The job will fail unless it is run from somewhere on the lustre drive.+Copy the case directory you want to run into your lustre folder (''/​mnt/​lustre/users/<​username>''​). The job will fail unless it is run from somewhere on the lustre drive.
  
 === Step 2 === === Step 2 ===
Line 47: Line 47:
 #PBS -q normal #PBS -q normal
 #PBS -l walltime=01:​00:​00 #PBS -l walltime=01:​00:​00
-#PBS -o /​home/​username/​scratch/​foamJobs/​job01/​stdout +#PBS -o /​home/​username/​lustre/​foamJobs/​job01/​stdout 
-#PBS -e /​home/​username/​scratch/​foamJobs/​job01/​stderr+#PBS -e /​home/​username/​lustre/​foamJobs/​job01/​stderr
 #PBS -m abe #PBS -m abe
 #PBS -M username@email.co.za #PBS -M username@email.co.za
 ### Source the openFOAM environment:​ ### Source the openFOAM environment:​
-. /​apps/​chpc/​compmech/​CFD/​OpenFOAM/​OF1906+. /​apps/​chpc/​compmech/​CFD/​OpenFOAM/​OF2006
 ##### Running commands ##### Running commands
 # Set this environment variable explicitly. # Set this environment variable explicitly.
-export PBS_JOBDIR=/​home/​username/​scratch/​foamJobs/​job01+export PBS_JOBDIR=/​home/​username/​lustre/​foamJobs/​job01
 # Explicitly change to the job directory # Explicitly change to the job directory
 cd $PBS_JOBDIR cd $PBS_JOBDIR
/var/www/wiki/data/pages/howto/openfoam.txt · Last modified: 2020/07/08 09:12 by ccrosby