OpenFOAM Usage

Last updated: June 25, 2024

Translated by Microsoft Copilot


OpenFOAM (Field Operation and Mnipulation) is a structured integrated solver set that simulates various phenomena from complex fluid calculations to molecular dynamics and electromagnetics. There are two versions of OpenFOAM: the version developed by OpenCFD Ltd (vYYMM) and the version developed by The OpenFOAM Foundation (4.x, 5.x, …), both of which are developed and distributed as open source under the GPL license.

For information on OpenFOAM, please see the following:

OpenFOAM Official Documentation (English)

OpenCAE Association


Usage Environment

  • Node Group A, B, C, Login Node
Version Kyushu University Members Academic Research Institution Members Private Users
OpenCFD Version v2106

How to Use

Preparation

The preparation before starting the calculation is done by interactive processing on the login node.
If you already have a complete case that can be executed with OpenFOAM, no preparation is necessary.

◆Environment Settings

version: v2106

$ module load gcc/8
$ module load impi/2021.12
$ module load openfoam/v2106
$ source $WM_PROJECT_DIR/etc/bashrc

◆Creation of case

Please create a case to calculate with OpenFOAM.
The location of the case can be anywhere under $HOME, but it is recommended to place it in the location specified by $WM_PROJECT_USER_DIR.

Also, tutorials are available under $WM_PROJECT_DIR/tutorials/, so you can use them as samples of cases.

◆Pre-processing

As pre-processing, perform mesh generation, mesh division for parallel execution, etc.

Please note that if these processes are judged to be too heavy to be executed on the login node, you need to prepare a case where the mesh division has been completed in advance or execute it by batch processing.

◆Compilation of program

If you are using your own program incorporated into OpenFOAM, compile it with wmake. See Compiling applications and libraries
Please put the compiled executable in $FOAM_USER_APPBIN.
If you compile a library, please put it in $FOAM_USER_LIBBIN.
These settings are done in Make/files in the program source directory.


Execution Method (Batch Job)

Here is an example of executing the sample directory copied from $WM_PROJECT_DIR/tutorials/incompressible/simpleFoam/turbineSiting in Node Group A.

#!/bin/bash
#PJM -L "rscgrp=a-batch"
#PJM -L "vnode=1"
#PJM -L "vnode-core=8"
#PJM -L "elapse=00:10:00"
#PJM -j
module load gcc/8
module load impi/2021.12
module load openfoam/v2106
source $WM_PROJECT_DIR/etc/bashrc
./turbineSiting/Allclean
./turbineSiting/Allrun