OpenFOAM/en: Difference between revisions

From Alliance Doc
Jump to navigation Jump to search
(Updating to match new version of source page)
 
(Updating to match new version of source page)
Line 2: Line 2:


[[Category:Software]]
[[Category:Software]]
The OpenFOAM (Open Field Operation and Manipulation) CFD Toolbox is a free, open source software package for computational fluid dynamics. OpenFOAM has an extensive range of features to solve anything from complex fluid flows involving chemical reactions, turbulence and heat transfer, to solid dynamics and electromagnetics.
The [https://www.openfoam.com/ OpenFOAM] (Open Field Operation and Manipulation) CFD Toolbox is a free, open source software package for computational fluid dynamics. OpenFOAM has an extensive range of features to solve anything from complex fluid flows involving chemical reactions, turbulence and heat transfer, to solid dynamics and electromagnetics.


===Modulefiles===
===Module files===
{{Command|module load openfoam}} will give you a recent version.
{{Command|module load openfoam}} will give you a recent version.


The OpenFOAM development community is divided into two parts:
The OpenFOAM development community consists of:
* The OpenFOAM Foundation Ltd., with web sites [https://openfoam.org/ openfoam.org] and [https://cfd.direct/ cfd.direct]
* The OpenFOAM Foundation Ltd., with web sites [https://openfoam.org/ openfoam.org] and [https://cfd.direct/ cfd.direct]
* OpenCFD Ltd., with web site [https://www.openfoam.com/ openfoam.com]
* OpenCFD Ltd., with web site [https://www.openfoam.com/ openfoam.com]
Line 18: Line 18:


===Usage===
===Usage===
OpenFOAM requires substantial preparation of your environment. In order to run OpenFOAM commands (such as <code>paraFoam</code>, <code>blockMesh</code>, etc), you must load a [[Using modules| modulefile]].
OpenFOAM requires substantial preparation of your environment. In order to run OpenFOAM commands (such as <code>paraFoam</code>, <code>blockMesh</code>, etc), you must load a [[Using modules| module file]].


Here is an example of a serial submission script for OpenFOAM 5.0:
Here is an example of a serial submission script for OpenFOAM 5.0:

Revision as of 21:29, 29 March 2018

Other languages:

The OpenFOAM (Open Field Operation and Manipulation) CFD Toolbox is a free, open source software package for computational fluid dynamics. OpenFOAM has an extensive range of features to solve anything from complex fluid flows involving chemical reactions, turbulence and heat transfer, to solid dynamics and electromagnetics.

Module files

Question.png
[name@server ~]$ module load openfoam

will give you a recent version.

The OpenFOAM development community consists of:

Up to version 2.3.1, released in December 2014, the release histories appear to be the same. Compute Canada module names after 2.3.1 which begin with "v" are derived from the .com branch; those beginning with a digit are derived from the .org branch (for example, openfoam/v1712).

See Using modules for more on module commands.

Documentation

OpenFOAM.com documentation and CFD Direct user guide.

Usage

OpenFOAM requires substantial preparation of your environment. In order to run OpenFOAM commands (such as paraFoam, blockMesh, etc), you must load a module file.

Here is an example of a serial submission script for OpenFOAM 5.0:

File : submit.sh

#!/bin/bash
#SBATCH --time=00:01:00
#SBATCH --account=def-someuser

module purge
module load openfoam/5.0

blockMesh
icoFoam


Here is an example of a parallel submission script:

File : submit.sh

#!/bin/bash
#SBATCH --account=def-someuser
#SBATCH --ntasks=4               # number of MPI processes
#SBATCH --mem-per-cpu=1024M      # memory; default unit is megabytes
#SBATCH --time=0-00:10           # time (DD-HH:MM)

module purge
module load openfoam/5.0

decomposePar
blockMesh
setFields
srun interFoam -parallel


Mesh preparation (blockMesh) may be fast enough to be done at the command line (see Running jobs). The solver (icoFoam and others) is usually the most expensive step and should always be submitted as a Slurm job except in very small test cases or tutorials.

Performance

OpenFOAM can emit a lot of debugging information in very frequent small writes (e.g. hundreds per second). This may lead to poor performance on our network file systems. If you are in stable production and don't need the debug output, you can reduce or disable it with:

[name@server ~]$ mkdir -p $HOME/.OpenFOAM/$WM_PROJECT_VERSION
[name@server ~]$ cp $WM_PROJECT_DIR/etc/controlDict $HOME/.OpenFOAM/$WM_PROJECT_VERSION/


Then edit the debugSwitches dictionary in $HOME/.OpenFOAM/$WM_PROJECT_VERSION/controlDict, changing flags from values >0 to 0. (Contribution from C. Lane)