OpenFOAM programming that utilizes the unlimited flexibility of open source software. Developing maintainable CFD tools using OpenFOAM coding standards with C++.

100% new course from the leaders of the OpenFOAM project and creator of OpenFOAM. 100% open source.

Programming CFD 2-Day Course Modules

Introduction to Programming

  • Getting started with C++: creating a C++ program, compilation, scope, namespace, header files
  • OpenFOAM core classes: introduction, scalar, vector, tensor, List, Field, word
  • Tools and practice: finding classes & functions, code readability, programming style, file editor, scripts

Utility Programming

  • Data construction: Time and fvMesh, fields, dimensioned types, primitives and const
  • Data access and processing: introduction, references, data access in loops, function styles, data output
  • Data input: reading data, keyword lookup, dictionary hierarchy, scalar/label lookup, command line arguments/options
  • Data operations: code verification, compound assignment, reduction operations, case statements, error checking, type conversion, efficiency

Model Development

  • Object orientation: model libraries, class files, derived and base classes, run-time linking, inheritance
  • Interfaces: library-application interface, model update and delivery, virtual functions, run-time selection

Boundary Conditions

  • Class hierarchy: boundary mesh and fields, patch field types, new boundary condition, private data, constructors
  • Generic programming: templates, template boundary condition, pTraits, lookup with default, parameter checking
  • Class functions/data: private functions, “*this” pointer, updateCoeffs(), user interface, documentation
  • Design/implementation: requirements and specification, merging code, Function1 and wallDist classes, data access

Solver Development

  • Fields: GeometricField, dimensional units, volume and surface fields, flux, mesh regions, DimensionedField
  • Equations and algorithms: solver code, iterative solution, pressure equation, pressure-velocity coupling and PISO, fvMatrix
  • Derivatives and algebra: tensors, tensor algebra, interpolation, derivative functions, sources, implicitness

Data Analysis (Post-Processing)

  • Data processing: creating a new function object, reading parameters, data access / calculation, customizing output
  • Data output: output to file, formatting output, output in parallel, extending applicability, default inputs

See the OpenFOAM Training Schedule and Book

… for the Essential CFD, Applied CFD and Programming CFD courses.


Who Should Attend

Target Audience

  • CFD users working in R&D, academia and method development
  • Existing users developing in-house CFD capability
  • Programmers required to code to the OpenFOAM standards
  • Users needing to manage robust, maintainable code


  • A science/engineering/mathematics background is beneficial
  • Familiarity with Linux is an advantage
  • Working through the OpenFOAM Linux Guide is strongly encouraged

Greatly enhanced my understanding

The programming course greatly enhanced my understanding of OpenFOAM. The course materials were very carefully developed… I am now in a position to develop my own tailored OpenFOAM applications.

J.P., Caldera USA

An instructor who is also developing OpenFOAM

An instructor who is also developing OpenFOAM. Great and to the point. Understanding the overall OpenFOAM programming structure was a key benefit to me.

N.S., Vrjie Universiteit / Von Karmen Institute, Belgium

Understanding OpenFOAM like never before

Finally, I understand some OpenFOAM features that I never understood before. The primary strength was how to implement boundary conditions properly.

L.K., Xaar plc., UK

Course is very well prepared

A very good course for understanding OpenFOAM. The instructor is very good at this and the course is very well prepared. The printed material is very helpful.

P.G., Universidad de la República, Uruguay

Exposure to classes, templates and functions

The primary strengths of the course were hands-on exercises and exposure to classes, templates and functions and how to use them… and reading Doxygen documentation.


Can confidently develop my own applications

Learning from one of the co-founders of OpenFOAM is invaluable. I now understand the architecture and ethos of OpenFOAM and can confidently develop my own applications, boundary conditions and post-processing tools. The supporting materials and delivery of the course were of a very high standard.

C. W. H., Zyba Ltd., UK

Further Details

Competence in OpenFOAM Programming

  • This course has been created over several months, drawing on 2000 hours OpenFOAM training experience, by…
  • Chris Greenshields: OpenFOAM project manager and leading trainer, with 1000+ hours of training OpenFOAM programming.
  • Henry Weller: OpenFOAM creator and architect, who pioneered C++ for CFD and created the coding practice used in OpenFOAM.
  • It enables competency: the confidence to program OpenFOAM to a defined standard.
  • Confidence = not freezing at the keyboard.
  • Repeatedly = delivering good software, time and again
  • Defined standard = understand what good software is and delivering it in a timely manner.
  • It addresses the complexity of programming CFD through modular curriculum.

Accelerated Learning

Learning OpenFOAM Programming through Experience

  • The training involves learning through experience.
  • We use customization tasks commonly needed across all a range of scientific disciplines and industries.
  • … e.g. utility programming, model development, boundary condition, solver development and customized post-processing.
  • Programs are written in small, digestible steps with periods of reflection to reinforce new concepts.
  • This reflects real programming practice, where trouble-free, complex programs cannot usually be set up in “one go”.