DRGEP.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2016 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 "DRGEP.H"
27 #include "SortableListDRGEP.H"
28 
29 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
30 
31 template<class CompType, class ThermoType>
33 (
34  const IOdictionary& dict,
36 )
37 :
39  searchInitSet_(this->coeffsDict_.subDict("initialSet").size()),
40  sC_(this->nSpecie_,0),
41  sH_(this->nSpecie_,0),
42  sO_(this->nSpecie_,0),
43  sN_(this->nSpecie_,0),
44  NGroupBased_(50)
45 {
46  label j=0;
47  dictionary initSet = this->coeffsDict_.subDict("initialSet");
48  for (label i=0; i<chemistry.nSpecie(); i++)
49  {
50  if (initSet.found(chemistry.Y()[i].name()))
51  {
52  searchInitSet_[j++]=i;
53  }
54  }
55  if (j<searchInitSet_.size())
56  {
58  << searchInitSet_.size()-j
59  << " species in the intial set is not in the mechanism "
60  << initSet
61  << exit(FatalError);
62  }
63 
64  if (this->coeffsDict_.found("NGroupBased"))
65  {
66  NGroupBased_ = readLabel(this->coeffsDict_.lookup("NGroupBased"));
67  }
68 
69  const List<List<specieElement>>& specieComposition =
70  this->chemistry_.specieComp();
71  for (label i=0; i<this->nSpecie_; i++)
72  {
73  const List<specieElement>& curSpecieComposition =
74  specieComposition[i];
75  // for all elements in the current species
76  forAll(curSpecieComposition, j)
77  {
78  const specieElement& curElement =
79  curSpecieComposition[j];
80  if (curElement.name() == "C")
81  {
82  sC_[i] = curElement.nAtoms();
83  }
84  else if (curElement.name() == "H")
85  {
86  sH_[i] = curElement.nAtoms();
87  }
88  else if (curElement.name() == "O")
89  {
90  sO_[i] = curElement.nAtoms();
91  }
92  else if (curElement.name() == "N")
93  {
94  sN_[i] = curElement.nAtoms();
95  }
96  else
97  {
98  Info<< "element not considered"<< endl;
99  }
100  }
101  }
102 }
103 
104 
105 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
106 
107 template<class CompType, class ThermoType>
109 {}
110 
111 
112 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
113 
114 template<class CompType, class ThermoType>
117 (
118  const scalarField &c,
119  const scalar T,
120  const scalar p
121 )
122 {
123  scalarField& completeC(this->chemistry_.completeC());
124  scalarField c1(this->chemistry_.nEqns(), 0.0);
125 
126  for (label i=0; i<this->nSpecie_; i++)
127  {
128  c1[i] = c[i];
129  completeC[i] = c[i];
130  }
131 
132  c1[this->nSpecie_] = T;
133  c1[this->nSpecie_+1] = p;
134 
135  // Compute the rAB matrix
136  RectangularMatrix<scalar> rABNum(this->nSpecie_,this->nSpecie_,0.0);
137  scalarField PA(this->nSpecie_,0.0);
138  scalarField CA(this->nSpecie_,0.0);
139 
140  // Number of initialized rAB for each lines
141  Field<label> NbrABInit(this->nSpecie_,0);
142  // Position of the initialized rAB, -1 when not initialized
143  RectangularMatrix<label> rABPos(this->nSpecie_, this->nSpecie_, -1);
144  // Index of the other species involved in the rABNum
145  RectangularMatrix<label> rABOtherSpec(this->nSpecie_, this->nSpecie_, -1);
146 
147  scalar pf, cf, pr, cr;
148  label lRef, rRef;
149  scalarField omegaV(this->chemistry_.reactions().size());
150  forAll(this->chemistry_.reactions(), i)
151  {
152  const Reaction<ThermoType>& R = this->chemistry_.reactions()[i];
153  // for each reaction compute omegai
154  scalar omegai = this->chemistry_.omega
155  (
156  R, c1, T, p, pf, cf, lRef, pr, cr, rRef
157  );
158  omegaV[i] = omegai;
159 
160  // then for each pair of species composing this reaction,
161  // compute the rAB matrix (separate the numerator and
162  // denominator)
163 
164  DynamicList<scalar> wA(R.lhs().size()+R.rhs().size());
165  DynamicList<label> wAID(R.lhs().size()+R.rhs().size());
166  forAll(R.lhs(), s)// compute rAB for all species in the left hand side
167  {
168  label ss = R.lhs()[s].index;
169  scalar sl = -R.lhs()[s].stoichCoeff; // vAi = v''-v' => here -v'
170  List<bool> deltaBi(this->nSpecie_, false);
171  FIFOStack<label> usedIndex;
172  forAll(R.lhs(), j)
173  {
174  label sj = R.lhs()[j].index;
175  usedIndex.push(sj);
176  deltaBi[sj] = true;
177  }
178  forAll(R.rhs(), j)
179  {
180  label sj = R.rhs()[j].index;
181  usedIndex.push(sj);
182  deltaBi[sj] = true;
183  }
184 
185  // Disable for self reference (by definition rAA=0)
186  deltaBi[ss] = false;
187 
188  while(!usedIndex.empty())
189  {
190  label curIndex = usedIndex.pop();
191  if (deltaBi[curIndex])
192  {
193  // disable to avoid counting it more than once
194  deltaBi[curIndex] = false;
195  // test if this rAB is not initialized
196  if (rABPos(ss, curIndex)==-1)
197  {
198  rABPos(ss, curIndex) = NbrABInit[ss];
199  NbrABInit[ss]++;
200  rABNum(ss, rABPos(ss, curIndex)) = sl*omegai;
201  rABOtherSpec(ss, rABPos(ss, curIndex)) = curIndex;
202  }
203  else
204  {
205  rABNum(ss, rABPos(ss, curIndex)) += sl*omegai;
206  }
207  }
208  }
209  bool found(false);
210  forAll(wAID, id)
211  {
212  if (ss==wAID[id])
213  {
214  wA[id] += sl*omegai;
215  found = true;
216  }
217  }
218  if (!found)
219  {
220  wA.append(sl*omegai);
221  wAID.append(ss);
222  }
223  }
224 
225  // Compute rAB for all species in the right hand side
226  forAll(R.rhs(), s)
227  {
228  label ss = R.rhs()[s].index;
229  scalar sl = R.rhs()[s].stoichCoeff; // vAi = v''-v' => here v''
230  List<bool> deltaBi(this->nSpecie_, false);
231  FIFOStack<label> usedIndex;
232  forAll(R.lhs(), j)
233  {
234  label sj = R.lhs()[j].index;
235  usedIndex.push(sj);
236  deltaBi[sj] = true;
237  }
238  forAll(R.rhs(), j)
239  {
240  label sj = R.rhs()[j].index;
241  usedIndex.push(sj);
242  deltaBi[sj] = true;
243  }
244 
245  // Disable for self reference (by definition rAA=0)
246  deltaBi[ss] = false;
247 
248  while(!usedIndex.empty())
249  {
250  label curIndex = usedIndex.pop();
251  if (deltaBi[curIndex])
252  {
253  // disable to avoid counting it more than once
254  deltaBi[curIndex] = false;
255  // test if this rAB is not initialized
256  if (rABPos(ss, curIndex)==-1)
257  {
258  rABPos(ss, curIndex) = NbrABInit[ss];
259  NbrABInit[ss]++;
260  rABNum(ss, rABPos(ss, curIndex)) = sl*omegai;
261  rABOtherSpec(ss, rABPos(ss, curIndex)) = curIndex;
262  }
263  else
264  {
265  rABNum(ss, rABPos(ss, curIndex)) += sl*omegai;
266  }
267  }
268  }
269 
270  bool found(false);
271  forAll(wAID, id)
272  {
273  if (ss==wAID[id])
274  {
275  wA[id] += sl*omegai;
276  found = true;
277  }
278  }
279  if (!found)
280  {
281  wA.append(sl*omegai);
282  wAID.append(ss);
283  }
284  }
285 
286  wAID.shrink();
287  // Now that every species of the reactions has been visited, we can
288  // compute the production and consumption rate. This way, it avoids
289  // getting wrong results when species are present in both lhs and rhs
290  forAll(wAID, id)
291  {
292  if (wA[id] > 0.0)
293  {
294  if (PA[wAID[id]] == 0.0)
295  {
296  PA[wAID[id]] = wA[id];
297  }
298  else
299  {
300  PA[wAID[id]] += wA[id];
301  }
302  }
303  else
304  {
305  if (CA[wAID[id]] == 0.0)
306  {
307  CA[wAID[id]] = -wA[id];
308  }
309  else
310  {
311  CA[wAID[id]] += -wA[id];
312  }
313  }
314  }
315  }
316  // rii = 0.0 by definition
317 
318  // Compute the production rate of each element Pa
319  label nElements = 4; // 4 main elements (C, H, O, N)
320  scalarList Pa(nElements,0.0);
321  scalarList Ca(nElements,0.0);
322 
323  // for (label q=0; q<SIS.size(); q++)
324  for (label i=0; i<this->nSpecie_; i++)
325  {
326  Pa[0] += sC_[i]*max(0.0,(PA[i]-CA[i]));
327  Ca[0] += sC_[i]*max(0.0,-(PA[i]-CA[i]));
328  Pa[1] += sH_[i]*max(0.0,(PA[i]-CA[i]));
329  Ca[1] += sH_[i]*max(0.0,-(PA[i]-CA[i]));
330  Pa[2] += sO_[i]*max(0.0,(PA[i]-CA[i]));
331  Ca[2] += sO_[i]*max(0.0,-(PA[i]-CA[i]));
332  Pa[3] += sN_[i]*max(0.0,(PA[i]-CA[i]));
333  Ca[3] += sN_[i]*max(0.0,-(PA[i]-CA[i]));
334  }
335 
336  // Using the rAB matrix (numerator and denominator separated)
337  // compute the R value according to the search initiating set
338  scalarField Rvalue(this->nSpecie_,0.0);
339  label speciesNumber = 0;
340  List<bool> disabledSpecies(this->nSpecie_,false);
341 
342  // set all species to inactive and activate them according
343  // to rAB and initial set
344  for (label i=0; i<this->nSpecie_; i++)
345  {
346  this->activeSpecies_[i] = false;
347  }
348  // Initialize the FIFOStack for search set
350  const labelList& SIS(this->searchInitSet_);
351  DynamicList<label> QStart(SIS.size());
352  DynamicList<scalar> alphaQ(SIS.size());
353 
354  // Compute the alpha coefficient and initialize the R value of the species
355  // in the SIS
356  for (label i=0; i<SIS.size(); i++)
357  {
358  label q = SIS[i];
359  // compute alpha
360  scalar alphaA(0.0);
361  // C
362  if (Pa[0] > VSMALL)
363  {
364  scalar alphaTmp = (sC_[q]*mag(PA[q]-CA[q])/Pa[0]);
365  if (alphaTmp > alphaA)
366  {
367  alphaA = alphaTmp;
368  }
369  }
370  // H
371  if (Pa[1] > VSMALL)
372  {
373  scalar alphaTmp = (sH_[q]*mag(PA[q]-CA[q])/Pa[1]);
374  if (alphaTmp > alphaA)
375  {
376  alphaA = alphaTmp;
377  }
378  }
379  // O
380  if (Pa[2] > VSMALL)
381  {
382  scalar alphaTmp = (sO_[q]*mag(PA[q]-CA[q])/Pa[2]);
383  if (alphaTmp > alphaA)
384  {
385  alphaA = alphaTmp;
386  }
387  }
388  // N
389  if (Pa[3] > VSMALL)
390  {
391  scalar alphaTmp = (sN_[q]*mag(PA[q]-CA[q])/Pa[3]);
392  if (alphaTmp > alphaA)
393  {
394  alphaA = alphaTmp;
395  }
396  }
397  if (alphaA > this->tolerance())
398  {
399  this->activeSpecies_[q] = true;
400  speciesNumber++;
401  Q.push(q);
402  QStart.append(q);
403  alphaQ.append(1.0);
404  Rvalue[q] = 1.0;
405  }
406  else
407  {
408  Rvalue[q] = alphaA;
409  }
410  }
411 
412  // if all species from the SIS has been removed
413  // force the use of the species with maximum Rvalue
414  if (Q.empty())
415  {
416  scalar Rmax=0.0;
417  label specID=-1;
418  forAll(SIS, i)
419  {
420  if (Rvalue[SIS[i]] > Rmax)
421  {
422  Rmax = Rvalue[SIS[i]];
423  specID=SIS[i];
424  }
425  }
426  Q.push(specID);
427  QStart.append(specID);
428  alphaQ.append(1.0);
429  speciesNumber++;
430  Rvalue[specID] = 1.0;
431  this->activeSpecies_[specID] = true;
432  }
433 
434  // Execute the main loop for R-value
435  while (!Q.empty())
436  {
437  label u = Q.pop();
438  scalar Den = max(PA[u],CA[u]);
439  if (Den > VSMALL)
440  {
441  for (label v=0; v<NbrABInit[u]; v++)
442  {
443  label otherSpec = rABOtherSpec(u, v);
444  scalar rAB = mag(rABNum(u, v))/Den;
445  if (rAB>1)
446  {
447  Info<< "Badly Conditioned rAB : " << rAB
448  << "species involved : "<<u << "," << otherSpec << endl;
449  rAB=1.0;
450  }
451 
452  scalar Rtemp = Rvalue[u]*rAB;
453  // a link analysed previously is stronger
454  if (Rvalue[otherSpec] < Rtemp)
455  {
456  Rvalue[otherSpec] = Rtemp;
457  // the (composed) link is stronger than the tolerance
458  if (Rtemp >= this->tolerance())
459  {
460  Q.push(otherSpec);
461  if (!this->activeSpecies_[otherSpec])
462  {
463  this->activeSpecies_[otherSpec] = true;
464  speciesNumber++;
465  }
466  }
467  }
468  }
469  }
470  }
471 
472  // Group-based reduction
473  // number of species disabled in the first step
474  label NDisabledSpecies(this->nSpecie_-speciesNumber);
475 
476  // while the number of removed species is greater than NGroupBased, the rAB
477  // are reevaluated according to the group based definition for each loop the
478  // temporary disabled species (in the first reduction) are sorted to disable
479  // definitely the NGroupBased species with lower R then these R value a
480  // reevaluated taking into account these disabled species
481  while(NDisabledSpecies > NGroupBased_)
482  {
483  // keep track of disabled species using sortablelist to extract only
484  // NGroupBased lower R value
485  SortableListDRGEP<scalar> Rdisabled(NDisabledSpecies);
486  labelList Rindex(NDisabledSpecies);
487  label nD = 0;
488  forAll(disabledSpecies, i)
489  {
490  // if just disabled and not in a previous loop
491  if (!this->activeSpecies_[i] && !disabledSpecies[i])
492  {
493  // Note: non-reached species will be removed first (Rvalue=0)
494  Rdisabled[nD] = Rvalue[i];
495  Rindex[nD++] = i;
496  }
497  }
498  // sort the Rvalue to obtain the NGroupBased lower R value
499  Rdisabled.partialSort(NGroupBased_);
500  labelList tmpIndex(Rdisabled.indices());
501 
502  // disable definitely NGroupBased species in this loop
503  for (label i=0; i<NGroupBased_; i++)
504  {
505  disabledSpecies[Rindex[tmpIndex[i]]] = true;
506  }
507  NDisabledSpecies -= NGroupBased_;
508 
509  // reevaluate the rAB according to the group-based definition rAB{S} [1]
510  // only update the numerator
511  forAll(NbrABInit, i)
512  {
513  for (label v=0; v<NbrABInit[i]; v++)
514  {
515  rABNum(i, v) = 0.0;
516  }
517  }
518  forAll(this->chemistry_.reactions(), i)
519  {
520  const Reaction<ThermoType>& R = this->chemistry_.reactions()[i];
521 
522  scalar omegai = omegaV[i];
523 
524  forAll(R.lhs(), s)
525  {
526  label ss = R.lhs()[s].index;
527  scalar sl = -R.lhs()[s].stoichCoeff; // vAi = v''-v' => here -v'
528  List<bool> deltaBi(this->nSpecie_, false);
529  bool alreadyDisabled(false);
530  FIFOStack<label> usedIndex;
531  forAll(R.lhs(), j)
532  {
533  label sj = R.lhs()[j].index;
534  usedIndex.push(sj);
535  deltaBi[sj] = true;
536  if (disabledSpecies[sj])
537  {
538  alreadyDisabled=true;
539  }
540  }
541  forAll(R.rhs(), j)
542  {
543  label sj = R.rhs()[j].index;
544  usedIndex.push(sj);
545  deltaBi[sj] = true;
546  if (disabledSpecies[sj])
547  {
548  alreadyDisabled=true;
549  }
550  }
551 
552  deltaBi[ss] = false;
553 
554  if (alreadyDisabled)
555  {
556  // if one of the species in this reaction is disabled, all
557  // species connected to species ss are modified
558  for (label v=0; v<NbrABInit[ss]; v++)
559  {
560  rABNum(ss, v) += sl*omegai;
561  }
562  }
563  else
564  {
565  while(!usedIndex.empty())
566  {
567  label curIndex = usedIndex.pop();
568  if (deltaBi[curIndex])
569  {
570  // disable to avoid counting it more than once
571  deltaBi[curIndex] = false;
572  rABNum(ss, rABPos(ss, curIndex)) += sl*omegai;
573  }
574  }
575  }
576  }
577 
578  forAll(R.rhs(), s)
579  {
580  label ss = R.rhs()[s].index;
581  scalar sl = R.rhs()[s].stoichCoeff; // vAi = v''-v' => here v''
582  List<bool> deltaBi(this->nSpecie_, false);
583  bool alreadyDisabled(false);
584  FIFOStack<label> usedIndex;
585  forAll(R.lhs(), j)
586  {
587  label sj = R.lhs()[j].index;
588  usedIndex.push(sj);
589  deltaBi[sj] = true;
590  if (disabledSpecies[sj])
591  {
592  alreadyDisabled=true;
593  }
594  }
595  forAll(R.rhs(), j)
596  {
597  label sj = R.rhs()[j].index;
598  usedIndex.push(sj);
599  deltaBi[sj] = true;
600  if (disabledSpecies[sj])
601  {
602  alreadyDisabled=true;
603  }
604  }
605 
606  deltaBi[ss] = false;
607 
608  if (alreadyDisabled)
609  {
610  // if one of the species in this reaction is disabled, all
611  // species connected to species ss are modified
612  for (label v=0; v<NbrABInit[ss]; v++)
613  {
614  rABNum(ss, v) += sl*omegai;
615  }
616  }
617  else
618  {
619  while(!usedIndex.empty())
620  {
621  label curIndex = usedIndex.pop();
622  if (deltaBi[curIndex])
623  {
624  deltaBi[curIndex] = false;
625  rABNum(ss, rABPos(ss, curIndex)) += sl*omegai;
626  }
627  }
628  }
629  }
630  }
631 
632  forAll(QStart, qi)
633  {
634  label u = QStart[qi];
635  Q.push(u);
636  }
637 
638  while (!Q.empty())
639  {
640  label u = Q.pop();
641  scalar Den = max(PA[u],CA[u]);
642  if (Den!=0.0)
643  {
644  for (label v=0; v<NbrABInit[u]; v++)
645  {
646  label otherSpec = rABOtherSpec(u, v);
647  if (!disabledSpecies[otherSpec])
648  {
649  scalar rAB = mag(rABNum(u, v))/Den;
650  if (rAB>1.0)
651  {
652  Info<< "Badly Conditioned rAB : " << rAB
653  << "species involved : "
654  <<this->chemistry_.Y()[u].name() << ","
655  << this->chemistry_.Y()[otherSpec].name()
656  << endl;
657  rAB=1.0;
658  }
659 
660  scalar Rtemp = Rvalue[u]*rAB;
661  // a link analysed previously is stronger
662  if (Rvalue[otherSpec] < Rtemp)
663  {
664  Rvalue[otherSpec] = Rtemp;
665  if (Rtemp >= this->tolerance())
666  {
667  Q.push(otherSpec);
668  if (!this->activeSpecies_[otherSpec])
669  {
670  this->activeSpecies_[otherSpec] = true;
671  speciesNumber++;
672  NDisabledSpecies--;
673  }
674  }
675  }
676  }
677  }
678  }
679  }
680  }
681 
682  // End of group-based reduction
683 
684  // Put a flag on the reactions containing at least one removed species
685  forAll(this->chemistry_.reactions(), i)
686  {
687  const Reaction<ThermoType>& R = this->chemistry_.reactions()[i];
688  this->chemistry_.reactionsDisabled()[i] = false;
689  forAll(R.lhs(), s)
690  {
691  label ss = R.lhs()[s].index;
692  if (!this->activeSpecies_[ss])
693  {
694  this->chemistry_.reactionsDisabled()[i] = true;
695  break;
696  }
697  }
698  if (!this->chemistry_.reactionsDisabled()[i])
699  {
700  forAll(R.rhs(), s)
701  {
702  label ss = R.rhs()[s].index;
703  if (!this->activeSpecies_[ss])
704  {
705  this->chemistry_.reactionsDisabled()[i] = true;
706  break;
707  }
708  }
709  }
710  }
711 
712  this->NsSimp_ = speciesNumber;
713  scalarField& simplifiedC(this->chemistry_.simplifiedC());
714  simplifiedC.setSize(this->NsSimp_+2);
715  DynamicList<label>& s2c(this->chemistry_.simplifiedToCompleteIndex());
716  s2c.setSize(this->NsSimp_);
717  Field<label>& c2s(this->chemistry_.completeToSimplifiedIndex());
718 
719  label j = 0;
720  for (label i=0; i<this->nSpecie_; i++)
721  {
722  if (this->activeSpecies_[i])
723  {
724  s2c[j] = i;
725  simplifiedC[j] = c[i];
726  c2s[i] = j++;
727  if (!this->chemistry_.active(i))
728  {
729  this->chemistry_.setActive(i);
730  }
731  }
732  else
733  {
734  c2s[i] = -1;
735  }
736  }
737  simplifiedC[this->NsSimp_] = T;
738  simplifiedC[this->NsSimp_+1] = p;
739  this->chemistry_.setNsDAC(this->NsSimp_);
740  // change temporary Ns in chemistryModel
741  // to make the function nEqns working
742  this->chemistry_.setNSpecie(this->NsSimp_);
743 }
744 
745 
746 // ************************************************************************* //
A FIFO stack based on a singly-linked list.
Definition: FIFOStack.H:51
DRGEP(const IOdictionary &dict, TDACChemistryModel< CompType, ThermoType > &chemistry)
Construct from components.
Definition: DRGEP.C:33
Extends chemistryModel by adding the TDAC method.
dictionary dict
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
Definition: dictionary.C:431
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:428
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
PtrList< volScalarField > & Y()
const List< specieCoeffs > & lhs() const
Definition: ReactionI.H:51
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
virtual ~DRGEP()
Destructor.
Definition: DRGEP.C:108
error FatalError
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
#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:60
void size(const label)
Override size to be inconsistent with allocated storage.
Definition: ListI.H:163
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:253
A list that is sorted upon construction or when explicitly requested with the sort() method...
Simple extension of ReactionThermo to handle reaction kinetics in addition to the equilibrium thermod...
Definition: Reaction.H:53
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:52
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
Definition: dictionary.C:692
virtual label nSpecie() const
The number of species.
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))
void setSize(const label)
Alter the addressed list size.
Definition: DynamicListI.H:163
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
Definition: DynamicList.H:56
const word & name() const
Return the name of the element.
label nAtoms() const
Return the number of atoms of this element in the specie.
label readLabel(Istream &is)
Definition: label.H:64
const volScalarField & T
void setSize(const label)
Reset size of List.
Definition: List.C:281
virtual void reduceMechanism(const scalarField &c, const scalar T, const scalar p)
Reduce the mechanism.
Definition: DRGEP.C:117
#define R(A, B, C, D, E, F, K, M)
void push(const T &a)
Push an element onto the stack.
Definition: FIFOStack.H:84
psiChemistryModel & chemistry
Definition: createFields.H:29
const dimensionedScalar c1
First radiation constant: default SI units: [W/m2].
messageStream Info
const labelList & indices() const
Return the list of sorted indices. Updated every sort.
dimensioned< scalar > mag(const dimensioned< Type > &)
T pop()
Pop the bottom element off the stack.
Definition: FIFOStack.H:90
An abstract class for methods of chemical mechanism reduction.
volScalarField & p
void partialSort(int M)
Partial sort the list (if changed after construction time)
bool found
const List< specieCoeffs > & rhs() const
Definition: ReactionI.H:59