Difference between revisions of "OpenFOAM guide/Introduction to OpenFOAM Programming, A Walk Through reactingFOAM"

From OpenFOAMWiki
Line 3: Line 3:
 
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.
 
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.
  
==Chapter 2: What do the initial header files do? ==
+
== Chapter 2: What the initial header files do? ==
The beginning part of reactingFoam code (ofcourse after the license statement) reads
+
 
 +
The beginning part of reactingFoam, (of course after the GNU license comments) reads  
 
<cpp>
 
<cpp>
 
#include "fvCFD.H"
 
#include "fvCFD.H"
Line 13: Line 14:
 
#include "multivariateScheme.H"
 
#include "multivariateScheme.H"
 
</cpp>
 
</cpp>
 +
We shall now see what each of the header files do, one by one
 +
==== Section 1: <cpp>"fvCFD.H"</cpp> ====
 +
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
 +
<cpp>
 +
#include "parRun.H"
  
Let us briefly see what these headers do
+
#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"
  
==Section 1: <cpp> "fvCFD.H" </cpp>==
+
#include "OSspecific.H"
A look into <cpp> "fvCFD.H" </cpp> shows the following
+
#include "argList.H"
 +
 
 +
#ifndef namespaceFoam
 +
#define namespaceFoam
 +
    using namespace Foam;
 +
#endif
 +
</cpp>

Revision as of 10:49, 19 July 2007

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