Go to the documentation of this file.
34 template<
class ChemistryModel>
37 typename ChemistryModel::reactionThermo&
thermo
44 thermo.phasePropertyName(
"chemistryProperties"),
45 thermo.db().time().constant(),
53 if (!chemistryDict.
isDict(
"chemistryType"))
56 <<
"Template parameter based chemistry solver selection is no "
57 <<
"longer supported. Please create a chemistryType dictionary"
58 <<
"instead." <<
endl <<
endl <<
"For example, the entry:" <<
endl
59 <<
" chemistrySolver ode<StandardChemistryModel<"
60 <<
"rhoChemistryModel,sutherlandspecie<janaf<perfectGas>,"
61 <<
"sensibleInternalEnergy>>" <<
endl <<
endl <<
"becomes:" <<
endl
62 <<
" chemistryType" <<
endl <<
" {" <<
endl
63 <<
" solver ode;" <<
endl <<
" method standard;"
68 chemistryDict.
subDict(
"chemistryType");
75 {{
"chemistrySolver", -1712}}
81 chemistryTypeDict.getOrDefault<
word>
84 chemistryTypeDict.getOrDefault<
bool>(
"TDAC",
false)
91 chemistryTypeDictNew.
add(
"solver", solverName);
92 chemistryTypeDictNew.
add(
"method", methodName);
94 Info<<
"Selecting chemistry solver " << chemistryTypeDictNew <<
endl;
96 auto* cstrTable = ChemistryModel::thermoConstructorTablePtr_;
98 const word chemSolverCompThermoName
100 solverName +
'<' + methodName +
'<'
101 + ChemistryModel::reactionThermo::typeName +
','
102 +
thermo.thermoName() +
">>"
105 auto cstrIter = cstrTable->cfind(chemSolverCompThermoName);
107 if (!cstrIter.found())
109 constexpr
const int nCmpt = 8;
112 thisCmpts.
append(word::null);
113 thisCmpts.
append(word::null);
114 thisCmpts.
append(ChemistryModel::reactionThermo::typeName);
117 basicThermo::splitThermoName(
thermo.thermoName(), 5)
128 List<wordList> validCmpts;
145 for (
const word& validName : cstrTable->sortedToc())
149 basicThermo::splitThermoName(validName, nCmpt)
152 const wordList& cmpts = validCmpts.last();
155 for (label i = 2; i < cmpts.size() && isValid; ++i)
157 isValid = isValid && cmpts[i] == thisCmpts[i];
162 validNames.
append(SubList<word>(cmpts, 2));
168 <<
"Unknown " << typeName_() <<
" type " << solverName <<
nl <<
nl;
171 <<
"All " << validNames[0][0] <<
'/' << validNames[0][1]
172 <<
"combinations for this thermodynamic model:" <<
nl <<
nl;
177 <<
"All " << validCmpts[0][0] <<
'/' << validCmpts[0][1] <<
'/'
178 << validCmpts[0][2] <<
"/thermoPhysics combinations are:"
186 return autoPtr<ChemistryModel>(cstrIter()(
thermo));
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Defines the attributes of an object for which implicit objectRegistry management is supported,...
A class for handling words, derived from Foam::string.
static autoPtr< ChemistryModel > New(typename ChemistryModel::reactionThermo &thermo)
Generic New for each of the related chemistry model.
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
void append(const T &val)
Append an element at the end of the list.
Ostream & endl(Ostream &os)
Add newline and flush stream.
T getCompat(const word &keyword, std::initializer_list< std::pair< const char *, int >> compat, enum keyType::option=keyType::REGEX) const
List< word > wordList
A List of words.
messageStream Info
Information stream (uses stdout - output is on the master only)
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
Ostream & printTable(const UList< wordList > &tbl, List< std::string::size_type > &columnWidths, Ostream &os, bool headerSeparator=true)
Print a List of wordList as a table.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
errorManipArg< error, int > exit(error &err, const int errNo=1)
bool isDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Check if entry is found and is a sub-dictionary.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
entry * add(entry *entryPtr, bool mergeEntry=false)
Add a new entry.