OpenFOAM MPI Workflow Example
Tip
Your environment will need to have a job scheduler such as Slurm, which can be set up by following the Flight Solo cluster build methods.
Prepare Job
-
Start by downloading this job directory in a location of your choice.
flight silo file pull openflight:openfoam/motorBike.tar.gz
-
Decompress it, which will make a directory called
motorBike
.tar xf motorBike.tar.gz
-
Update the job configuration.
- Open
motorBike/system/decomposeParDict
and set:X
to the number of processes to run across.A B C
to be numbers such thatA
*B
*C
=X
- Open
-
Update the job script.
- Open
motorBike/motorbike-example.sh
.- Set
-n X
to the number of processes to run across. - Set
source
to point to the location of OpenFOAM. - Set
$HOME/motorBike
to the location of the motorBike job.
- Set
- Open
Run Job
- Submit the job script to the scheduler.
sbatch motorBike/motorbike-example.sh
View Results
Once the job has finished running, the results can be visualised through a desktop session.
-
Connect to VNC or web-suite desktop (For more information on launching desktops, see the Flight Desktop section).
-
Open a terminal and navigate to the job directory.
-
Launch Paraview
source /opt/apps/OpenFOAM/OpenFOAM-v2212/etc/bashrc paraFoam
-
In the window that opens, go to the bottom left and scroll down to "Mesh parts". Select all the boxes except
frontAndBack
,inlet
,internalMesh
,outlet
andupperWall
, and then click apply. -
You should now see a motorbike along with a rider and the forces visualised on them!