OpenFOAM:
Object-Oriented Numerical Simulation Library
OpenFOAM
(Field Operation And Manipulation), a numerical simulation
package for continuum mechanics designed to answer the complex
physics demands and transparently provide the necessary complex
geometry support. The package is designed to allow easy, quick
and reliable implementation of physical models by mimicking the
form of partial differential equations in the code. OpenFOAM
implements several modelling paradigms (Finite Volume, Finite
Element, Lagrangian particle tracking, Finite Area) in library
form using object-oriented design, handles complex geometries
through polyhedral mesh support, automatic mesh motion and
topological changes. Model-to-model interaction is handled by
grouping related models under a common interface. The novel
software design allows extensive code re-use, unit testing,
layered development, and user-defined extensions, resulting in
purpose-built, high quality customisable solvers.
OpenFOAM
is implemented in the C++ programming language and
strictly relies on object orientation and generic programming,
thus providing extensive capabilities with minimum bug counts.
An example on how OpenFOAM mimics the form of the partial
differential equation in software is given below for the
momentum equation:
is represented by the code:
solve
(
fvm::ddt(rho,
U)
+
fvm::div(phi,
U)
-
fvm::laplacian(mu,
U)
==
-
fvc::grad(p)
);
This allows for easy, quick and reliable implementation of
new physical models and separates the issues of numerics
implementation into several independent levels: field algebra,
boundary conditions, operator discretisation, matrix support,
inter-equation coupling and model-to-model interaction.
A combination of easy model implementation, first-class
numerics support, unstructured polyhedral mesh support with
motion and topological changes, as well as a library of
pre-implemented models makes OpenFOAM an extremely flexible
development platform in computational continuum mechanics
simulations.
Workshop Contents
Training and Workshop are targeted to University
and industrial researchers, users and developers who wish to
use, extend and adapt OpenFOAM for their use, as well as
further develop its capabilities. In both roles, an insight
into the code organisation, philosophy and standard coding
practices is extremely valuable.
Suggested Preparation for New Users
For novice users intending to join the Workshop, some background
knowledge would be beneficial. This should include running
some OpenFOAM tutorials, reading FOAM-related publications and
some background in CFD and Unix-based computing.
Additionally, exposure to C++ would be extremely helpful.
Provisional contents of the training presentations to be held by
Dr. Hrvoje Jasak is listed below.
OpenFOAM Training Presentations
- Background
- historical note, main contributors, area of application
- design rationale
- scope of use
- Discretisation and capabilities
- finite volume solver with polyhedral mesh support
- Lagrangian particle tracking
- automatic mesh motion and topological changes
- polyhedral finite element solver
- Main objects
- time, vectors and tensors, mesh
- field, dimensions, boundary conditions and geometric field
- field algebra, (linear system) matrices and solvers
- interpolation, differentiation and discretisation: FVM
- equations and models
- model to model coupling and virtual class interfaces
- Code organisation
- libraries, executables, utilities
- file organisations: headers, implementation,
include files and templates
- organisation of the installation: central library or
user account
- OpenFOAM case organisation
- file organisation
- control of the run, discretisation and parameters
- root and case
- Mesh generation
- blockMesh: a simple multi-block mesh generator
- mesh converters and native mesh support
- dynamic mesh capabilities: existing tools and setup
- automatic mesh generation in OpenFOAM (dr. Franjo Juretic)
- Pre-processing OpenFOAM applications
- pre-processing in FoamX, case setup by hand
- input and output data, material properties and run controls
- setting up initial fields
- choice of discretisation: convection, diffusion, time derivative, sources and sinks, gradient calculation
- Running OpenFOAM and post-processing
- running OpenFOAM executables
- raw data: ascii or binary, compressed; write precision
- graphical post-processing: paraFoam
- data manipulation
- handling statistics, probes and time-traces
- mesh-to-mesh data mapping
- running OpenFOAM on parallel computers:
domain decomposition and reconstruction
- Existing standard solvers in OpenFOAM:
capabilities and examples of application
- incompressible flow solvers; LES
- compressible, heat transfer, combustion
- multiphase and free surface
- other: stress analysis, electromagnetics etc.
- Model implementation, virtual interfaces and
run-time selection
- grouping models under common interface
- handling model selection and model-to-model interaction
- run-time lookup tables
- Model libraries and their usage in solvers
- utility libraries
- material property libraries
- physical model libraries and their use
- Customisation of OpenFOAM solvers: adding new capabilities
- new boundary condition
- new discretisation scheme
- new solver
- new turbulence model
- Programming in OpenFOAM
- wmake build system and environment variables
- setting up own executable
- adding a new boundary condition; user-defined library
- linking, compiling, profiling, debugging the code
Additional sessions on the basic principles of programming in
OpenFOAM and basics of object orientation and C++ are also
being considered. The decision will be made based on the
response from the audience; if you are interested, please
contact
dr. Jasak directly.
- Main programming guidelines and patterns in OpenFOAM
- Basic principles: data protection and public interfaces;
software modularisation
- Virtual function mechanism, run-time selection
- Lazy evaluation
- Templating
- Container types, dictionaries and stream design
- Code organisation and utility libraries
- C++ language training and object orientation
- C++ Language overview
- Classes - basics
- Class hierarchies and virtual functions
- Templating - basics
- Writing good C++: Guidelines on software development