All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Reaction.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "Reaction.H"
27 
28 // * * * * * * * * * * * * * * * * Static Data * * * * * * * * * * * * * * * //
29 
30 template<class ReactionThermo>
32 
33 template<class ReactionThermo>
35 
36 template<class ReactionThermo>
38 
39 
40 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
41 
42 template<class ReactionThermo>
44 {
45  return nUnNamedReactions++;
46 }
47 
48 
49 template<class ReactionThermo>
51 (
52  const HashPtrTable<ReactionThermo>& thermoDatabase
53 )
54 {
55  typename ReactionThermo::thermoType rhsThermo
56  (
57  rhs_[0].stoichCoeff
58  *(*thermoDatabase[species_[rhs_[0].index]]).W()
59  *(*thermoDatabase[species_[rhs_[0].index]])
60  );
61 
62  for (label i=1; i<rhs_.size(); ++i)
63  {
64  rhsThermo +=
65  rhs_[i].stoichCoeff
66  *(*thermoDatabase[species_[rhs_[i].index]]).W()
67  *(*thermoDatabase[species_[rhs_[i].index]]);
68  }
69 
70  typename ReactionThermo::thermoType lhsThermo
71  (
72  lhs_[0].stoichCoeff
73  *(*thermoDatabase[species_[lhs_[0].index]]).W()
74  *(*thermoDatabase[species_[lhs_[0].index]])
75  );
76 
77  for (label i=1; i<lhs_.size(); ++i)
78  {
79  lhsThermo +=
80  lhs_[i].stoichCoeff
81  *(*thermoDatabase[species_[lhs_[i].index]]).W()
82  *(*thermoDatabase[species_[lhs_[i].index]]);
83  }
84 
85  ReactionThermo::thermoType::operator=(lhsThermo == rhsThermo);
86 }
87 
88 
89 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
90 
91 template<class ReactionThermo>
93 (
94  const speciesTable& species,
95  const List<specieCoeffs>& lhs,
96  const List<specieCoeffs>& rhs,
97  const HashPtrTable<ReactionThermo>& thermoDatabase
98 )
99 :
100  ReactionThermo::thermoType(*thermoDatabase[species[0]]),
101  name_("un-named-reaction-" + Foam::name(getNewReactionID())),
102  species_(species),
103  Tlow_(TlowDefault),
104  Thigh_(ThighDefault),
105  lhs_(lhs),
106  rhs_(rhs)
107 {
108  setThermo(thermoDatabase);
109 }
110 
111 
112 template<class ReactionThermo>
114 (
115  const Reaction<ReactionThermo>& r,
116  const speciesTable& species
117 )
118 :
119  ReactionThermo::thermoType(r),
120  name_(r.name() + "Copy"),
121  species_(species),
122  Tlow_(r.Tlow()),
123  Thigh_(r.Thigh()),
124  lhs_(r.lhs_),
125  rhs_(r.rhs_)
126 {}
127 
128 
129 template<class ReactionThermo>
131 (
132  const speciesTable& species,
133  const HashPtrTable<ReactionThermo>& thermoDatabase,
134  const dictionary& dict
135 )
136 :
137  ReactionThermo::thermoType(*thermoDatabase[species[0]]),
138  name_(dict.dictName()),
139  species_(species),
140  Tlow_(dict.lookupOrDefault<scalar>("Tlow", TlowDefault)),
141  Thigh_(dict.lookupOrDefault<scalar>("Thigh", ThighDefault))
142 {
143  specieCoeffs::setLRhs
144  (
145  IStringStream(dict.lookup("reaction"))(),
146  species_,
147  lhs_,
148  rhs_
149  );
150  setThermo(thermoDatabase);
151 }
152 
153 
154 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
155 
156 template<class ReactionThermo>
159 (
160  const speciesTable& species,
161  const HashPtrTable<ReactionThermo>& thermoDatabase,
162  const dictionary& dict
163 )
164 {
165  const word& reactionTypeName = dict.lookup("type");
166 
167  typename dictionaryConstructorTable::iterator cstrIter =
168  dictionaryConstructorTablePtr_->find(reactionTypeName);
169 
170  // Backwards compatibility check. Reaction names used to have "Reaction"
171  // (Reaction<ReactionThermo>::typeName_()) appended. This was removed as it
172  // is unnecessary given the context in which the reaction is specified. If
173  // this reaction name was not found, search also for the old name.
174  if (cstrIter == dictionaryConstructorTablePtr_->end())
175  {
176  cstrIter = dictionaryConstructorTablePtr_->find
177  (
178  reactionTypeName.removeTrailing(typeName_())
179  );
180  }
181 
182  if (cstrIter == dictionaryConstructorTablePtr_->end())
183  {
185  << "Unknown reaction type "
186  << reactionTypeName << nl << nl
187  << "Valid reaction types are :" << nl
188  << dictionaryConstructorTablePtr_->sortedToc()
189  << exit(FatalError);
190  }
191 
193  (
194  cstrIter()(species, thermoDatabase, dict)
195  );
196 }
197 
198 
199 template<class ReactionThermo>
202 (
203  const speciesTable& species,
204  const HashPtrTable<ReactionThermo>& thermoDatabase,
205  const objectRegistry& ob,
206  const dictionary& dict
207 )
208 {
209  // If the objectRegistry constructor table is empty
210  // use the dictionary constructor table only
211  if (!objectRegistryConstructorTablePtr_)
212  {
213  return New(species, thermoDatabase, dict);
214  }
215 
216  const word& reactionTypeName = dict.lookup("type");
217 
218  typename objectRegistryConstructorTable::iterator cstrIter =
219  objectRegistryConstructorTablePtr_->find(reactionTypeName);
220 
221  // Backwards compatibility check. See above.
222  if (cstrIter == objectRegistryConstructorTablePtr_->end())
223  {
224  cstrIter = objectRegistryConstructorTablePtr_->find
225  (
226  reactionTypeName.removeTrailing(typeName_())
227  );
228  }
229 
230  if (cstrIter == objectRegistryConstructorTablePtr_->end())
231  {
232  typename dictionaryConstructorTable::iterator cstrIter =
233  dictionaryConstructorTablePtr_->find(reactionTypeName);
234 
235  // Backwards compatibility check. See above.
236  if (cstrIter == dictionaryConstructorTablePtr_->end())
237  {
238  cstrIter = dictionaryConstructorTablePtr_->find
239  (
240  reactionTypeName.removeTrailing(typeName_())
241  );
242  }
243 
244  if (cstrIter == dictionaryConstructorTablePtr_->end())
245  {
247  << "Unknown reaction type "
248  << reactionTypeName << nl << nl
249  << "Valid reaction types are :" << nl
250  << dictionaryConstructorTablePtr_->sortedToc()
251  << objectRegistryConstructorTablePtr_->sortedToc()
252  << exit(FatalError);
253  }
254 
256  (
257  cstrIter()(species, thermoDatabase, dict)
258  );
259  }
260 
262  (
263  cstrIter()(species, thermoDatabase, ob, dict)
264  );
265 }
266 
267 
268 template<class ReactionThermo>
271 (
272  const speciesTable& species,
273  const PtrList<ReactionThermo>& speciesThermo,
274  const dictionary& dict
275 )
276 {
277  HashPtrTable<ReactionThermo> thermoDatabase;
278  forAll(speciesThermo, i)
279  {
280  thermoDatabase.insert
281  (
282  speciesThermo[i].name(),
283  speciesThermo[i].clone().ptr()
284  );
285  }
286 
287  return New(species, thermoDatabase, dict);
288 }
289 
290 
291 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
292 
293 template<class ReactionThermo>
295 {
297  writeEntry
298  (
299  os,
300  "reaction",
301  specieCoeffs::reactionStr(reaction, species_, lhs_, rhs_)
302  );
303 }
304 
305 
306 template<class ReactionThermo>
308 (
309  const scalar p,
310  const scalar T,
311  const scalarField& c,
312  const label li,
313  scalarField& d
314 ) const
315 {
316 }
317 
318 
319 template<class ReactionThermo>
321 (
322  const scalar p,
323  const scalar T,
324  const scalarField& c,
325  const label li,
326  scalarField& f
327 ) const
328 {
329 }
330 
331 
332 template<class ReactionThermo>
334 (
335  const scalar p,
336  const scalar T,
337  const scalarField& c,
338  const label li,
339  scalarField& dcdt
340 ) const
341 {
342  scalar pf, cf, pr, cr;
343  label lRef, rRef;
344 
345  scalar omegaI = omega
346  (
347  p, T, c, li, pf, cf, lRef, pr, cr, rRef
348  );
349 
350  forAll(lhs_, i)
351  {
352  const label si = lhs_[i].index;
353  const scalar sl = lhs_[i].stoichCoeff;
354  dcdt[si] -= sl*omegaI;
355  }
356  forAll(rhs_, i)
357  {
358  const label si = rhs_[i].index;
359  const scalar sr = rhs_[i].stoichCoeff;
360  dcdt[si] += sr*omegaI;
361  }
362 }
363 
364 
365 template<class ReactionThermo>
367 (
368  const scalar p,
369  const scalar T,
370  const scalarField& c,
371  const label li,
372  scalar& pf,
373  scalar& cf,
374  label& lRef,
375  scalar& pr,
376  scalar& cr,
377  label& rRef
378 ) const
379 {
380 
381  scalar clippedT = min(max(T, this->Tlow()), this->Thigh());
382 
383  const scalar kf = this->kf(p, clippedT, c, li);
384  const scalar kr = this->kr(kf, p, clippedT, c, li);
385 
386  pf = 1;
387  pr = 1;
388 
389  const label Nl = lhs_.size();
390  const label Nr = rhs_.size();
391 
392  label slRef = 0;
393  lRef = lhs_[slRef].index;
394 
395  pf = kf;
396  for (label s = 1; s < Nl; s++)
397  {
398  const label si = lhs_[s].index;
399 
400  if (c[si] < c[lRef])
401  {
402  const scalar exp = lhs_[slRef].exponent;
403  pf *= pow(max(c[lRef], 0), exp);
404  lRef = si;
405  slRef = s;
406  }
407  else
408  {
409  const scalar exp = lhs_[s].exponent;
410  pf *= pow(max(c[si], 0), exp);
411  }
412  }
413  cf = max(c[lRef], 0);
414 
415  {
416  const scalar exp = lhs_[slRef].exponent;
417  if (exp < 1)
418  {
419  if (cf > small)
420  {
421  pf *= pow(cf, exp - 1);
422  }
423  else
424  {
425  pf = 0;
426  }
427  }
428  else
429  {
430  pf *= pow(cf, exp - 1);
431  }
432  }
433 
434  label srRef = 0;
435  rRef = rhs_[srRef].index;
436 
437  // Find the matrix element and element position for the rhs
438  pr = kr;
439  for (label s = 1; s < Nr; s++)
440  {
441  const label si = rhs_[s].index;
442  if (c[si] < c[rRef])
443  {
444  const scalar exp = rhs_[srRef].exponent;
445  pr *= pow(max(c[rRef], 0), exp);
446  rRef = si;
447  srRef = s;
448  }
449  else
450  {
451  const scalar exp = rhs_[s].exponent;
452  pr *= pow(max(c[si], 0), exp);
453  }
454  }
455  cr = max(c[rRef], 0);
456 
457  {
458  const scalar exp = rhs_[srRef].exponent;
459  if (exp < 1)
460  {
461  if (cr > small)
462  {
463  pr *= pow(cr, exp - 1);
464  }
465  else
466  {
467  pr = 0;
468  }
469  }
470  else
471  {
472  pr *= pow(cr, exp - 1);
473  }
474  }
475 
476  return pf*cf - pr*cr;
477 }
478 
479 
480 template<class ReactionThermo>
482 (
483  const scalar p,
484  const scalar T,
485  const scalarField& c,
486  const label li,
488  scalarField& dcdt,
489  scalar& omegaI,
490  scalar& kfwd,
491  scalar& kbwd,
492  const bool reduced,
493  const List<label>& c2s
494 ) const
495 {
496  scalar pf, cf, pr, cr;
497  label lRef, rRef;
498 
499  omegaI = omega(p, T, c, li, pf, cf, lRef, pr, cr, rRef);
500 
501  forAll(lhs_, i)
502  {
503  const label si = reduced ? c2s[lhs_[i].index] : lhs_[i].index;
504  const scalar sl = lhs_[i].stoichCoeff;
505  dcdt[si] -= sl*omegaI;
506  }
507  forAll(rhs_, i)
508  {
509  const label si = reduced ? c2s[rhs_[i].index] : rhs_[i].index;
510  const scalar sr = rhs_[i].stoichCoeff;
511  dcdt[si] += sr*omegaI;
512  }
513 
514  kfwd = this->kf(p, T, c, li);
515  kbwd = this->kr(kfwd, p, T, c, li);
516 
517  forAll(lhs_, j)
518  {
519  const label sj = reduced ? c2s[lhs_[j].index] : lhs_[j].index;
520  scalar kf = kfwd;
521  forAll(lhs_, i)
522  {
523  const label si = lhs_[i].index;
524  const scalar el = lhs_[i].exponent;
525  if (i == j)
526  {
527  if (el < 1)
528  {
529  if (c[si] > SMALL)
530  {
531  kf *= el*pow(c[si] + VSMALL, el - 1);
532  }
533  else
534  {
535  kf = 0;
536  }
537  }
538  else
539  {
540  kf *= el*pow(c[si], el - 1);
541  }
542  }
543  else
544  {
545  kf *= pow(c[si], el);
546  }
547  }
548 
549  forAll(lhs_, i)
550  {
551  const label si = reduced ? c2s[lhs_[i].index] : lhs_[i].index;
552  const scalar sl = lhs_[i].stoichCoeff;
553  J(si, sj) -= sl*kf;
554  }
555  forAll(rhs_, i)
556  {
557  const label si = reduced ? c2s[rhs_[i].index] : rhs_[i].index;
558  const scalar sr = rhs_[i].stoichCoeff;
559  J(si, sj) += sr*kf;
560  }
561  }
562 
563  forAll(rhs_, j)
564  {
565  const label sj = reduced ? c2s[rhs_[j].index] : rhs_[j].index;
566  scalar kr = kbwd;
567  forAll(rhs_, i)
568  {
569  const label si = rhs_[i].index;
570  const scalar er = rhs_[i].exponent;
571  if (i == j)
572  {
573  if (er < 1)
574  {
575  if (c[si] > SMALL)
576  {
577  kr *= er*pow(c[si] + VSMALL, er - 1);
578  }
579  else
580  {
581  kr = 0;
582  }
583  }
584  else
585  {
586  kr *= er*pow(c[si], er - 1);
587  }
588  }
589  else
590  {
591  kr *= pow(c[si], er);
592  }
593  }
594 
595  forAll(lhs_, i)
596  {
597  const label si = reduced ? c2s[lhs_[i].index] : lhs_[i].index;
598  const scalar sl = lhs_[i].stoichCoeff;
599  J(si, sj) += sl*kr;
600  }
601  forAll(rhs_, i)
602  {
603  const label si = reduced ? c2s[rhs_[i].index] : rhs_[i].index;
604  const scalar sr = rhs_[i].stoichCoeff;
605  J(si, sj) -= sr*kr;
606  }
607  }
608 
609  // When third-body species are involved, additional terms are added
610  // beta function returns an empty list when third-body are not involved
611  const List<Tuple2<label, scalar>>& beta = this->beta();
612  if (notNull(beta))
613  {
614  // This temporary array needs to be cached for efficiency
615  scalarField dcidc(beta.size());
616  this->dcidc(p, T, c, li, dcidc);
617 
618  forAll(beta, j)
619  {
620  label sj = beta[j].first();
621  sj = reduced ? c2s[sj] : sj;
622  if (sj != -1)
623  {
624  forAll(lhs_, i)
625  {
626  const label si =
627  reduced ? c2s[lhs_[i].index] : lhs_[i].index;
628  const scalar sl = lhs_[i].stoichCoeff;
629  J(si, sj) -= sl*dcidc[j]*omegaI;
630  }
631  forAll(rhs_, i)
632  {
633  const label si =
634  reduced ? c2s[rhs_[i].index] : rhs_[i].index;
635  const scalar sr = rhs_[i].stoichCoeff;
636  J(si, sj) += sr*dcidc[j]*omegaI;
637  }
638  }
639  }
640  }
641 }
642 
643 
644 template<class ReactionThermo>
646 (
647  const scalar p,
648  const scalar T,
649  const scalarField& c,
650  const label li,
651  const scalar omegaI,
652  const scalar kfwd,
653  const scalar kbwd,
655  const bool reduced,
656  const List<label>& c2s,
657  const label indexT
658 ) const
659 {
660  scalar kf = kfwd;
661  scalar kr = kbwd;
662 
663  scalar dkfdT = this->dkfdT(p, T, c, li);
664  scalar dkrdT = this->dkrdT(p, T, c, li, dkfdT, kr);
665 
666  scalar sumExp = 0.0;
667  forAll(lhs_, i)
668  {
669  const label si = lhs_[i].index;
670  const scalar el = lhs_[i].exponent;
671  const scalar cExp = pow(c[si], el);
672  dkfdT *= cExp;
673  kf *= cExp;
674  sumExp += el;
675  }
676  kf *= -sumExp/T;
677 
678  sumExp = 0.0;
679  forAll(rhs_, i)
680  {
681  const label si = rhs_[i].index;
682  const scalar er = rhs_[i].exponent;
683  const scalar cExp = pow(c[si], er);
684  dkrdT *= cExp;
685  kr *= cExp;
686  sumExp += er;
687  }
688  kr *= -sumExp/T;
689 
690  // dqidT includes the third-body (or pressure dependent) effect
691  scalar dqidT = dkfdT - dkrdT + kf - kr;
692 
693  // For reactions including third-body efficiencies or pressure dependent
694  // reaction, an additional term is needed
695  scalar dcidT = this->dcidT(p, T, c, li);
696  dcidT *= omegaI;
697 
698  // J(i, indexT) = sum_reactions nu_i dqdT
699  forAll(lhs_, i)
700  {
701  const label si = reduced ? c2s[lhs_[i].index] : lhs_[i].index;
702  const scalar sl = lhs_[i].stoichCoeff;
703  J(si, indexT) -= sl*(dqidT + dcidT);
704  }
705  forAll(rhs_, i)
706  {
707  const label si = reduced ? c2s[rhs_[i].index] : rhs_[i].index;
708  const scalar sr = rhs_[i].stoichCoeff;
709  J(si, indexT) += sr*(dqidT + dcidT);
710  }
711 }
712 
713 
714 template<class ReactionThermo>
716 {
717  return species_;
718 }
719 
720 
721 // ************************************************************************* //
dictionary dict
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:434
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
error FatalError
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
const word & name() const
Return the name of the reaction.
Definition: ReactionI.H:36
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:319
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
void dwdc(const scalar p, const scalar T, const scalarField &c, const label li, scalarSquareMatrix &J, scalarField &dcdt, scalar &omegaI, scalar &kfwd, scalar &kbwd, const bool reduced, const List< label > &c2s) const
Derivative of the net reaction rate for each species involved.
Definition: Reaction.C:482
void size(const label)
Override size to be inconsistent with allocated storage.
Definition: ListI.H:164
virtual void write(Ostream &) const
Write.
Definition: Reaction.C:294
static const scalar SMALL
Definition: scalar.H:115
A HashTable specialization for hashing pointers.
Definition: HashPtrTable.H:50
T & first()
Return the first element of the list.
Definition: UListI.H:114
Simple extension of ReactionThermo to handle reaction kinetics in addition to the equilibrium thermod...
Definition: Reaction.H:56
void omega(const scalar p, const scalar T, const scalarField &c, const label li, scalarField &dcdt) const
Net reaction rate for individual species.
Definition: Reaction.C:334
scalar Tlow() const
Return the lower temperature limit for the reaction.
Definition: ReactionI.H:43
static scalar TlowDefault
Default temperature limits of applicability of reaction rates.
Definition: Reaction.H:81
const word dictName() const
Return the local dictionary name (final part of scoped name)
Definition: dictionary.H:123
bool insert(const Key &, const T * &newElmt)
Insert a new hashedEntry.
Definition: HashTableI.H:80
const speciesTable & species() const
Return the specie list.
Definition: Reaction.C:715
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
T clone(const T &t)
Definition: List.H:54
dimensionedScalar exp(const dimensionedScalar &ds)
autoPtr< BasicCompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const typename BasicCompressibleMomentumTransportModel::transportModel &transport)
A class for handling words, derived from string.
Definition: word.H:59
void fdot(const scalar p, const scalar T, const scalarField &c, const label li, scalarField &f) const
Backward reaction rate.
Definition: Reaction.C:321
void ddot(const scalar p, const scalar T, const scalarField &c, const label li, scalarField &d) const
Forward reaction rate.
Definition: Reaction.C:308
CombustionModel< rhoReactionThermo > & reaction
static scalar ThighDefault
Definition: Reaction.H:81
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
static const char nl
Definition: Ostream.H:260
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
Definition: HashTableIO.C:96
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
const volScalarField & T
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
scalar Thigh() const
Return the upper temperature limit for the reaction.
Definition: ReactionI.H:50
bool notNull(const T &t)
Return true if t is not a reference to the nullObject of type T.
Definition: nullObjectI.H:52
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Reaction(const speciesTable &species, const List< specieCoeffs > &lhs, const List< specieCoeffs > &rhs, const HashPtrTable< ReactionThermo > &thermoDatabase)
Construct from components.
Definition: Reaction.C:93
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
static const scalar VSMALL
Definition: scalar.H:117
A wordList with hashed indices for faster lookup by name.
static autoPtr< Reaction< ReactionThermo > > New(const speciesTable &species, const HashPtrTable< ReactionThermo > &thermoDatabase, const dictionary &dict)
Return a pointer to new patchField created on freestore.
Definition: Reaction.C:159
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:70
Input from memory buffer stream.
Definition: IStringStream.H:49
const scalarList W(::W(thermo))
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
void dwdT(const scalar p, const scalar T, const scalarField &c, const label li, const scalar omegaI, const scalar kfwd, const scalar kbwd, scalarSquareMatrix &J, const bool reduced, const List< label > &c2s, const label indexT) const
Derivative of the net reaction rate for each species involved.
Definition: Reaction.C:646
Registry of regIOobjects.
static label nUnNamedReactions
Number of un-named reactions.
Definition: Reaction.H:78
bool removeTrailing(const char)
Remove trailing character returning true if string changed.
Definition: string.C:154
Output to memory buffer stream.
Definition: OStringStream.H:49
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Definition: dictionary.C:812