OpenFOAM (Open source Field Operation And Manipulation) is a numerical CFD (Computational Fluid Dynamics) solver and a pre/postprocessing software suite.
Special care has been taken to enable automatic parallelization of applications written using OpenFOAM high-level syntax. Parallelization can be further extended by using a clustering software such as OpenMPI that distributes simulation workload to multiple worker nodes.
Pre/post-processing tools like ParaView enable graphical examination of the simulation set-up and results.
A parellel version called OpenFOAM-extend is a fork maintained by Wikki Ltd that provides a large collection of community generated code contributions that can be used with the official OpenFOAM version.
What does it actually do?
OpenFOAM is aimed at solving continuum mechanical problems. Continuum mechanics deals with the analysis of kinematics and the mechanical behavior of materials modeled as a continuous mass rather than as discrete particles.
OpenFOAM has an extensive range of features to solve complex gas/fluid flows involving chemical reactions, turbulence, heat transfer, solid dynamics, electromagnetics and much more!
The software suite is used widely in the engineering and scientific fields concerning simulations of fluid flows in pipes, engines, combustion chambers, pumps and other diverse use cases.
How is it used?
In general, the workflow adheres to the following steps:
- physical modeling
- input mesh generation
- visualizing the input geometry
- setting simulation parameters
- running the simulation
- examining output data
- visualizing the output data
- refining the simulation parameters
- rerunning the simulation to achieve desired results
Later we will see an example of a 2d water flow simulation following these steps.
What can Seravo do to help a customer running OpenFOAM?
Seravo can help your organization by building and maintaining a platform for running OpenFOAM and related software.
Our services include:
- installing the host platform OS
- host platform security updates and maintenance
- compiling, installing and updating the OpenFOAM and OpenFOAM-extend suites
- cluster set-up and maintenance
- remote use of visualization software
Seravo has provided above-mentioned services in building a multinode OpenFOAM cluster to its customers.
OpenFOAM example: a simplified laminar flow 2d-simulation of a breaking water dam hitting an obstacle in an open container
N.B. Some steps are omitted for brevity!
Input files for simulation are ascii text files with defined open format.
Inside the working directory of a simulation case, we have many files defining the simulation environment and parameters, for example (click filename for sample view):
- defines the physical geometries; walls, water, air
- simulation parameters that define the time range and granularity of the run
- defines material properties of air and water used in simulation
- numerous other control files define properties such as gravitational acceleration, physical properties of the container materials and so on
In this example, the simulated timeframe will be one second with output snapshot every 0,01 seconds.
After input files have been massaged to desired consistency, commands are executed to check and process the input files for actual simulation run:
- process input mesh (blockMesh)
- initialize input conditions (setFields)
- optional: visually inspect start conditions (paraFoam/paraview)
Solver application in this case will be OpenFOAM provided ”interFoam”, which is a solver for 2 incompressible fluids. It tracks the material interfaces and mesh motion.
After setup, the simulation is executed by running the interFoam command (sample output).
After about 40 seconds, the simulation is complete and results can be visualized and inspected with ParaView:
And here is a fancy gif animation of the whole simulation output covering one second of time: