OpenFOAM Development: CFD in C++

Updates, Updates

This page feels hopelessly out fo date because so much has happened with OpenFOAM in the last few year. Consider this a "quick introduction": in reality, OpenFOAM is becoming an important CFD platform both in industry and in academia.

Object Orientation in OpenFOAM

There is a number of ways to write a good CFD code in C++ and OpenFOAM just represents one of the possible ways. The idea of OpenFOAM is to represent the top-level equation we are trying to solve in the form that looks as similar as possible to its mathematical equivalent, i.e. using the field objects and differential operators (div, grad, curl). This has been described at length at the OpenFOAM web site and is also mentioned in some of my slides.

For example
@rU-----+  \~/  • rUU -  \~/  •m \~/ U  = -  \~/ p @t
is represented by the code:


       solve
       (
               fvm::ddt(rho,  U)
           +  fvm::div(phi,  U)
           -  fvm::laplacian(mu,  U)
               ==
           -  fvc::grad(p)
       );

Doing advanced modelling in OpenFOAM is very nice and convenient, but that's not all OpenFOAM is about. In order to really benefit from all the nice modelling, OpenFOAM needs to be efficient and provide geometrical flexibility to handle the geometries of industrial interest. This is my main concern, starting from my PhD work and carrying on on to this day. In order to do this, we have been forced to take a different path, working on arbitrarily unstructured Finite Volume discretisation. This looks to become a standard in the "next-generation" commercial CFD codes - Henry and I have been doing it from the start! I think OpenFOAM today provides the geometrical flexibility at least on a par with all other commercial CFD software.

In conclusion, OpenFOAM is about doing advanced modelling with ease and confidence, but also about using the models on real geometries.

coolant jacket coolant jacket

Engine simulation in OpenFOAM

For realistic combustion simulations in internal combustion engines, it is necessary to simulate the flow during the exhaust and intake stroke. Intake conditions control the level and distribution of turbulence, as well as potential fuel-air mixing, with critical impact on the combustion phase. CFD modelling of intake and exhaust stroke requires handling the valve action, including opening and closing and at the same time preserving sufficient mesh quality in the critical valve region.

Valve action

A combination of topology modifiers recently implemented in OpenFOAM allows me to model the valve action using a combination of several layer addition/removal surfaces and sliding interfaces for each valve. The first series of pictures shows the mesh modifiers in action during the exhaust and intake strokes. Note a change in the number of cells in the cylinder and above and below the valves in motion.

Valve action Valve action
Valve action Valve action
Valve action Valve action

In-cylinder flow

A finer mesh has been chosen to simulate the flow field during the exhaust and intake stroke. I am hoping to complete the work in collaboration with Dr. Gianluca d'Errico and the Internal Combustion Engine Group, Dipartimento di Energetica, Politecnico di Milano, Italy.

Valve action Valve action
Valve action Valve action
Valve action Valve action

Free surface flow modelling


Topological changes in OpenFOAM


OpenFOAM Numerics


Home Foam CFD.
Last modified: Sat Jan 26 20:32:40 GMT 2008