28 template<
class CombustionModel>
33 const word& combustionProperties
40 thermo.phasePropertyName(combustionProperties),
41 thermo.db().time().constant(),
49 word combModelName(
"none");
56 Info<<
"Combustion model not active: " 57 << thermo.phasePropertyName(combustionProperties)
58 <<
" not found" <<
endl;
61 Info<<
"Selecting combustion model " << combModelName <<
endl;
63 const wordList cmpts2(basicThermo::splitThermoName(combModelName, 2));
64 const wordList cmpts3(basicThermo::splitThermoName(combModelName, 3));
65 if (cmpts2.
size() == 2 || cmpts3.
size() == 3)
67 combModelName = cmpts2.
size() ? cmpts2[0] : cmpts3[0];
70 <<
"Template parameters are no longer required when selecting a " 71 << combustionModel::typeName <<
". This information is now " 72 <<
"obtained directly from the thermodynamics. Actually selecting " 73 <<
"combustion model " << combModelName <<
"." <<
endl;
76 typedef typename CombustionModel::dictionaryConstructorTable cstrTableType;
77 cstrTableType* cstrTable = CombustionModel::dictionaryConstructorTablePtr_;
79 const word compCombModelName =
80 combModelName +
'<' + CombustionModel::reactionThermo::typeName +
'>';
82 const word thermoCombModelName =
83 combModelName +
'<' + CombustionModel::reactionThermo::typeName +
',' 84 + thermo.thermoName() +
'>';
86 typename cstrTableType::iterator compCstrIter =
87 cstrTable->find(compCombModelName);
89 typename cstrTableType::iterator thermoCstrIter =
90 cstrTable->find(thermoCombModelName);
92 if (compCstrIter == cstrTable->end() && thermoCstrIter == cstrTable->end())
95 <<
"Unknown " << combustionModel::typeName <<
" type " 96 << combModelName << endl <<
endl;
98 const wordList names(cstrTable->toc());
101 thisCmpts.
append(word::null);
102 thisCmpts.append(CombustionModel::reactionThermo::typeName);
103 thisCmpts.append(basicThermo::splitThermoName(thermo.thermoName(), 5));
108 wordList cmpts(basicThermo::splitThermoName(names[i], 2));
109 if (cmpts.
size() != 2)
111 cmpts = basicThermo::splitThermoName(names[i], 7);
115 for (
label i = 1; i < cmpts.
size() && isValid; ++ i)
117 isValid = isValid && cmpts[i] == thisCmpts[i];
122 validNames.
append(cmpts[0]);
127 <<
"Valid " << combustionModel::typeName <<
" types for this " 128 <<
"thermodynamic model are:" << endl << validNames <<
endl;
132 validCmpts2[0][0] = combustionModel::typeName;
133 validCmpts2[0][1] =
"reactionThermo";
135 validCmpts7[0][0] = combustionModel::typeName;
136 validCmpts7[0][1] =
"reactionThermo";
137 validCmpts7[0][2] =
"transport";
138 validCmpts7[0][3] =
"thermo";
139 validCmpts7[0][4] =
"equationOfState";
140 validCmpts7[0][5] =
"specie";
141 validCmpts7[0][6] =
"energy";
144 const wordList cmpts2(basicThermo::splitThermoName(names[i], 2));
145 const wordList cmpts7(basicThermo::splitThermoName(names[i], 7));
146 if (cmpts2.
size() == 2)
148 validCmpts2.
append(cmpts2);
150 if (cmpts7.
size() == 7)
152 validCmpts7.
append(cmpts7);
157 <<
"All " << validCmpts2[0][0] <<
'/' << validCmpts2[0][1]
158 <<
" combinations are:" << endl <<
endl;
164 <<
"All " << validCmpts7[0][0] <<
'/' << validCmpts7[0][1]
165 <<
"/thermoPhysics combinations are:" << endl <<
endl;
173 thermoCstrIter != cstrTable->end()
174 ? thermoCstrIter()(combModelName,
thermo, turb, combustionProperties)
175 : compCstrIter()(combModelName,
thermo, turb, combustionProperties)
#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.
bool typeHeaderOk(const bool checkType=true)
Read header (uses typeFilePath to find file) and check header.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#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
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
ReactionThermo reactionThermo
Thermo type.
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 &)
Abstract base class for turbulence models (RAS, LES and laminar).
List< word > wordList
A List of words.
#define WarningInFunction
Report a warning using Foam::Warning.
static autoPtr< CombustionModel > New(typename CombustionModel::reactionThermo &thermo, const compressibleTurbulenceModel &turb, const word &combustionProperties)
Generic New for each of the related chemistry model.
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.