OpenFOAM guide/Introduction to OpenFOAM Programming, A Walk Through reactingFOAM

From OpenFOAMWiki

1 Chapter 1: Why reactingFOAM ?

reactingFOAM is (one of the simpler ) reacting flow solvers of OpenFOAM. Understanding how this particular code works in a line by line manner, gives an idea not just of this particular solver but also the general programming techniques employed in OpenFOAM. Besides, this also gives an understanding of both the flow calculations as well as the reaction calculations in OpenFOAM.

2 Chapter 2: What the initial header files do?

The beginning part of reactingFoam, (of course after the GNU license comments) reads

 
#include "fvCFD.H"
#include "hCombustionThermo.H"
#include "compressible/turbulenceModel/turbulenceModel.H"
#include "chemistryModel.H"
#include "chemistrySolver.H"
#include "multivariateScheme.H"

We shall now see what each of the header files do, one by one

2.1 Section 1:
"fvCFD.H"

This file brings in the most fundamental tools for performing any finite volume calculation. This file in fact just includes a bunch of other files, each of which represents a building block of the edifice of the finite volume technique. This file reads

 
#include "parRun.H"
 
#include "Time.H"
#include "fvMesh.H"
#include "fvc.H"
#include "fvMatrices.H"
#include "fvm.H"
#include "linear.H"
#include "calculatedFvPatchFields.H"
#include "fixedValueFvPatchFields.H"
#include "adjustPhi.H"
#include "findRefCell.H"
#include "mathematicalConstants.H"
 
#include "OSspecific.H"
#include "argList.H"
 
#ifndef namespaceFoam
#define namespaceFoam
    using namespace Foam;
#endif