You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

OpenFOAM at a glance

Purpose: Computational Fluid Dynamics
Latest version: 5.0
Availability: All
Licence: Open Source
Documentation: User's Guide

OpenFOAM is a software environment for computational fluid dynamics (CFD) and related computations.

OpenFOAM provides a C++ library and tools for setting up, meshing, solving, computing properties, and post-processing continuum mechanics, especially computational fluid dynamics. OpenFOAM includes solvers for a number of applications and provides an environment in which users can build their own.

A more detailed description can be found here.

 


 

Licence

OpenFOAM operates under a GNU GPL licence.

 


 

Available Versions

The currently available versions of OpenFOAM in our facilities are:

  • 1.7.1
  • 2.0.0
  • 2.2.0
  • 2.2.1
  • 2.3.1
  • 3.0.0
  • 1606+
  • 4.1
  • 1612+
  • 5.0

We provide an automatic configuration script to set up the environment for any version of OpenFOAM. To use it, run the following command in the target machine:

source config_OF 300

where 300 refers to version 3.0.0, and would be replaced, for instance, by 231 for 2.3.1 or 1606 for v1606+.

You can use this command to print a list of versions available in your current machine:

config_OF -h 

And this command allows you to check an installation:

test_OF 1606

Benchmark

OpenFOAM benchmark at Pirineus: actual speed-up (green) and ideal speed-up (blue) vs. number of cores for a calculation (motorBike tutorial) with OpenFOAM 2.0.0 involving 60·106 elements, simpleFOAM solver.


LSF example script

#!/bin/bash
##
# IMPORTANT NOTICE: replace the email address
# and the working directories with your own info
##
# BSUB -J openfoam
# BSUB -o openfoam.log # send standard output here
# BSUB -e openfoam.err # send error output here
#
# Send an email notice once the job is finished
# BSUB -N -u youremail@wherever
#
# Pick a queue
# BSUB -q short
#
# Indicate the number of cores
# BSUB -n 4
#
# Pick the machine
# BSUB -R collserola

date

# Set up the environment
. /opt/modules/init/bash
source config_OF 1606

# Point to your input directory (edit!) and copy it to /tmp/
input=yourworkingdirectory/
cd $TMPDIR
cp /cescascratch/$USER/$input .
cd $input
  
# Run your OpenFOAM instructions, for instance
decomposePar
mpirun -np $t [yoursolver] -parallel > log
reconstructPar
mkdir -p $SCRATCH/$LSB_JOBID
cp -R * $SCRATCH/$LSB_JOBID

date

Older versions

#!/bin/bash
##
# IMPORTANT NOTICE: replace the email address
# and the working directories with your own info
##
# BSUB -J openfoam
# BSUB -o openfoam.log # send standard output here
# BSUB -e openfoam.err # send error output here
#
# Send an email notice once the job is finished
# BSUB -N -u youremail@wherever
#
# Pick a queue
# BSUB -q short
#
# Indicate the number of cores
# BSUB -n 4
#
# Pick the machine
# BSUB -R collserola

date

# Set up the environment
. /opt/modules/init/bash
source config_OF 300

# Point to your input directory (edit!) and copy it to /tmp/
input=yourworkingdirectory/
cd $TMPDIR
cp /cescascratch/$USER/$input .
cd $input
  
# Run your OpenFOAM instructions, for instance
decomposePar
mpirun -np $t [yoursolver] -parallel > log
reconstructPar
mkdir -p $SCRATCH/$LSB_JOBID
cp -R * $SCRATCH/$LSB_JOBID

date
#!/bin/bash
##
# IMPORTANT NOTICE: replace the email address
# and the working directories with your own info
##
# BSUB -J openfoam
# BSUB -o openfoam.log # send standard output here
# BSUB -e openfoam.err # send error output here
#
# Send an email notice once the job is finished
# BSUB -N -u youremail@wherever
#
# Pick a queue
# BSUB -q short
#
# Indicate the number of cores
# BSUB -n 4
#
# Pick the machine
# BSUB -R collserola

date

# Set up the environment
. /opt/modules/init/bash
source config_OF 231

# Point to your input directory (edit!) and copy it to /tmp/
input=yourworkingdirectory/
input=directory
cd $TMPDIR
cp /cescascratch/$USER/$input .
cd $input

# Run your OpenFOAM instructions, for instance
decomposePar
mpirun -np $t [yoursolver] -parallel > log
reconstructPar
mkdir -p $SCRATCH/$LSB_JOBID
cp -R * $SCRATCH/$LSB_JOBID

date
#!/bin/bash
##
# IMPORTANT NOTICE: replace the email address
# and the working directories with your own info
##
# BSUB -J openfoam
# BSUB -o openfoam.log # send standard output here
# BSUB -e openfoam.err # send error output here
#
# Send an email notice once the job is finished
# BSUB -N -u youremail@wherever
#
# Pick a queue
# BSUB -q short
#
# Indicate the number of cores
# BSUB -n 4
#
# Pick the machine
# BSUB -R collserola

date

# Set up the environment
. /opt/modules/init/bash
source config_OF 221

# Point to your input directory (edit!) and copy it to /tmp/
input=yourworkingdirectory/
input=directory
cd $TMPDIR
cp /cescascratch/$USER/$input .
cd $input

# Run your OpenFOAM solver
decomposePar
mpirun -np $t [yoursolver] -parallel > log
reconstructPar
mkdir -p $SCRATCH/$LSB_JOBID
cp -R * $SCRATCH/$LSB_JOBID

date
#!/bin/bash
##
# IMPORTANT NOTICE: replace the email address
# and the working directories with your own info
##
# BSUB -J openfoam
# BSUB -o openfoam.log # send standard output here
# BSUB -e openfoam.err # send error output here
#
# Send an email notice once the job is finished
# BSUB -N -u youremail@wherever
#
# Pick a queue
# BSUB -q short
#
# Indicate the number of cores
# BSUB -n 4
#
# Pick the machine
# BSUB -R collserola

date

# Set up the environment
. /opt/modules/init/bash
source config_OF 200

# Point to your input directory (edit!) and copy it to /tmp/
input=yourworkingdirectory/
input=directory
cd $TMPDIR
cp /cescascratch/$USER/$input .
cd $input

# Run your OpenFOAM solver
decomposePar
mpirun -np $t [yoursolver] -parallel > log
reconstructPar
mkdir -p $SCRATCH/$LSB_JOBID
cp -R * $SCRATCH/$LSB_JOBID

date
#!/bin/bash
##
# IMPORTANT NOTICE: replace the email address
# and the working directories with your own info
##
# BSUB -J openfoam
# BSUB -o openfoam.log # send standard output here
# BSUB -e openfoam.err # send error output here
#
# Send an email notice once the job is finished
# BSUB -N -u youremail@wherever
#
# Pick a queue
# BSUB -q short
#
# Indicate the number of cores
# BSUB -n 4
#
# Pick the machine
# BSUB -R collserola

date

# Set up the environment
. /opt/modules/init/bash
module load mpt/2.08
export FOAM_INST_DIR=/prod/OPENFOAM1.7.1
FoamDotFile=$FOAM_INST_DIR/OpenFOAM-1.7.1/etc/bashrc
source /prod/OPENFOAM1.7.1/OpenFOAM-1.7.1/etc/bashrc
t=`echo $LSB_MCPU_HOSTS | awk '{ print $2}'`

# Point to your input directory (edit!) and copy it to /tmp/
input=yourworkingdirectory/
input=directory
cd $TMPDIR
cp /cescascratch/$USER/$input .
cd $input

# Run your OpenFOAM solver
decomposePar
mpirun -np $t [yoursolver] -parallel > log
reconstructPar
mkdir -p $SCRATCH/$LSB_JOBID
cp -R * $SCRATCH/$LSB_JOBID

date

Place the appropriate LSF script in a file (for instance openfoam.lsf) and submit the job with the command

bsub < openfoam.lsf

  • No labels