OpenFOAM is a software toolkit for Computational Fluid Dynamics (CFD) released free and open source under the GNU General Public License through www.openfoam.com. It has a large user base across most areas of engineering and science, from both commercial and academic organisations.
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 transparency offered by open source release allows users to see the inner workings of the algorithms and models, providing a robust platform for development and collaborative research.
The language of OpenFOAM🔗
OpenFOAM is programmed in C++, a language permits the wrapping of otherwise complex concepts using a more familiar notation. For example, systems of equations are implemented using a syntax that closely follows the mathematical notation, e.g.:
Time rate of change | \(\ddt{\phi}\) | fvc::ddt(phi) |
Gradient | \(\grad \phi\) | fvc::grad(phi) |
Divergence | \(\div \phi\) | fvc::div(phi) |
Laplacian | \(\laplacian \phi\) | fvc::laplacian(phi) |
Linearised sources | \(s \phi\) | fvc::Sp(s,phi) |
This abstraction permits complex equations to be written concisely in a human-readable form, e.g. the transport equation to evolve the P-1 radiation model:
\[\div \left( \Gamma \grad G \right) - a G = -4 \epsilon \sigma T^4 - E\]is represented by the code:
// Solve G transport equation
solve
(
fvm::laplacian(gamma, G_)
- fvm::Sp(a_, G_)
==
- 4.0*(e_*physicoChemical::sigma*pow4(T_)) - E_
);
These examples make use of explicit operations using Finite Volume Calculus,
represented by the fvc::
prefix, where implicit terms are represented
analogously using the Finite Volume Method fvm::
form. For more
information, please see Numerics.
Many pre-built applications are supplied ready-to-use complete with a tutorial suite to showcase functionality.