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)
93 chemistryTypeDictNew.
add(
"solver", solverName);
94 chemistryTypeDictNew.
add(
"method", methodName);
96 Info<<
"Selecting chemistry solver " << chemistryTypeDictNew <<
endl;
99 const word chemSolverCompThermoName
101 solverName +
'<' + methodName +
'<'
102 + ChemistryModel::reactionThermo::typeName +
','
103 +
thermo.thermoName() +
">>"
107 const auto& cnstrTable = *(ChemistryModel::thermoConstructorTablePtr_);
109 auto* ctorPtr = cnstrTable.lookup(chemSolverCompThermoName,
nullptr);
115 constexpr
const int nCmpt = 8;
117 DynamicList<word> thisCmpts(6);
118 thisCmpts.append(ChemistryModel::reactionThermo::typeName);
124 DynamicList<wordList> validNames;
131 DynamicList<wordList> validCmpts(
names.size() + 1);
148 for (
const word& validName :
names)
154 if (thisCmpts == SubList<word>(cmpts, 6, 2))
156 validNames.append(SubList<word>(cmpts, 2));
158 validCmpts.append(std::move(cmpts));
163 <<
"Unknown " << typeName_() <<
" type " << solverName <<
nl <<
nl;
165 if (validNames.size() > 1)
168 <<
"All " << validNames[0][0] <<
'/' << validNames[0][1]
169 <<
" combinations for this thermodynamic model:"
176 if (validCmpts.size() > 1)
179 <<
"All " << validCmpts[0][0] <<
'/' << validCmpts[0][1] <<
'/'
180 << validCmpts[0][2] <<
"/thermoPhysics combinations:"
191 return autoPtr<ChemistryModel>(ctorPtr(
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)
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
Ostream & endl(Ostream &os)
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.
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Ostream & printTable(const UList< wordList > &tbl, List< std::string::size_type > &columnWidths, Ostream &os, bool headerSeparator=true)
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
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
#define FatalErrorInFunction
entry * add(entry *entryPtr, bool mergeEntry=false)
List< word > names(const UPtrList< T > &list, const UnaryMatchPredicate &matcher)
static wordList splitThermoName(const std::string &thermoName, const int nExpectedCmpts)