chemistryModel.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) 2011-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 "chemistryModel.H"
27 #include "reactingMixture.H"
28 #include "UniformField.H"
30 
31 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32 
33 template<class CompType, class ThermoType>
35 (
36  const fvMesh& mesh,
37  const word& phaseName
38 )
39 :
40  CompType(mesh, phaseName),
41  ODESystem(),
42  Y_(this->thermo().composition().Y()),
43  reactions_
44  (
45  dynamic_cast<const reactingMixture<ThermoType>&>(this->thermo())
46  ),
47  specieThermo_
48  (
49  dynamic_cast<const reactingMixture<ThermoType>&>
50  (this->thermo()).speciesData()
51  ),
52 
53  nSpecie_(Y_.size()),
54  nReaction_(reactions_.size()),
55  Treact_(CompType::template lookupOrDefault<scalar>("Treact", 0.0)),
56  RR_(nSpecie_)
57 {
58  // create the fields for the chemistry sources
59  forAll(RR_, fieldi)
60  {
61  RR_.set
62  (
63  fieldi,
65  (
66  IOobject
67  (
68  "RR." + Y_[fieldi].name(),
69  mesh.time().timeName(),
70  mesh,
71  IOobject::NO_READ,
72  IOobject::NO_WRITE
73  ),
74  mesh,
76  )
77  );
78  }
79 
80  Info<< "chemistryModel: Number of species = " << nSpecie_
81  << " and reactions = " << nReaction_ << endl;
82 }
83 
84 
85 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
86 
87 template<class CompType, class ThermoType>
89 {}
90 
91 
92 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
93 
94 template<class CompType, class ThermoType>
97 (
98  const scalarField& c,
99  const scalar T,
100  const scalar p
101 ) const
102 {
103  scalar pf, cf, pr, cr;
104  label lRef, rRef;
105 
106  tmp<scalarField> tom(new scalarField(nEqns(), 0.0));
107  scalarField& om = tom.ref();
108 
109  forAll(reactions_, i)
110  {
111  const Reaction<ThermoType>& R = reactions_[i];
112 
113  scalar omegai = omega
114  (
115  R, c, T, p, pf, cf, lRef, pr, cr, rRef
116  );
117 
118  forAll(R.lhs(), s)
119  {
120  const label si = R.lhs()[s].index;
121  const scalar sl = R.lhs()[s].stoichCoeff;
122  om[si] -= sl*omegai;
123  }
124 
125  forAll(R.rhs(), s)
126  {
127  const label si = R.rhs()[s].index;
128  const scalar sr = R.rhs()[s].stoichCoeff;
129  om[si] += sr*omegai;
130  }
131  }
132 
133  return tom;
134 }
135 
136 
137 template<class CompType, class ThermoType>
139 (
140  const label index,
141  const scalarField& c,
142  const scalar T,
143  const scalar p,
144  scalar& pf,
145  scalar& cf,
146  label& lRef,
147  scalar& pr,
148  scalar& cr,
149  label& rRef
150 ) const
151 {
152 
153  const Reaction<ThermoType>& R = reactions_[index];
154  scalar w = omega(R, c, T, p, pf, cf, lRef, pr, cr, rRef);
155  return(w);
156 }
157 
158 
159 template<class CompType, class ThermoType>
161 (
162  const Reaction<ThermoType>& R,
163  const scalarField& c,
164  const scalar T,
165  const scalar p,
166  scalar& pf,
167  scalar& cf,
168  label& lRef,
169  scalar& pr,
170  scalar& cr,
171  label& rRef
172 ) const
173 {
174  scalarField c2(nSpecie_, 0.0);
175  for (label i = 0; i < nSpecie_; i++)
176  {
177  c2[i] = max(0.0, c[i]);
178  }
179 
180  const scalar kf = R.kf(p, T, c2);
181  const scalar kr = R.kr(kf, p, T, c2);
182 
183  pf = 1.0;
184  pr = 1.0;
185 
186  const label Nl = R.lhs().size();
187  const label Nr = R.rhs().size();
188 
189  label slRef = 0;
190  lRef = R.lhs()[slRef].index;
191 
192  pf = kf;
193  for (label s = 1; s < Nl; s++)
194  {
195  const label si = R.lhs()[s].index;
196 
197  if (c[si] < c[lRef])
198  {
199  const scalar exp = R.lhs()[slRef].exponent;
200  pf *= pow(max(0.0, c[lRef]), exp);
201  lRef = si;
202  slRef = s;
203  }
204  else
205  {
206  const scalar exp = R.lhs()[s].exponent;
207  pf *= pow(max(0.0, c[si]), exp);
208  }
209  }
210  cf = max(0.0, c[lRef]);
211 
212  {
213  const scalar exp = R.lhs()[slRef].exponent;
214  if (exp < 1.0)
215  {
216  if (cf > SMALL)
217  {
218  pf *= pow(cf, exp - 1.0);
219  }
220  else
221  {
222  pf = 0.0;
223  }
224  }
225  else
226  {
227  pf *= pow(cf, exp - 1.0);
228  }
229  }
230 
231  label srRef = 0;
232  rRef = R.rhs()[srRef].index;
233 
234  // find the matrix element and element position for the rhs
235  pr = kr;
236  for (label s = 1; s < Nr; s++)
237  {
238  const label si = R.rhs()[s].index;
239  if (c[si] < c[rRef])
240  {
241  const scalar exp = R.rhs()[srRef].exponent;
242  pr *= pow(max(0.0, c[rRef]), exp);
243  rRef = si;
244  srRef = s;
245  }
246  else
247  {
248  const scalar exp = R.rhs()[s].exponent;
249  pr *= pow(max(0.0, c[si]), exp);
250  }
251  }
252  cr = max(0.0, c[rRef]);
253 
254  {
255  const scalar exp = R.rhs()[srRef].exponent;
256  if (exp < 1.0)
257  {
258  if (cr>SMALL)
259  {
260  pr *= pow(cr, exp - 1.0);
261  }
262  else
263  {
264  pr = 0.0;
265  }
266  }
267  else
268  {
269  pr *= pow(cr, exp - 1.0);
270  }
271  }
272 
273  return pf*cf - pr*cr;
274 }
275 
276 
277 template<class CompType, class ThermoType>
279 (
280  const scalar time,
281  const scalarField &c,
282  scalarField& dcdt
283 ) const
284 {
285  const scalar T = c[nSpecie_];
286  const scalar p = c[nSpecie_ + 1];
287 
288  dcdt = omega(c, T, p);
289 
290  // constant pressure
291  // dT/dt = ...
292  scalar rho = 0.0;
293  scalar cSum = 0.0;
294  for (label i = 0; i < nSpecie_; i++)
295  {
296  const scalar W = specieThermo_[i].W();
297  cSum += c[i];
298  rho += W*c[i];
299  }
300  scalar cp = 0.0;
301  for (label i=0; i<nSpecie_; i++)
302  {
303  cp += c[i]*specieThermo_[i].cp(p, T);
304  }
305  cp /= rho;
306 
307  scalar dT = 0.0;
308  for (label i = 0; i < nSpecie_; i++)
309  {
310  const scalar hi = specieThermo_[i].ha(p, T);
311  dT += hi*dcdt[i];
312  }
313  dT /= rho*cp;
314 
315  dcdt[nSpecie_] = -dT;
316 
317  // dp/dt = ...
318  dcdt[nSpecie_ + 1] = 0.0;
319 }
320 
321 
322 template<class CompType, class ThermoType>
324 (
325  const scalar t,
326  const scalarField& c,
327  scalarField& dcdt,
328  scalarSquareMatrix& dfdc
329 ) const
330 {
331  const scalar T = c[nSpecie_];
332  const scalar p = c[nSpecie_ + 1];
333 
334  scalarField c2(nSpecie_, 0.0);
335  forAll(c2, i)
336  {
337  c2[i] = max(c[i], 0.0);
338  }
339 
340  for (label i=0; i<nEqns(); i++)
341  {
342  for (label j=0; j<nEqns(); j++)
343  {
344  dfdc(i, j) = 0.0;
345  }
346  }
347 
348  // Length of the first argument must be nSpecie()
349  dcdt = omega(c2, T, p);
350 
351  forAll(reactions_, ri)
352  {
353  const Reaction<ThermoType>& R = reactions_[ri];
354 
355  const scalar kf0 = R.kf(p, T, c2);
356  const scalar kr0 = R.kr(kf0, p, T, c2);
357 
358  forAll(R.lhs(), j)
359  {
360  const label sj = R.lhs()[j].index;
361  scalar kf = kf0;
362  forAll(R.lhs(), i)
363  {
364  const label si = R.lhs()[i].index;
365  const scalar el = R.lhs()[i].exponent;
366  if (i == j)
367  {
368  if (el < 1.0)
369  {
370  if (c2[si] > SMALL)
371  {
372  kf *= el*pow(c2[si] + VSMALL, el - 1.0);
373  }
374  else
375  {
376  kf = 0.0;
377  }
378  }
379  else
380  {
381  kf *= el*pow(c2[si], el - 1.0);
382  }
383  }
384  else
385  {
386  kf *= pow(c2[si], el);
387  }
388  }
389 
390  forAll(R.lhs(), i)
391  {
392  const label si = R.lhs()[i].index;
393  const scalar sl = R.lhs()[i].stoichCoeff;
394  dfdc[si][sj] -= sl*kf;
395  }
396  forAll(R.rhs(), i)
397  {
398  const label si = R.rhs()[i].index;
399  const scalar sr = R.rhs()[i].stoichCoeff;
400  dfdc[si][sj] += sr*kf;
401  }
402  }
403 
404  forAll(R.rhs(), j)
405  {
406  const label sj = R.rhs()[j].index;
407  scalar kr = kr0;
408  forAll(R.rhs(), i)
409  {
410  const label si = R.rhs()[i].index;
411  const scalar er = R.rhs()[i].exponent;
412  if (i == j)
413  {
414  if (er < 1.0)
415  {
416  if (c2[si] > SMALL)
417  {
418  kr *= er*pow(c2[si] + VSMALL, er - 1.0);
419  }
420  else
421  {
422  kr = 0.0;
423  }
424  }
425  else
426  {
427  kr *= er*pow(c2[si], er - 1.0);
428  }
429  }
430  else
431  {
432  kr *= pow(c2[si], er);
433  }
434  }
435 
436  forAll(R.lhs(), i)
437  {
438  const label si = R.lhs()[i].index;
439  const scalar sl = R.lhs()[i].stoichCoeff;
440  dfdc[si][sj] += sl*kr;
441  }
442  forAll(R.rhs(), i)
443  {
444  const label si = R.rhs()[i].index;
445  const scalar sr = R.rhs()[i].stoichCoeff;
446  dfdc[si][sj] -= sr*kr;
447  }
448  }
449  }
450 
451  // Calculate the dcdT elements numerically
452  const scalar delta = 1.0e-3;
453  const scalarField dcdT0(omega(c2, T - delta, p));
454  const scalarField dcdT1(omega(c2, T + delta, p));
455 
456  for (label i = 0; i < nEqns(); i++)
457  {
458  dfdc[i][nSpecie()] = 0.5*(dcdT1[i] - dcdT0[i])/delta;
459  }
460 }
461 
462 
463 template<class CompType, class ThermoType>
466 {
467  scalar pf, cf, pr, cr;
468  label lRef, rRef;
469 
470  const volScalarField rho
471  (
472  IOobject
473  (
474  "rho",
475  this->time().timeName(),
476  this->mesh(),
477  IOobject::NO_READ,
478  IOobject::NO_WRITE,
479  false
480  ),
481  this->thermo().rho()
482  );
483 
485  (
486  new volScalarField
487  (
488  IOobject
489  (
490  "tc",
491  this->time().timeName(),
492  this->mesh(),
493  IOobject::NO_READ,
494  IOobject::NO_WRITE,
495  false
496  ),
497  this->mesh(),
498  dimensionedScalar("zero", dimTime, SMALL),
499  extrapolatedCalculatedFvPatchScalarField::typeName
500  )
501  );
502 
503  scalarField& tc = ttc.ref();
504  const scalarField& T = this->thermo().T();
505  const scalarField& p = this->thermo().p();
506 
507  const label nReaction = reactions_.size();
508 
509  if (this->chemistry_)
510  {
511  forAll(rho, celli)
512  {
513  scalar rhoi = rho[celli];
514  scalar Ti = T[celli];
515  scalar pi = p[celli];
516  scalarField c(nSpecie_);
517  scalar cSum = 0.0;
518 
519  for (label i=0; i<nSpecie_; i++)
520  {
521  scalar Yi = Y_[i][celli];
522  c[i] = rhoi*Yi/specieThermo_[i].W();
523  cSum += c[i];
524  }
525 
526  forAll(reactions_, i)
527  {
528  const Reaction<ThermoType>& R = reactions_[i];
529 
530  omega(R, c, Ti, pi, pf, cf, lRef, pr, cr, rRef);
531 
532  forAll(R.rhs(), s)
533  {
534  scalar sr = R.rhs()[s].stoichCoeff;
535  tc[celli] += sr*pf*cf;
536  }
537  }
538  tc[celli] = nReaction*cSum/tc[celli];
539  }
540  }
541 
542 
543  ttc.ref().correctBoundaryConditions();
544 
545  return ttc;
546 }
547 
548 
549 template<class CompType, class ThermoType>
552 {
554  (
555  new volScalarField
556  (
557  IOobject
558  (
559  "Sh",
560  this->mesh_.time().timeName(),
561  this->mesh_,
562  IOobject::NO_READ,
563  IOobject::NO_WRITE,
564  false
565  ),
566  this->mesh_,
568  )
569  );
570 
571  if (this->chemistry_)
572  {
573  scalarField& Sh = tSh.ref();
574 
575  forAll(Y_, i)
576  {
577  forAll(Sh, celli)
578  {
579  const scalar hi = specieThermo_[i].Hc();
580  Sh[celli] -= hi*RR_[i][celli];
581  }
582  }
583  }
584 
585  return tSh;
586 }
587 
588 
589 template<class CompType, class ThermoType>
592 {
594  (
595  new volScalarField
596  (
597  IOobject
598  (
599  "dQ",
600  this->mesh_.time().timeName(),
601  this->mesh_,
602  IOobject::NO_READ,
603  IOobject::NO_WRITE,
604  false
605  ),
606  this->mesh_,
608  )
609  );
610 
611  if (this->chemistry_)
612  {
613  volScalarField& dQ = tdQ.ref();
614  dQ.ref() = this->mesh_.V()*Sh()();
615  }
616 
617  return tdQ;
618 }
619 
620 
621 template<class CompType, class ThermoType>
623 {
624  // nEqns = number of species + temperature + pressure
625  return nSpecie_ + 2;
626 }
627 
628 
629 template<class CompType, class ThermoType>
632 (
633  const label reactionI,
634  const label speciei
635 ) const
636 {
637  scalar pf, cf, pr, cr;
638  label lRef, rRef;
639 
640  const volScalarField rho
641  (
642  IOobject
643  (
644  "rho",
645  this->time().timeName(),
646  this->mesh(),
647  IOobject::NO_READ,
648  IOobject::NO_WRITE,
649  false
650  ),
651  this->thermo().rho()
652  );
653 
655  (
657  (
658  IOobject
659  (
660  "RR",
661  this->mesh().time().timeName(),
662  this->mesh(),
663  IOobject::NO_READ,
664  IOobject::NO_WRITE
665  ),
666  this->mesh(),
668  )
669  );
670 
672 
673  const scalarField& T = this->thermo().T();
674  const scalarField& p = this->thermo().p();
675 
676  forAll(rho, celli)
677  {
678  const scalar rhoi = rho[celli];
679  const scalar Ti = T[celli];
680  const scalar pi = p[celli];
681 
682  scalarField c(nSpecie_, 0.0);
683  for (label i=0; i<nSpecie_; i++)
684  {
685  const scalar Yi = Y_[i][celli];
686  c[i] = rhoi*Yi/specieThermo_[i].W();
687  }
688 
689  const scalar w = omegaI
690  (
691  reactionI,
692  c,
693  Ti,
694  pi,
695  pf,
696  cf,
697  lRef,
698  pr,
699  cr,
700  rRef
701  );
702 
703  RR[celli] = w*specieThermo_[speciei].W();
704 
705  }
706 
707  return tRR;
708 }
709 
710 
711 template<class CompType, class ThermoType>
713 {
714  if (!this->chemistry_)
715  {
716  return;
717  }
718 
719  const volScalarField rho
720  (
721  IOobject
722  (
723  "rho",
724  this->time().timeName(),
725  this->mesh(),
726  IOobject::NO_READ,
727  IOobject::NO_WRITE,
728  false
729  ),
730  this->thermo().rho()
731  );
732 
733  const scalarField& T = this->thermo().T();
734  const scalarField& p = this->thermo().p();
735 
736  forAll(rho, celli)
737  {
738  const scalar rhoi = rho[celli];
739  const scalar Ti = T[celli];
740  const scalar pi = p[celli];
741 
742  scalarField c(nSpecie_, 0.0);
743  for (label i=0; i<nSpecie_; i++)
744  {
745  const scalar Yi = Y_[i][celli];
746  c[i] = rhoi*Yi/specieThermo_[i].W();
747  }
748 
749  const scalarField dcdt(omega(c, Ti, pi));
750 
751  for (label i=0; i<nSpecie_; i++)
752  {
753  RR_[i][celli] = dcdt[i]*specieThermo_[i].W();
754  }
755  }
756 }
757 
758 
759 template<class CompType, class ThermoType>
760 template<class DeltaTType>
762 (
763  const DeltaTType& deltaT
764 )
765 {
767 
768  scalar deltaTMin = GREAT;
769 
770  if (!this->chemistry_)
771  {
772  return deltaTMin;
773  }
774 
775  const volScalarField rho
776  (
777  IOobject
778  (
779  "rho",
780  this->time().timeName(),
781  this->mesh(),
782  IOobject::NO_READ,
783  IOobject::NO_WRITE,
784  false
785  ),
786  this->thermo().rho()
787  );
788 
789  const scalarField& T = this->thermo().T();
790  const scalarField& p = this->thermo().p();
791 
792  scalarField c(nSpecie_);
793  scalarField c0(nSpecie_);
794 
795  forAll(rho, celli)
796  {
797  scalar Ti = T[celli];
798 
799  if (Ti > Treact_)
800  {
801  const scalar rhoi = rho[celli];
802  scalar pi = p[celli];
803 
804  for (label i=0; i<nSpecie_; i++)
805  {
806  c[i] = rhoi*Y_[i][celli]/specieThermo_[i].W();
807  c0[i] = c[i];
808  }
809 
810  // Initialise time progress
811  scalar timeLeft = deltaT[celli];
812 
813  // Calculate the chemical source terms
814  while (timeLeft > SMALL)
815  {
816  scalar dt = timeLeft;
817  this->solve(c, Ti, pi, dt, this->deltaTChem_[celli]);
818  timeLeft -= dt;
819  }
820 
821  deltaTMin = min(this->deltaTChem_[celli], deltaTMin);
822 
823  for (label i=0; i<nSpecie_; i++)
824  {
825  RR_[i][celli] =
826  (c[i] - c0[i])*specieThermo_[i].W()/deltaT[celli];
827  }
828  }
829  else
830  {
831  for (label i=0; i<nSpecie_; i++)
832  {
833  RR_[i][celli] = 0;
834  }
835  }
836  }
837 
838  return deltaTMin;
839 }
840 
841 
842 template<class CompType, class ThermoType>
844 (
845  const scalar deltaT
846 )
847 {
848  // Don't allow the time-step to change more than a factor of 2
849  return min
850  (
852  2*deltaT
853  );
854 }
855 
856 
857 template<class CompType, class ThermoType>
859 (
860  const scalarField& deltaT
861 )
862 {
863  return this->solve<scalarField>(deltaT);
864 }
865 
866 
867 template<class CompType, class ThermoType>
869 (
870  scalarField &c,
871  scalar& T,
872  scalar& p,
873  scalar& deltaT,
874  scalar& subDeltaT
875 ) const
876 {
878 }
879 
880 
881 // ************************************************************************* //
scalar delta
const List< specieCoeffs > & lhs() const
Definition: ReactionI.H:51
A class representing the concept of a uniform field which stores only the single value and providing ...
Definition: UniformField.H:47
virtual tmp< scalarField > omega(const scalarField &c, const scalar T, const scalar p) const
dc/dt = omega, rate of change in concentration, for each species
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:428
Foam::reactingMixture.
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
Abstract base class for the systems of ordinary differential equations.
Definition: ODESystem.H:46
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
scalar Sh
Definition: solveChemistry.H:2
basicMultiComponentMixture & composition
virtual tmp< volScalarField > Sh() const
Return source for enthalpy equation [kg/m/s3].
virtual ~chemistryModel()
Destructor.
const dimensionedScalar c2
Second radiation constant: default SI units: [m.K].
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:253
const List< specieCoeffs > & rhs() const
Definition: ReactionI.H:59
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
Definition: Time.C:715
Simple extension of ReactionThermo to handle reaction kinetics in addition to the equilibrium thermod...
Definition: Reaction.H:53
virtual scalar kf(const scalar p, const scalar T, const scalarField &c) const
Forward rate constant.
Definition: Reaction.C:445
psiReactionThermo & thermo
Definition: createFields.H:31
label nSpecie
const dimensionSet dimVolume(pow3(dimLength))
Definition: dimensionSets.H:58
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))
dynamicFvMesh & mesh
dQ
Definition: YEEqn.H:14
dimensionedScalar exp(const dimensionedScalar &ds)
A class for handling words, derived from string.
Definition: word.H:59
virtual tmp< volScalarField > dQ() const
Return the heat release, i.e. enthalpy/sec [kg/m2/s3].
rhoEqn solve()
virtual void derivatives(const scalar t, const scalarField &c, scalarField &dcdt) const
Calculate the derivatives in dydx.
virtual tmp< DimensionedField< scalar, volMesh > > calculateRR(const label reactionI, const label speciei) const
Return reaction rate of the speciei in reactionI.
word timeName
Definition: getTimeIndex.H:3
virtual tmp< volScalarField > tc() const
Return the chemical time scale.
volScalarField scalarField(fieldObject, mesh)
const volScalarField & cp
Info<< "Predicted p max-min : "<< max(p).value()<< " "<< min(p).value()<< endl;rho==max(psi *p+alphal *rhol0+((alphav *psiv+alphal *psil)-psi)*pSat, rhoMin);#1"/home/ubuntu/OpenFOAM-4.1/applications/solvers/multiphase/cavitatingFoam/alphavPsi.H"1{alphav=max(min((rho-rholSat)/(rhovSat-rholSat), scalar(1)), scalar(0));alphal=1.0-alphav;Info<< "max-min alphav: "<< max(alphav).value()<< " "<< min(alphav).value()<< endl;psiModel-> correct()
Definition: pEqn.H:72
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.
Definition: Reaction.C:457
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
const dimensionSet dimEnergy
virtual scalar omegaI(label iReaction, const scalarField &c, const scalar T, const scalar p, scalar &pf, scalar &cf, label &lRef, scalar &pr, scalar &cr, label &rRef) const
Return the reaction rate for iReaction and the reference.
virtual void jacobian(const scalar t, const scalarField &c, scalarField &dcdt, scalarSquareMatrix &dfdc) const
Calculate the Jacobian of the system.
Internal & ref()
Return a reference to the dimensioned internal field.
virtual void calculate()
Calculates the reaction rates.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Extends base chemistry model by adding a thermo package, and ODE functions. Introduces chemistry equa...
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
PtrList< volScalarField > & Y
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
const dimensionedScalar c
Speed of light in a vacuum.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:51
messageStream Info
const scalar RR
Universal gas constant (default in [J/(kmol K)])
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:49
A class for managing temporary objects.
Definition: PtrList.H:54
T & ref() const
Return non-const reference or generate a fatal error.
Definition: tmpI.H:174
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:366
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:91
virtual label nEqns() const
Number of ODE&#39;s to solve.
const Time & time() const
Return the top-level database.
Definition: fvMesh.H:243