31 template<
class ChemistryModel>
34 typename ChemistryModel::reactionThermo& thermo
41 thermo.phasePropertyName(
"chemistryProperties"),
42 thermo.db().time().constant(),
50 if (!chemistryDict.
isDict(
"chemistryType"))
53 <<
"Template parameter based chemistry solver selection is no " 54 <<
"longer supported. Please create a chemistryType dictionary" 55 <<
"instead." <<
endl <<
endl <<
"For example, the entry:" <<
endl 56 <<
" chemistrySolver ode<StandardChemistryModel<" 57 <<
"rhoChemistryModel,sutherlandspecie<janaf<perfectGas>," 58 <<
"sensibleInternalEnergy>>" <<
endl <<
endl <<
"becomes:" <<
endl 59 <<
" chemistryType" <<
endl <<
" {" <<
endl 60 <<
" solver ode;" <<
endl <<
" method standard;" 65 chemistryDict.
subDict(
"chemistryType");
67 const word& solverName
69 chemistryTypeDict.
found(
"solver")
70 ? chemistryTypeDict.
lookup(
"solver")
71 : chemistryTypeDict.
found(
"chemistrySolver")
72 ? chemistryTypeDict.
lookup(
"chemistrySolver")
73 : chemistryTypeDict.
lookup(
"solver")
76 const word& methodName
88 chemistryTypeDictNew.
add(
"solver", solverName);
89 chemistryTypeDictNew.
add(
"method", methodName);
91 Info<<
"Selecting chemistry solver " << chemistryTypeDictNew <<
endl;
93 typedef typename ChemistryModel::thermoConstructorTable cstrTableType;
94 cstrTableType* cstrTable = ChemistryModel::thermoConstructorTablePtr_;
96 const word chemSolverCompThermoName =
97 solverName +
'<' + methodName +
'<' 98 + ChemistryModel::reactionThermo::typeName +
',' 99 + thermo.thermoName() +
">>";
101 typename cstrTableType::iterator cstrIter =
102 cstrTable->find(chemSolverCompThermoName);
104 if (cstrIter == cstrTable->end())
107 <<
"Unknown " << typeName_() <<
" type " << solverName << endl
110 const wordList names(cstrTable->toc());
113 thisCmpts.
append(word::null);
114 thisCmpts.append(word::null);
115 thisCmpts.append(ChemistryModel::reactionThermo::typeName);
116 thisCmpts.append(basicThermo::splitThermoName(thermo.thermoName(), 5));
120 validNames[0][0] =
"solver";
121 validNames[0][1] =
"method";
124 const wordList cmpts(basicThermo::splitThermoName(names[i], 8));
127 for (
label i = 2; i < cmpts.
size() && isValid; ++ i)
129 isValid = isValid && cmpts[i] == thisCmpts[i];
139 <<
"All " << validNames[0][0] <<
'/' << validNames[0][1]
140 <<
"combinations for this thermodynamic model are:" 148 validCmpts[0][0] =
"solver";
149 validCmpts[0][1] =
"method";
150 validCmpts[0][2] =
"reactionThermo";
151 validCmpts[0][3] =
"transport";
152 validCmpts[0][4] =
"thermo";
153 validCmpts[0][5] =
"equationOfState";
154 validCmpts[0][6] =
"specie";
155 validCmpts[0][7] =
"energy";
158 validCmpts.
append(basicThermo::splitThermoName(names[i], 8));
162 <<
"All " << validCmpts[0][0] <<
'/' << validCmpts[0][1] <<
'/' 163 << validCmpts[0][2] <<
"/thermoPhysics combinations are:" static autoPtr< ChemistryModel > New(typename ChemistryModel::reactionThermo &thermo)
Generic New for each of the related chemistry model.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
rhoReactionThermo & thermo
bool isDict(const word &) const
Check if entry is a sub-dictionary.
bool add(entry *, bool mergeEntry=false)
Add a new entry.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
A List obtained as a section of another List.
A class for handling words, derived from string.
void append(const T &)
Append an element at the end of the list.
void printTable(const List< wordList > &, List< string::size_type > &, Ostream &)
List< word > wordList
A List of words.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.