chemPointISAT.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) 2016-2021 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 "chemPointISAT.H"
27 #include "SVD.H"
28 
29 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
30 
31 // Defined as static to be able to dynamically change it during simulations
32 // (all chemPoints refer to the same object)
33 template<class ThermoType>
35 
36 // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
37 
38 template<class ThermoType>
40 (
41  const label nCols,
43 )
44 {
45  scalarField c(nCols);
46  scalarField d(nCols);
47  scalar scale, sigma, sum;
48 
49  for (label k=0; k<nCols-1; k++)
50  {
51  scale = 0;
52  for (label i=k; i<nCols; i++)
53  {
54  scale=max(scale, mag(R(i, k)));
55  }
56  if (scale == 0)
57  {
58  c[k] = d[k] = 0;
59  }
60  else
61  {
62  for (label i=k; i<nCols; i++)
63  {
64  R(i, k) /= scale;
65  }
66  sum = 0;
67  for (label i=k; i<nCols; i++)
68  {
69  sum += sqr(R(i, k));
70  }
71  sigma = sign(R(k, k))*sqrt(sum);
72  R(k, k) += sigma;
73  c[k] = sigma*R(k, k);
74  d[k] = -scale*sigma;
75  for (label j=k+1; j<nCols; j++)
76  {
77  sum = 0;
78  for ( label i=k; i<nCols; i++)
79  {
80  sum += R(i, k)*R(i, j);
81  }
82  scalar tau = sum/c[k];
83  for ( label i=k; i<nCols; i++)
84  {
85  R(i, j) -= tau*R(i, k);
86  }
87  }
88  }
89  }
90 
91  d[nCols-1] = R(nCols-1, nCols-1);
92 
93  // form R
94  for (label i=0; i<nCols; i++)
95  {
96  R(i, i) = d[i];
97  for ( label j=0; j<i; j++)
98  {
99  R(i, j)=0;
100  }
101  }
102 }
103 
104 
105 template<class ThermoType>
107 (
109  const label n,
110  const Foam::scalarField &u,
111  const Foam::scalarField &v
112 )
113 {
114  label k;
115 
116  scalarField w(u);
117  for (k=n-1; k>=0; k--)
118  {
119  if (w[k] != 0)
120  {
121  break;
122  }
123  }
124 
125  if (k < 0)
126  {
127  k = 0;
128  }
129 
130  for (label i=k-1; i>=0; i--)
131  {
132  rotate(R, i, w[i],-w[i+1], n);
133  if (w[i] == 0)
134  {
135  w[i] = mag(w[i+1]);
136  }
137  else if (mag(w[i]) > mag(w[i+1]))
138  {
139  w[i] = mag(w[i])*sqrt(1.0 + sqr(w[i+1]/w[i]));
140  }
141  else
142  {
143  w[i] = mag(w[i+1])*sqrt(1.0 + sqr(w[i]/w[i+1]));
144  }
145  }
146 
147  for (label i=0; i<n; i++)
148  {
149  R(0, i) += w[0]*v[i];
150  }
151 
152  for (label i=0; i<k; i++)
153  {
154  rotate(R, i, R(i, i), -R(i+1, i), n);
155  }
156 }
157 
158 
159 template<class ThermoType>
161 (
163  const label i,
164  const scalar a,
165  const scalar b,
166  label n
167 )
168 {
169  scalar c, fact, s, w, y;
170  if (a == 0)
171  {
172  c = 0;
173  s = (b >= 0 ? 1 : -1);
174  }
175  else if (mag(a) > mag(b))
176  {
177  fact = b/a;
178  c = sign(a)/sqrt(1.0 + sqr(fact));
179  s = fact*c;
180  }
181  else
182  {
183  fact = a/b;
184  s = sign(b)/sqrt(1.0 + sqr(fact));
185  c = fact*s;
186  }
187  for (label j=i;j<n;j++)
188  {
189  y = R(i, j);
190  w = R(i+1, j);
191  R(i, j) = c*y-s*w;
192  R(i+1, j) = s*y+c*w;
193  }
194 }
195 
196 
197 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
198 
199 template<class ThermoType>
201 (
203  const scalarField& phi,
204  const scalarField& Rphi,
205  const scalarSquareMatrix& A,
206  const scalarField& scaleFactor,
207  const scalar& tolerance,
208  const label& completeSpaceSize,
209  const dictionary& coeffsDict,
211 )
212 :
213  chemistry_(chemistry),
214  phi_(phi),
215  Rphi_(Rphi),
216  A_(A),
217  scaleFactor_(scaleFactor),
218  node_(node),
219  completeSpaceSize_(completeSpaceSize),
220  nGrowth_(0),
221  nActiveSpecies_(chemistry.mechRed()->NsSimp()),
222  simplifiedToCompleteIndex_(nActiveSpecies_),
223  timeTag_(chemistry_.timeSteps()),
224  lastTimeUsed_(chemistry_.timeSteps()),
225  toRemove_(false),
226  maxNumNewDim_(coeffsDict.lookupOrDefault("maxNumNewDim",0)),
227  printProportion_(coeffsDict.lookupOrDefault("printProportion",false)),
228  numRetrieve_(0),
229  nLifeTime_(0),
230  completeToSimplifiedIndex_(completeSpaceSize - 3)
231 {
232  tolerance_ = tolerance;
233 
234  iddeltaT_ = completeSpaceSize - 1;
235  scaleFactor_[iddeltaT_] *= phi_[iddeltaT_] / tolerance_;
236 
237  idT_ = completeSpaceSize - 3;
238  idp_ = completeSpaceSize - 2;
239 
240  bool isMechRedActive = chemistry_.mechRed()->active();
241  if (isMechRedActive)
242  {
243  for (label i=0; i<completeSpaceSize-3; i++)
244  {
245  completeToSimplifiedIndex_[i] =
246  chemistry.completeToSimplifiedIndex()[i];
247  }
248  for (label i=0; i<nActiveSpecies_; i++)
249  {
250  simplifiedToCompleteIndex_[i] =
251  chemistry.simplifiedToCompleteIndex()[i];
252  }
253  }
254 
255  const label reduOrCompDim =
256  isMechRedActive ? nActiveSpecies_ + 3 : completeSpaceSize;
257 
258  // SVD decomposition A = U*D*V^T
259  SVD svdA(A);
260 
261  scalarDiagonalMatrix D(reduOrCompDim);
262  const scalarDiagonalMatrix& S = svdA.S();
263 
264  // Replace the value of vector D by max(D, 1/2), first ISAT paper
265  for (label i=0; i<reduOrCompDim; i++)
266  {
267  D[i] = max(S[i], 0.5);
268  }
269 
270  // Rebuild A with max length, tol and scale factor before QR decomposition
271  scalarRectangularMatrix Atilde(reduOrCompDim);
272 
273  // Result stored in Atilde
274  multiply(Atilde, svdA.U(), D, svdA.V().T());
275 
276  for (label i=0; i<reduOrCompDim; i++)
277  {
278  for (label j=0; j<reduOrCompDim; j++)
279  {
280  label compi = i;
281 
282  if (isMechRedActive)
283  {
284  compi = simplifiedToCompleteIndex(i);
285  }
286 
287  // SF*A/tolerance
288  // (where SF is diagonal with inverse of scale factors)
289  // SF*A is the same as dividing each line by the scale factor
290  // corresponding to the species of this line
291  Atilde(i, j) /= (tolerance*scaleFactor[compi]);
292  }
293  }
294 
295  // The object LT_ (the transpose of the Q) describe the EOA, since we have
296  // A^T B^T B A that should be factorised into L Q^T Q L^T and is set in the
297  // qrDecompose function
298  LT_ = scalarSquareMatrix(Atilde);
299 
300  qrDecompose(reduOrCompDim, LT_);
301 }
302 
303 
304 template<class ThermoType>
306 (
308 )
309 :
310  chemistry_(p.chemistry()),
311  phi_(p.phi()),
312  Rphi_(p.Rphi()),
313  LT_(p.LT()),
314  A_(p.A()),
315  scaleFactor_(p.scaleFactor()),
316  node_(p.node()),
317  completeSpaceSize_(p.completeSpaceSize()),
318  nGrowth_(p.nGrowth()),
319  nActiveSpecies_(p.nActiveSpecies()),
320  simplifiedToCompleteIndex_(p.simplifiedToCompleteIndex()),
321  timeTag_(p.timeTag()),
322  lastTimeUsed_(p.lastTimeUsed()),
323  toRemove_(p.toRemove()),
324  maxNumNewDim_(p.maxNumNewDim()),
325  numRetrieve_(0),
326  nLifeTime_(0),
327  completeToSimplifiedIndex_(p.completeToSimplifiedIndex())
328 {
329  tolerance_ = p.tolerance();
330 
331  idT_ = completeSpaceSize() - 3;
332  idp_ = completeSpaceSize() - 2;
333  iddeltaT_ = completeSpaceSize() - 1;
334 }
335 
336 
337 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
338 
339 template<class ThermoType>
341 {
342  scalarField dphi(phiq-phi());
343  bool isMechRedActive = chemistry_.mechRed()->active();
344 
345  const label dim =
346  isMechRedActive ? nActiveSpecies_ : completeSpaceSize() - 3;
347 
348  scalar epsTemp = 0;
349  List<scalar> propEps(completeSpaceSize(), scalar(0));
350 
351  for (label i=0; i<completeSpaceSize()-3; i++)
352  {
353  scalar temp = 0;
354 
355  // When mechanism reduction is inactive OR on active species multiply L
356  // by dphi to get the distance in the active species direction else (for
357  // inactive species), just multiply the diagonal element and dphi
358  if
359  (
360  !(isMechRedActive)
361  ||(isMechRedActive && completeToSimplifiedIndex_[i] != -1)
362  )
363  {
364  label si=(isMechRedActive) ? completeToSimplifiedIndex_[i] : i;
365 
366  for (label j=si; j<dim; j++)// LT is upper triangular
367  {
368  label sj=(isMechRedActive) ? simplifiedToCompleteIndex_[j] : j;
369  temp += LT_(si, j)*dphi[sj];
370  }
371 
372  temp += LT_(si, dim)*dphi[idT_];
373  temp += LT_(si, dim+1)*dphi[idp_];
374  temp += LT_(si, dim+2)*dphi[iddeltaT_];
375  }
376  else
377  {
378  temp = dphi[i]/(tolerance_*scaleFactor_[i]);
379  }
380 
381  epsTemp += sqr(temp);
382 
383  if (printProportion_)
384  {
385  propEps[i] = temp;
386  }
387  }
388 
389  // Temperature
390  epsTemp +=
391  sqr
392  (
393  LT_(dim, dim)*dphi[idT_]
394  +LT_(dim, dim+1)*dphi[idp_]
395  +LT_(dim, dim+2)*dphi[iddeltaT_]
396  );
397 
398  // Pressure
399  epsTemp +=
400  sqr
401  (
402  LT_(dim+1, dim+1)*dphi[idp_]
403  +LT_(dim+1, dim+2)*dphi[iddeltaT_]
404  );
405 
406  epsTemp += sqr(LT_[dim+2][dim+2]*dphi[iddeltaT_]);
407 
408  if (printProportion_)
409  {
410  propEps[idT_] = sqr
411  (
412  LT_(dim, dim)*dphi[idT_]
413  + LT_(dim, dim+1)*dphi[idp_]
414  );
415 
416  propEps[idp_] =
417  sqr(LT_(dim+1, dim+1)*dphi[idp_]);
418 
419  propEps[iddeltaT_] =
420  sqr(LT_[dim+2][dim+2]*dphi[iddeltaT_]);
421  }
422 
423  if (sqrt(epsTemp) > 1 + tolerance_)
424  {
425  if (printProportion_)
426  {
427  scalar max = -1;
428  label maxIndex = -1;
429  for (label i=0; i<completeSpaceSize(); i++)
430  {
431  if(max < propEps[i])
432  {
433  max = propEps[i];
434  maxIndex = i;
435  }
436  }
437  word propName;
438  if (maxIndex >= completeSpaceSize() - 3)
439  {
440  if (maxIndex == idT_)
441  {
442  propName = "T";
443  }
444  else if (maxIndex == idp_)
445  {
446  propName = "p";
447  }
448  else if (maxIndex == iddeltaT_)
449  {
450  propName = "deltaT";
451  }
452  }
453  else
454  {
455  propName = chemistry_.Y()[maxIndex].member();
456  }
457  Info<< "Direction maximum impact to error in ellipsoid: "
458  << propName << endl;
459  Info<< "Proportion to the total error on the retrieve: "
460  << max/(epsTemp+small) << endl;
461  }
462  return false;
463  }
464  else
465  {
466  return true;
467  }
468 }
469 
470 
471 template<class ThermoType>
473 (
474  const scalarField& phiq,
475  const scalarField& Rphiq
476 )
477 {
478  scalar eps2 = 0;
479  scalarField dR(Rphiq - Rphi());
480  scalarField dphi(phiq - phi());
481  const scalarField& scaleFactorV(scaleFactor());
482  const scalarSquareMatrix& Avar(A());
483  bool isMechRedActive = chemistry_.mechRed()->active();
484  scalar dRl = 0;
485 
486  const label dim =
487  isMechRedActive ? nActiveSpecies_ : completeSpaceSize() - 2;
488 
489  // Since we build only the solution for the species, T and p are not
490  // included
491  for (label i=0; i<completeSpaceSize()-3; i++)
492  {
493  dRl = 0;
494  if (isMechRedActive)
495  {
496  label si = completeToSimplifiedIndex_[i];
497 
498  // If this species is active
499  if (si != -1)
500  {
501  for (label j=0; j<dim; j++)
502  {
503  label sj=simplifiedToCompleteIndex_[j];
504  dRl += Avar(si, j)*dphi[sj];
505  }
506  dRl += Avar(si, nActiveSpecies_)*dphi[idT_];
507  dRl += Avar(si, nActiveSpecies_+1)*dphi[idp_];
508  dRl += Avar(si, nActiveSpecies_+2)*dphi[iddeltaT_];
509  }
510  else
511  {
512  dRl = dphi[i];
513  }
514  }
515  else
516  {
517  for (label j=0; j<completeSpaceSize(); j++)
518  {
519  dRl += Avar(i, j)*dphi[j];
520  }
521  }
522  eps2 += sqr((dR[i]-dRl)/scaleFactorV[i]);
523  }
524 
525  eps2 = sqrt(eps2);
526  if (eps2 > tolerance())
527  {
528  return false;
529  }
530  else
531  {
532  // if the solution is in the ellipsoid of accuracy
533  return true;
534  }
535 }
536 
537 
538 template<class ThermoType>
540 {
541  scalarField dphi(phiq - phi());
542  label initNActiveSpecies(nActiveSpecies_);
543  bool isMechRedActive = chemistry_.mechRed()->active();
544 
545  if (isMechRedActive)
546  {
547  label activeAdded(0);
548  DynamicList<label> dimToAdd(0);
549 
550  // check if the difference of active species is lower than the maximum
551  // number of new dimensions allowed
552  for (label i=0; i<completeSpaceSize()-3; i++)
553  {
554  // first test if the current chemPoint has an inactive species
555  // corresponding to an active one in the query point
556  if
557  (
558  completeToSimplifiedIndex_[i] == -1
559  && chemistry_.completeToSimplifiedIndex()[i]!=-1
560  )
561  {
562  activeAdded++;
563  dimToAdd.append(i);
564  }
565  // then test if an active species in the current chemPoint
566  // corresponds to an inactive on the query side
567  if
568  (
569  completeToSimplifiedIndex_[i] != -1
570  && chemistry_.completeToSimplifiedIndex()[i] == -1
571  )
572  {
573  activeAdded++;
574  // we don't need to add a new dimension but we count it to have
575  // control on the difference through maxNumNewDim
576  }
577  // finally test if both points have inactive species but
578  // with a dphi!=0
579  if
580  (
581  completeToSimplifiedIndex_[i] == -1
582  && chemistry_.completeToSimplifiedIndex()[i] == -1
583  && dphi[i] != 0
584  )
585  {
586  activeAdded++;
587  dimToAdd.append(i);
588  }
589  }
590 
591  // if the number of added dimension is too large, growth fail
592  if (activeAdded > maxNumNewDim_)
593  {
594  return false;
595  }
596 
597  // the number of added dimension to the current chemPoint
598  nActiveSpecies_ += dimToAdd.size();
599  simplifiedToCompleteIndex_.setSize(nActiveSpecies_);
600  forAll(dimToAdd, i)
601  {
602  label si = nActiveSpecies_ - dimToAdd.size() + i;
603  // add the new active species
604  simplifiedToCompleteIndex_[si] = dimToAdd[i];
605  completeToSimplifiedIndex_[dimToAdd[i]] = si;
606  }
607 
608  // update LT and A :
609  //-add new column and line for the new active species
610  //-transfer last two lines of the previous matrix (p and T) to the end
611  // (change the diagonal position)
612  //-set all element of the new lines and columns to zero except diagonal
613  // (=1/(tolerance*scaleFactor))
614  if (nActiveSpecies_ > initNActiveSpecies)
615  {
616  scalarSquareMatrix LTvar = LT_; // take a copy of LT_
617  scalarSquareMatrix Avar = A_; // take a copy of A_
618  LT_ = scalarSquareMatrix(nActiveSpecies_+3, Zero);
619  A_ = scalarSquareMatrix(nActiveSpecies_+3, Zero);
620 
621  // write the initial active species
622  for (label i=0; i<initNActiveSpecies; i++)
623  {
624  for (label j=0; j<initNActiveSpecies; j++)
625  {
626  LT_(i, j) = LTvar(i, j);
627  A_(i, j) = Avar(i, j);
628  }
629  }
630 
631  // write the columns for temperature and pressure
632  for (label i=0; i<initNActiveSpecies; i++)
633  {
634  for (label j=1; j>=0; j--)
635  {
636  LT_(i, nActiveSpecies_+j)=LTvar(i, initNActiveSpecies+j);
637  A_(i, nActiveSpecies_+j)=Avar(i, initNActiveSpecies+j);
638  LT_(nActiveSpecies_+j, i)=LTvar(initNActiveSpecies+j, i);
639  A_(nActiveSpecies_+j, i)=Avar(initNActiveSpecies+j, i);
640  }
641  }
642  // end with the diagonal elements for temperature and pressure
643  LT_(nActiveSpecies_, nActiveSpecies_)=
644  LTvar(initNActiveSpecies, initNActiveSpecies);
645  A_(nActiveSpecies_, nActiveSpecies_)=
646  Avar(initNActiveSpecies, initNActiveSpecies);
647  LT_(nActiveSpecies_+1, nActiveSpecies_+1)=
648  LTvar(initNActiveSpecies+1, initNActiveSpecies+1);
649  A_(nActiveSpecies_+1, nActiveSpecies_+1)=
650  Avar(initNActiveSpecies+1, initNActiveSpecies+1);
651  LT_(nActiveSpecies_+2, nActiveSpecies_+2)=
652  LTvar(initNActiveSpecies+2, initNActiveSpecies+2);
653  A_(nActiveSpecies_+2, nActiveSpecies_+2)=
654  Avar(initNActiveSpecies+2, initNActiveSpecies+2);
655 
656  for (label i=initNActiveSpecies; i<nActiveSpecies_;i++)
657  {
658  LT_(i, i)=
659  1.0
660  /(tolerance_*scaleFactor_[simplifiedToCompleteIndex_[i]]);
661  A_(i, i) = 1;
662  }
663  }
664  }
665 
666  const label dim =
667  isMechRedActive ? nActiveSpecies_ + 3 : completeSpaceSize();
668 
669  // beginning of grow algorithm
670  scalarField phiTilde(dim, 0);
671  scalar normPhiTilde = 0;
672  // p' = L^T.(p-phi)
673 
674  for (label i=0; i<dim; i++)
675  {
676  for (label j=i; j<dim-3; j++)// LT is upper triangular
677  {
678  label sj = j;
679  if (isMechRedActive)
680  {
681  sj = simplifiedToCompleteIndex_[j];
682  }
683  phiTilde[i] += LT_(i, j)*dphi[sj];
684  }
685 
686  phiTilde[i] += LT_(i, dim-3)*dphi[idT_];
687  phiTilde[i] += LT_(i, dim-3+1)*dphi[idp_];
688  phiTilde[i] += LT_(i, dim-3+2)*dphi[iddeltaT_];
689 
690  normPhiTilde += sqr(phiTilde[i]);
691  }
692 
693  scalar invSqrNormPhiTilde = 1.0/normPhiTilde;
694  normPhiTilde = sqrt(normPhiTilde);
695 
696  // gamma = (1/|p'| - 1)/|p'|^2
697  scalar gamma = (1/normPhiTilde - 1)*invSqrNormPhiTilde;
698  scalarField u(gamma*phiTilde);
699  scalarField v(dim, 0);
700 
701  for (label i=0; i<dim; i++)
702  {
703  for (label j=0; j<=i;j++)
704  {
705  v[i] += phiTilde[j]*LT_(j, i);
706  }
707  }
708 
709  qrUpdate(LT_,dim, u, v);
710  nGrowth_++;
711 
712  return true;
713 }
714 
715 
716 template<class ThermoType>
718 {
719  this->numRetrieve_++;
720 }
721 
722 
723 template<class ThermoType>
725 {
726  this->numRetrieve_ = 0;
727 }
728 
729 
730 template<class ThermoType>
732 {
733  this->nLifeTime_++;
734 }
735 
736 
737 template<class ThermoType>
739 (
740  const label i
741 )
742 {
743  if (i < nActiveSpecies_)
744  {
745  return simplifiedToCompleteIndex_[i];
746  }
747  else if (i == nActiveSpecies_)
748  {
749  return completeSpaceSize_ - 3;
750  }
751  else if (i == nActiveSpecies_ + 1)
752  {
753  return completeSpaceSize_ - 2;
754  }
755  else if (i == nActiveSpecies_ + 2)
756  {
757  return completeSpaceSize_ - 1;
758  }
759  else
760  {
761  return -1;
762  }
763 }
764 
765 
766 // ************************************************************************* //
dimensionedScalar sign(const dimensionedScalar &ds)
Extends standardChemistryModel by adding the TDAC method.
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:434
void multiply(FieldField< Field, Type > &f, const FieldField< Field, Type > &f1, const FieldField< Field, scalar > &f2)
const scalar & tolerance()
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
const scalarSquareMatrix & A() const
const scalarSquareMatrix & LT() const
List< label > & simplifiedToCompleteIndex()
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
const scalarRectangularMatrix & U() const
Return U.
Definition: SVDI.H:38
Form T() const
Return the transpose of the matrix.
Definition: Matrix.C:264
dimensionedSymmTensor sqr(const dimensionedVector &dv)
void size(const label)
Override size to be inconsistent with allocated storage.
Definition: ListI.H:164
bool checkSolution(const scalarField &phiq, const scalarField &Rphiq)
If phiq is not in the EOA, then the mapping is computed.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m K].
Definition: createFields.H:27
dimensionedScalar sqrt(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Leaf of the binary tree. The chemPoint stores the composition &#39;phi&#39;, the mapping of this composition ...
Field< label > & completeToSimplifiedIndex()
List< label > & completeToSimplifiedIndex()
label k
Boltzmann constant.
const dimensionedScalar c
Speed of light in a vacuum.
const label & timeTag()
chemPointISAT(TDACChemistryModel< ThermoType > &chemistry, const scalarField &phi, const scalarField &Rphi, const scalarSquareMatrix &A, const scalarField &scaleFactor, const scalar &tolerance, const label &completeSpaceSize, const dictionary &coeffsDict, binaryNode< ThermoType > *node=nullptr)
Construct from components.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
autoPtr< chemistryReductionMethod< ThermoType > > & mechRed()
DynamicList< label > & simplifiedToCompleteIndex()
const dimensionedScalar sigma
Stefan-Boltzmann constant: default SI units: [W/m^2/K^4].
binaryNode< ThermoType > *& node()
scalar y
const scalarDiagonalMatrix & S() const
Return the singular values.
Definition: SVDI.H:50
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))
A class for handling words, derived from string.
Definition: word.H:59
const scalarField & scaleFactor()
tmp< fvMatrix< Type > > S(const Pair< tmp< volScalarField::Internal >> &, const GeometricField< Type, fvPatchField, volMesh > &)
TDACChemistryModel< ThermoType > & chemistry()
Access to the TDACChemistryModel.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
Definition: DynamicListI.H:296
bool grow(const scalarField &phiq)
More details about the minimum-volume ellipsoid covering an.
Singular value decomposition of a rectangular matrix.
Definition: SVD.H:51
phi
Definition: correctPhi.H:3
static const zero Zero
Definition: zero.H:97
Node of the binary tree.
Definition: binaryNode.H:49
const scalarField & phi() const
volScalarField scalarField(fieldObject, mesh)
const scalarField & Rphi() const
const scalarRectangularMatrix & V() const
Return the square matrix V.
Definition: SVDI.H:44
void resetNumRetrieve()
Resets the number of retrieves at each time step.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
#define R(A, B, C, D, E, F, K, M)
void increaseNLifeTime()
Increases the "counter" of the chP life.
label & completeSpaceSize()
void increaseNumRetrieve()
Increases the number of retrieves the chempoint has generated.
bool inEOA(const scalarField &phiq)
To RETRIEVE the mapping from the stored chemPoint phi, the query.
messageStream Info
dimensioned< scalar > mag(const dimensioned< Type > &)
label n
SquareMatrix< scalar > scalarSquareMatrix