Supercomputing Networking Research Education Ohio Supercomputer Center Site Map Staff Directory Support
Supercomputing image

OpenFOAM, ParaView

Introduction

OpenFOAM and ParaView are installed in /usr/local for ease of access for all users.

OpenFOAM is a suite of computational fluid dynamics applications. It contains myriad solvers, both compressible and incompressible, as well as many utilities and libraries. More information can be found at http://www.opencfd.co.uk/openfoam/features.html.

ParaView is a visualization toolkit for CFD problems.

Versions

OpenFOAM version 1.5 is available at OSC.
ParaView version 3.3 is available at OSC.

Availability

OpenFOAM is available on the BALE and Glenn clusters.
ParaView is available on the BALE Cluster.

Usage

Serial Execution

For serial execution of the program, you must must first set up your software environment.  OpenFOAM requires the following OSC modules:

intel-compilers-10.0
mvapich-1.1-intel
openfoam

This can be accomplished in most account by typing the following commands:

(on BALE only)

module switch intel-compilers-9.1 intel-compilers-10.0

On Glenn and BALE:

module switch mpi mvapich-1.1-intel
module load openfoam

You can then start any of the OpenFOAM utilities by the associated command:

blockMesh or icoFoam or sonicFoam ...

To run OpenFOAM in batch mode, the following example batch script will provide you with a template.

========================================
#PBS -N serial_OpenFOAM
#PBS -l nodes=1:ppn=1
#PBS -l walltime=24:00:00
#PBS -j oe
#PBS -S /bin/bash

#Initialize OpenFOAM
# Needed for BALE
# module switch intel-compilers-9.1 intel-compilers-10.0
module switch mpi mvapich-1.1-intel
module load openfoam
export OpenFOAM_case=serial_OpenFOAM

#Move to the case directory, where the 0, constant and system directories reside
cd $PBS_O_WORKDIR

#Mesh the geometry
blockMesh

#Run the solver
icoFoam

Parallel Execution

OpenFOAM can be run in parallel as well. Parallel jobs must be submitted via the batch system.

IMPORTANT: To run in parallel, you need to also create the "decomposeParDict" file in the system directory. If you do not create this file, the decomposePar command will fail.

An example of a parallel batch script follows, which will run the model on 12 processors (three nodes, where each node has 4 processors):

========================================
#PBS -N parallel_OpenFOAM
#PBS -l nodes=3:ppn=4
#PBS -l walltime=6:00:00
#PBS -j oe
#PBS -S /bin/bash

#Initialize OpenFOAM
# Needed for BALE
# module switch intel-compilers-9.1 intel-compilers-10.0
module switch mpi mvapich-1.1-intel
module load openfoam
export OpenFOAM_case=parallel_OpenFOAM

#Move to the case directory, where the 0, constant and system directories reside
cd $PBS_O_WORKDIR

#Mesh the geometry
blockMesh

#Decompose the mesh for parallel run
decomposePar

#Run the solver
mpiexec simpleFoam -parallel

#Reconstruct the parallel results
reconstructPar

Sample Job Directory Structure

/home/yourusername/parallel_OpenFOAM
|-- 0
|   |-- R
|   |-- U
|   |-- epsilon
|   |-- k
|   |-- nuTilda
|   `-- p
|-- parallel_OpenFOAM.OpenFOAM
|-- constant
|   |-- RASProperties

|   |-- polyMesh
|   |   |-- blockMeshDict
|   |   `-- boundary
|   |-- transportProperties
|   `-- turbulenceProperties
|-- state0.pvsm
|-- state250.pvsm
|-- state500.pvsm
\-- system
    |-- controlDict
    |-- decomposeParDict
    |-- fvSchemes
    `-- fvSolution
          

Documentation

Documentation is online at http://www.opencfd.co.uk/openfoam/doc/index.html.