FreeFOAM The Cross-Platform CFD Toolkit
LandauTellerReactionRateI.H
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) 1991-2010 OpenCFD Ltd.
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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
27 
28 namespace Foam
29 {
30 
31 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32 
33 // Construct from components
35 (
36  const scalar A,
37  const scalar beta,
38  const scalar Ta,
39  const scalar B,
40  const scalar C
41 )
42 :
43  A_(A),
44  beta_(beta),
45  Ta_(Ta),
46  B_(B),
47  C_(C)
48 {}
49 
50 
51 //- Construct from Istream
53 (
54  const speciesTable&,
55  Istream& is
56 )
57 :
58  A_(readScalar(is.readBegin("LandauTellerReactionRate(Istream&)"))),
59  beta_(readScalar(is)),
60  Ta_(readScalar(is)),
61  B_(readScalar(is)),
62  C_(readScalar(is))
63 {
64  is.readEnd("LandauTellerReactionRate(Istream&)");
65 }
66 
67 
68 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
69 
70 inline scalar LandauTellerReactionRate::operator()
71 (
72  const scalar T,
73  const scalar,
74  const scalarField&
75 ) const
76 {
77  scalar lta = A_;
78 
79  if (mag(beta_) > VSMALL)
80  {
81  lta *= pow(T, beta_);
82  }
83 
84  scalar expArg = 0.0;
85 
86  if (mag(Ta_) > VSMALL)
87  {
88  expArg -= Ta_/T;
89  }
90 
91  if (mag(B_) > VSMALL)
92  {
93  expArg += B_/cbrt(T);
94  }
95 
96  if (mag(C_) > VSMALL)
97  {
98  expArg += C_/pow(T, 2.0/3.0);
99  }
100 
101  if (mag(expArg) > VSMALL)
102  {
103  lta *= exp(expArg);
104  }
105 
106  return lta;
107 }
108 
109 
111 {
112  os << token::BEGIN_LIST
113  << arr.A_ << token::SPACE << arr.beta_ << token::SPACE << arr.Ta_
114  << token::SPACE << arr.B_ << token::SPACE << arr.C_
115  << token::END_LIST;
116  return os;
117 }
118 
119 
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121 
122 } // End namespace Foam
123 
124 // ************************ vim: set sw=4 sts=4 et: ************************ //