makeReactionThermos
in OpenFOAM
The makeReactionThermos
is a macro defined in the makeReactionThermo.H
, and used in the psiReactionThermos.C
as an example. We pick one of the constructed “table” to study this macro. As in the thermophysicalProperties
in the constant folder of the tutorial simplifiedSiwek
such thermo profiles are defined:
1 | thermoType |
By calling the following function, a typeName
is constructed as:
1 | const word thermoTypeName |
and the typeName
is:
1 | hePsiThermo<reactingMixture<sutherland<janaf<perfectGas<specie>>,sensibleEnthalpy>>> |
This type has been built in table psiReactionThermo::fvMeshConstructorTablePtr_
using the following macro:
1 | // Reaction thermo for sensible enthalpy |
The definition of the makeThermoPhysicsReactionThermos
is in makeReactionThermo.H
with a substitution of the above parameters:
1 | defineThermoPhysicsReactionThermo |
There are other macros defined in this macro which are defineThermoPhysicsReactionThermo
and addThermoPhysicsThermo
. Substitute the parameters in the defineThermoPhysicsReactionThermo
which is defined in makeReactionThermo.H
as:
1 | typedef hePsiThermo |
Here one thing to mention is the use of macro in C++. The single # symbol in the macro will return a string of the variable name. The another macro addThermoPhysicsThermo
with a substitution of the parameters defined in makeThermo.H
:
1 | // Pick one of them as an example |
And the addToRunTimeSelectionTable
defined in the addToRunTimeSelectionTable.H
with the substitution of the parameters:
1 | /* Add the thisType constructor function to the table */ |
Then we go to the defineTemplateTypeNameAndDebugWithName
macro with a substitution of parameters which is defined in className.H
:
1 | //- Define the typeName and debug information, lookup as \a Name |