Skip to content

OpenFOAM MPI Workflow Example


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

  1. Start by downloading this job directory in a location of your choice.

    flight silo file pull openflight:openfoam/motorBike.tar.gz

  2. Decompress it, which will make a directory called motorBike.

    tar xf motorBike.tar.gz

  3. Update the job configuration.

    1. Open motorBike/system/decomposeParDict and set:
      1. X to the number of processes to run across.
      2. A B C to be numbers such that A*B*C=X
  4. Update the job script.

    1. Open motorBike/
      1. Set -n X to the number of processes to run across.
      2. Set source to point to the location of OpenFOAM.
      3. Set $HOME/motorBike to the location of the motorBike job.

Run Job

  1. Submit the job script to the scheduler.
    sbatch motorBike/

View Results

Once the job has finished running, the results can be visualised through a desktop session.

  1. Connect to VNC or web-suite desktop (For more information on launching desktops, see the Flight Desktop section).

  2. Open a terminal and navigate to the job directory.

  3. Launch Paraview

    source /opt/apps/OpenFOAM/OpenFOAM-v2212/etc/bashrc

  4. 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 and upperWall, and then click apply.

  5. You should now see a motorbike along with a rider and the forces visualised on them!