ArrheniusReactionRateI.H
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-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 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
27 
29 (
30  const scalar A,
31  const scalar beta,
32  const scalar Ta
33 )
34 :
35  A_(A),
36  beta_(beta),
37  Ta_(Ta)
38 {}
39 
40 
42 (
43  const speciesTable&,
44  const dictionary& dict
45 )
46 :
47  A_(dict.lookup<scalar>("A")),
48  beta_(dict.lookup<scalar>("beta")),
49  Ta_(dict.lookup<scalar>("Ta"))
50 {}
51 
52 
53 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
54 
56 {}
57 
58 
60 {}
61 
62 
63 inline Foam::scalar Foam::ArrheniusReactionRate::operator()
64 (
65  const scalar p,
66  const scalar T,
67  const scalarField&,
68  const label
69 ) const
70 {
71  scalar ak = A_;
72 
73  if (mag(beta_) > vSmall)
74  {
75  ak *= pow(T, beta_);
76  }
77 
78  if (mag(Ta_) > vSmall)
79  {
80  ak *= exp(-Ta_/T);
81  }
82 
83  return ak;
84 }
85 
86 
87 inline Foam::scalar Foam::ArrheniusReactionRate::ddT
88 (
89  const scalar p,
90  const scalar T,
91  const scalarField&,
92  const label
93 ) const
94 {
95  scalar ak = A_;
96 
97  if (mag(beta_) > vSmall)
98  {
99  ak *= pow(T, beta_);
100  }
101 
102  if (mag(Ta_) > vSmall)
103  {
104  ak *= exp(-Ta_/T);
105  }
106 
107  return ak*(beta_+Ta_/T)/T;
108 }
109 
110 
113 {
114  return NullObjectRef<List<Tuple2<label, scalar>>>();
115 }
116 
117 
119 (
120  const scalar p,
121  const scalar T,
122  const scalarField& c,
123  const label li,
124  scalarField& dcidc
125 ) const
126 {}
127 
128 
129 inline Foam::scalar Foam::ArrheniusReactionRate::dcidT
130 (
131  const scalar p,
132  const scalar T,
133  const scalarField& c,
134  const label li
135 ) const
136 {
137  return 0;
138 }
139 
140 
142 {
143  writeEntry(os, "A", A_);
144  writeEntry(os, "beta", beta_);
145  writeEntry(os, "Ta", Ta_);
146 }
147 
148 
149 inline Foam::Ostream& Foam::operator<<
150 (
151  Ostream& os,
152  const ArrheniusReactionRate& arr
153 )
154 {
155  arr.write(os);
156  return os;
157 }
158 
159 
160 // ************************************************************************* //
void postEvaluate() const
Post-evaluation hook.
dictionary dict
virtual Ostream & write(const char)=0
Write character.
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
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
scalar ddT(const scalar p, const scalar T, const scalarField &c, const label li) const
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 preEvaluate() const
Pre-evaluation hook.
ArrheniusReactionRate(const scalar A, const scalar beta, const scalar Ta)
Construct from components.
dimensionedScalar exp(const dimensionedScalar &ds)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
Definition: HashTableIO.C:96
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
A wordList with hashed indices for faster lookup by name.
Arrhenius reaction rate given by:
void dcidc(const scalar p, const scalar T, const scalarField &c, const label li, scalarField &dcidc) const
Species concentration derivative of the pressure dependent term.
dimensioned< scalar > mag(const dimensioned< Type > &)
scalar dcidT(const scalar p, const scalar T, const scalarField &c, const label li) const
Temperature derivative of the pressure dependent term.
volScalarField & p
void write(Ostream &os) const
Write to stream.
const List< Tuple2< label, scalar > > & beta() const
Third-body efficiencies (beta = 1-alpha)
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Definition: dictionary.C:844