Description Thermo package for(S)olids(L)iquids and(G)ases Takes reference to thermo package, and provides: - carrier : components of thermo - access to elemental properties - liquids : liquid components - access to elemental properties - solids : solid components - access to elemental properties
If thermo is not a multi-component thermo package, carrier is nullptr. Similarly, if no liquids or solids are specified, their respective pointers will also be nullptr.
Registered to the mesh so that it can be looked-up
In the coalChemistryFoam solver, a SLGThermo object is defined in createFields.H:
1
SLGThermo slgThermo(mesh, thermo);
The constructor of the SLGThermo is defined in SLGThermo.C:
The detailed initialization of the pThermo object was talked before in the discussion of the psiReactionThermo class. The initialization of the properties of each phases is done in the constructor of the SLGThermo . The gas phase which is called carrier here is initialized by a dynamic_cast. As for the initialization of the liquid and solid phase, the mechanisms are the same. I will pick the initialization of the solid phase here as an example. Here I separate the code from the constructor:
Here the components will have 2 elements. dict.isDict(components_[i]) will check if a subdict exists or not. For C, the subdict exists and for ash it doesn’t.
As the first component is C, this will call the constructor of C in C.C
1 2 3 4 5 6 7 8 9 10 11
Foam::C::C() : solidProperties(2010, 710, 0.04, 0.0, 1.0) { if (debug) { WarningInFunction << "Properties of graphite need to be checked!!!" << endl; } }
As C is inherited from class solidProperties, it then initialized the constructor of solidProperties which is defined in solidProperties.C:
if (cstrIter == ConstructorTablePtr_->end()) { FatalErrorInFunction ...... }
return autoPtr<solidProperties>(cstrIter()()); }
This will then call the constructor of ash defined in ash.C:
1 2 3 4 5 6 7 8 9 10 11
Foam::ash::ash() : solidProperties(2010, 710, 0.04, 0.0, 1.0) { if (debug) { WarningInFunction << "Properties of ash need to be checked!!!" << endl; } }
And this will also call the solidProperties constructor as what we have explained before.