All Products
Document Center

Use OpenFOAM to perform high-performance computing

Last Updated: Sep 07, 2021

This topic uses Open Source Field Operation and Manipulation (OpenFOAM) as an example to show how to perform high-performance computing by using an Elastic High Performance Computing (E-HPC) cluster.

Background information

OpenFOAM is a C++ toolbox for the development of customized numerical solvers, and pre-/post-processing utilities for the solution of continuum mechanics problems, including computational fluid dynamics (CFD). For more information, visit the OpenFOAM official website.

In this topic, OpenFOAM solver named simpleFoam is used as an example to calculate the motorcycle outflow field. Example directory: $FOAM_TUTORIALS/incompressible/simpleFoam/motorBike/.


  1. Log on to the E-HPC console.

  2. Create a cluster named OpenFOAM.

    For more information, see Create a cluster. Set the following parameters:

    • Scheduler: Select pbs.

    • Other Software: Install openfoam-openmpi 5.0 and openmpi 1.10.7.


    If you use an existing cluster, you can install the preceding software in it. For more information, see Install software.

  3. Create a sudo user named foamtest.

    For more information, see Create a user.

  4. Use CLI to create and submit a job.

    1. On the Cluster page of the E-HPC console, find OpenFOAM cluster. Click Connect.

    2. In the Connect panel, specify a username, password, and port number for foamtest. Then, click Connect via SSH.

    3. Run the following command to create and submit a job:

      export MODULEPATH=/opt/ehpcmodulefiles/   # The environment variables on which the module command depends.
      module load openfoam-openmpi/5.0
      module load openmpi/1.10.7
      mkdir /home/foamtest/motorBike   # Create a motorBike folder.
      cp -r /opt/OpenFOAM/OpenFOAM-5.0/tutorials/incompressible/simpleFoam/motorBike/* /home/foamtest/motorBike  # Copy the source code in the motorBike example file to the /home/foamtest/motorBike directory.
      cd /home/foamtest/motorBike
      source /opt/OpenFOAM/OpenFOAM-5.0/etc/bashrc
      ./Allrun    # Run the motorBike example.
  5. Run the following command to view the result file generated for the OpenFOAM job:

    cat log.blockMesh

    The following figure shows the test result.