34 template<
class ChemistryModel>
37 typename ChemistryModel::reactionThermo&
thermo 44 thermo.phasePropertyName(
"chemistryProperties"),
45 thermo.db().time().constant(),
58 <<
"Template parameter based chemistry solver selection is no " 59 <<
"longer supported. Please create a chemistryType dictionary" 60 <<
"instead." <<
endl <<
endl <<
"For example, the entry:" <<
endl 61 <<
" chemistrySolver ode<StandardChemistryModel<" 62 <<
"rhoChemistryModel,sutherlandspecie<janaf<perfectGas>," 63 <<
"sensibleInternalEnergy>>" <<
endl <<
endl <<
"becomes:" <<
endl 64 <<
" chemistryType" <<
endl <<
" {" <<
endl 65 <<
" solver ode;" <<
endl <<
" method standard;" 76 {{
"chemistrySolver", -1712}}
82 chemistryTypeDict.getOrDefault<
word>
85 chemistryTypeDict.getOrDefault<
bool>(
"TDAC",
false)
94 chemistryTypeDictNew.
add(
"solver", solverName);
95 chemistryTypeDictNew.
add(
"method", methodName);
97 Info<<
"Selecting chemistry solver " << chemistryTypeDictNew <<
endl;
100 const word chemSolverCompThermoName
102 solverName +
'<' + methodName +
'<' 103 + ChemistryModel::reactionThermo::typeName +
',' 108 const auto& cnstrTable = *(ChemistryModel::thermoConstructorTablePtr_);
110 auto* ctorPtr = cnstrTable.lookup(chemSolverCompThermoName,
nullptr);
116 constexpr
const int nCmpt = 8;
118 DynamicList<word> thisCmpts(6);
119 thisCmpts.append(ChemistryModel::reactionThermo::typeName);
125 DynamicList<wordList> validNames;
132 DynamicList<wordList> validCmpts(
names.
size() + 1);
149 for (
const word& validName :
names)
155 if (thisCmpts == SubList<word>(cmpts, 6, 2))
157 validNames.append(SubList<word>(cmpts, 2));
159 validCmpts.append(std::move(cmpts));
164 <<
"Unknown " << typeName_() <<
" type " << solverName <<
nl <<
nl;
166 if (validNames.size() > 1)
169 <<
"All " << validNames[0][0] <<
'/' << validNames[0][1]
170 <<
" combinations for this thermodynamic model:" 177 if (validCmpts.size() > 1)
180 <<
"All " << validCmpts[0][0] <<
'/' << validCmpts[0][1] <<
'/' 181 << validCmpts[0][2] <<
"/thermoPhysics combinations:" 192 return autoPtr<ChemistryModel>(ctorPtr(
thermo));
static autoPtr< ChemistryModel > New(typename ChemistryModel::reactionThermo &thermo)
Generic New for each of the related chemistry model.
void size(const label n)
Older name for setAddressableSize.
List< word > names(const UPtrList< T > &list, const UnaryMatchPredicate &matcher)
List of names generated by calling name() for each list item and filtered for matches.
errorManipArg< error, int > exit(error &err, const int errNo=1)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
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.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
constexpr char nl
The newline '\n' character (0x0a)
virtual word thermoName() const =0
Return the name of the thermo physics.
Ostream & endl(Ostream &os)
Add newline and flush stream.
entry * add(entry *entryPtr, bool mergeEntry=false)
Add a new entry.
Ignore writing from objectRegistry::writeObject()
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
psiReactionThermo & thermo
static wordList splitThermoName(const std::string &thermoName, const int nExpectedCmpts)
Split thermo package name into a list of components names.
A class for handling words, derived from Foam::string.
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
T getCompat(const word &keyword, std::initializer_list< std::pair< const char *, int >> compat, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T using any compatibility names if needed. FatalIOError if not found, or if there are excess tokens.
List< word > wordList
List of word.
messageStream Info
Information stream (stdout output on master, null elsewhere)
const dictionary * subDictPtr(const word &keyword) const
Deprecated(2018-10)
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Defines the attributes of an object for which implicit objectRegistry management is supported...
Do not request registration (bool: false)
const dictionary * findDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary pointer if present (and it is a dictionary) otherwise return nullptr...