34template<
class ReactionThermo>
40template<
class ReactionThermo>
48 for (label i = 0; i < reactCoeffs.
size(); ++i)
69template<
class ReactionThermo>
75 reactionStr(
reaction, species_, lhs_);
79template<
class ReactionThermo>
85 reactionStr(
reaction, species_, rhs_);
91template<
class ReactionThermo>
94 return nUnNamedReactions++;
98template<
class ReactionThermo>
111template<
class ReactionThermo>
118 typename ReactionThermo::thermoType rhsThermo
121 *(*thermoDatabase[species_[rhs_[0].index]]).W()
122 *(*thermoDatabase[species_[rhs_[0].index]])
125 for (label i=1; i<rhs_.size(); ++i)
129 *(*thermoDatabase[species_[rhs_[i].index]]).W()
130 *(*thermoDatabase[species_[rhs_[i].index]]);
133 typename ReactionThermo::thermoType lhsThermo
136 *(*thermoDatabase[species_[lhs_[0].index]]).W()
137 *(*thermoDatabase[species_[lhs_[0].index]])
140 for (label i=1; i<lhs_.size(); ++i)
144 *(*thermoDatabase[species_[lhs_[i].index]]).W()
145 *(*thermoDatabase[species_[lhs_[i].index]]);
148 ReactionThermo::thermoType::operator=(lhsThermo == rhsThermo);
155template<
class ReactionThermo>
162 bool initReactionThermo
165 ReactionThermo::thermoType(*thermoDatabase[species[0]]),
166 name_(
"un-named-reaction-" +
Foam::
name(getNewReactionID())),
171 if (initReactionThermo)
173 setThermo(thermoDatabase);
178template<
class ReactionThermo>
185 ReactionThermo::thermoType(r),
186 name_(r.
name() +
"Copy"),
193template<
class ReactionThermo>
198 bool failUnknownSpecie
212 exponent = stoichCoeff;
218 const size_t i = specieName.find(
'^');
222 exponent = atof(specieName.substr(i + 1).c_str());
223 specieName.resize(i);
227 index = species.
find(specieName);
229 if (failUnknownSpecie && index < 0)
232 <<
"Unknown specie " << specieName <<
nl
240 <<
"Expected a word but found " << t.
info()
246template<
class ReactionThermo>
253 bool failUnknownSpecie
258 bool parsingRight =
false;
262 dlrhs.
append(specieCoeffs(species, is, failUnknownSpecie));
264 if (dlrhs.
last().index < 0)
282 <<
"Multiple '=' in reaction equation" <<
endl
293 <<
"Unknown punctuation token '" << t
294 <<
"' in reaction equation" <<
endl
305 else if (parsingRight)
316 <<
"Cannot continue reading reaction data from stream"
321template<
class ReactionThermo>
327 bool initReactionThermo,
328 bool failUnknownSpecie
331 ReactionThermo::thermoType(*thermoDatabase[species[0]]),
344 if (initReactionThermo)
346 setThermo(thermoDatabase);
353template<
class ReactionThermo>
364 auto* ctorPtr = dictionaryConstructorTable(reactionTypeName);
373 *dictionaryConstructorTablePtr_
379 ctorPtr(species, thermoDatabase,
dict)
386template<
class ReactionThermo>
394template<
class ReactionThermo>
406template<
class ReactionThermo>
419template<
class ReactionThermo>
431template<
class ReactionThermo>
435 return NullObjectRef<speciesTable>();
439template<
class ReactionThermo>
444 return NullObjectRef<List<specieCoeffs>>();
448template<
class ReactionThermo>
453 return NullObjectRef<List<specieCoeffs>>();
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void clear() noexcept
Clear the addressed list, i.e. set the size to zero.
T remove()
Remove and return the last element. Fatal on an empty list.
void append(const T &val)
Copy append an element to the end of this list.
bool good() const noexcept
True if next operation might succeed.
Input from string buffer, using a ISstream. Always UNCOMPRESSED.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
void putBack(const token &tok)
Put back a token. Only a single put back is permitted.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Output to string buffer, using a OSstream. Always UNCOMPRESSED.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
Simple extension of ReactionThermo to handle reaction kinetics in addition to the equilibrium thermod...
virtual scalar kr(const scalar kfwd, const scalar p, const scalar T, const scalarField &c) const
Reverse rate constant from the given forward rate constant.
void setLRhs(Istream &, const speciesTable &, List< specieCoeffs > &lhs, List< specieCoeffs > &rhs, bool failUnknownSpecie=true)
Construct the left- and right-hand-side reaction coefficients.
virtual const List< specieCoeffs > & glhs() const
void reactionStrLeft(OStringStream &reaction) const
Add string representation of the left of the reaction.
virtual const List< specieCoeffs > & grhs() const
Access to gas components of the reaction.
virtual scalar kf(const scalar p, const scalar T, const scalarField &c) const
Forward rate constant.
void reactionStrRight(OStringStream &reaction) const
Add string representation of the right of the reaction.
virtual const speciesTable & gasSpecies() const
Access to gas specie list.
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
bool empty() const noexcept
True if the UList is empty (ie, size() is zero)
void size(const label n)
Older name for setAddressableSize.
T & last()
Return the last element of the list.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
string getString(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Same as get< string >(const word&, keyType::option)
virtual bool write()
Write the output fields.
A wordList with hashed named lookup, which can be faster in some situations than using the normal lis...
label find(const word &val) const
Find index of the value (searches the hash).
A class for handling character strings derived from std::string.
A token holds an item read from Istream.
bool isNumber() const noexcept
Token is LABEL, FLOAT or DOUBLE.
bool isPunctuation() const noexcept
Token is PUNCTUATION.
@ ASSIGN
Assignment/equals [isseparator].
@ ADD
Addition [isseparator].
InfoProxy< token > info() const
Return info proxy for printing token information to a stream.
const word & wordToken() const
Return const reference to the word contents.
bool isWord() const noexcept
Token is word-variant (WORD, DIRECTIVE)
scalar number() const
Return label, float or double value.
A class for handling words, derived from Foam::string.
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
const word dictName("faMeshDefinition")
CombustionModel< rhoReactionThermo > & reaction
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)