Skip to content

Docs CSC now features an automatic Finnish translation. Click here for more information.

Warning!

Puhti and Mahti are being decommissioned in stages, and their storage areas will become fully unavailable from 15 October 2026. Clean up unnecessary files and move any data you need to keep by 31 August 2026. See the Roihu data migration guide for instructions on transferring your data to Roihu.

Puhti scratch is very full: keep only active data there and move or delete everything else. No new Puhti scratch quota will be granted.

OpenFOAM

OpenFOAM (for "Open-source Field Operation And Manipulation") is a C++ toolbox for the development of customized numerical solvers, and pre-/post-processing utilities for the solution of continuum mechanics problems, most prominently including computational fluid dynamics (CFD). 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 (by OpenCFD Ltd).

There are different variants of OpenFOAM, of which at CSC - IT Center for Science computer platforms, are currently installed different versions from OpenFOAM Foundation and OpenCFD Ltd.

License

OpenFOAM is freely available and open source, and is licensed under the GNU General Public Licence (Gnu GPL or GPL), with GPL license typical characteristics for exploitation.

Available

Different versions of OpenFOAM, provided by OpenFOAM Foundation and OpenCFD, are installed on Roihu, Mahti and LUMI servers.

Usage

After logging in to the server, give the command

module -r spider '.*openfoam.*'

On LUMI, you need to first load the module environment

module use /appl/local/csc/modulefiles
module spider openfoam

The command lists available OpenFOAM versions on the server. To get more information about a specific version, for example, about OpenFOAM Foundation's version 12, use the command

module spider openfoam-org/12

To launch a specific version (say, version 12), give the command

module load openfoam-org/12

OpenCFD's versions are recognized by a version string starting with letter v, i.e., to launch version openfoam/v2412, give the command

module load openfoam/v2412

Use collated parallel I/O method on CSC's servers

  • on CSC's computing servers, use OpenFOAM's collated I/O method whenever possible
  • using the collated method is absolutely necessary when the model size is large and a lot of disk I/O is necessary

The file system used on CSC's computing platforms, Roihu, Mahti and LUMI, is Lustre, which is optimized for reading and writing small number of files. The number of output files written by OpenFOAM can easily become very large, even up to millions, if the mesh size is large, and if field variables are written to the disk every time step. Such I/O operations will cause the file system to become heavily overloaded, and the whole computing platform can get jammed even by a few simultaneous OpenFOAM users.

The above described traditional parallel I/O method of OpenFOAM can be replaced in the latest versions of OpenFOAM with the collated parallel I/O method, where the output data is written only in few files. Considering HPC platforms using parallel files systems, this has been a significant improvement to OpenFOAM.

In test runs on CSC's servers with the collated I/O method, significant difference in throughput time has not been recognized compared to non-collated method. In some tests, collated method has shown to be slightly faster. Our recommendation is to use collated method whenever it is practicable.

An example

Mahti server contains 128 cores per node. If the total subdomain number in the model is 256, a user may allocate two full nodes for the solver run. Decomposition batch job can then be done using the command

decomposePar -fileHandler collated -ioRanks '(0 128 256)'

and two directories processors256_0-127 and processors256_128-255 are created. For the solver run, the command will then be

pimpleFoam -parallel -fileHandler collated -ioRanks '(0 128 256)'

In that way, 128 processes are launched on both nodes, and on each node one process is a master process. Reconstruction of the data is done in the batch job with the command

reconstructPar

In this example, the pressure results of domains 0 to 127 per time step are written into a single file. In a non-collated method, the same results would have been written into 128 separate files. This tremendous decrease in the number of output files happens naturally with all the rest of the field variables also.

I/O operations in the collated method are based on threaded sub-processes, and therefore do not cause any time overhead for the simulation compared to non-collated method.

Support

If you encounter any issue while using OpenFOAM on CSC's servers, please send an email to CSC Service Desk.

More information