34template<
class ChemistryModel>
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);
113 const wordList names(cnstrTable.sortedToc());
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));
ReactionThermo reactionThermo
Thermo type.
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,...
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
void size(const label n)
Older name for setAddressableSize.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
static wordList splitThermoName(const std::string &thermoName, const int nExpectedCmpts)
Split thermo package name into a list of components names.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
T getCompat(const word &keyword, std::initializer_list< std::pair< const char *, int > > compat, enum keyType::option matchOpt=keyType::REGEX) const
bool isDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Check if entry is found and is a sub-dictionary.
entry * add(entry *entryPtr, bool mergeEntry=false)
Add a new entry.
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
A class for handling words, derived from Foam::string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
List< word > names(const UPtrList< T > &list, const UnaryMatchPredicate &matcher)
List< word > wordList
A List of words.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
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.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)