thirdBodyArrheniusReactionRateI.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  const thirdBodyEfficiencies& tbes
34 )
35 :
36  ArrheniusReactionRate(A, beta, Ta),
37  thirdBodyEfficiencies_(tbes)
38 {
39  forAll(tbes, i)
40  {
41  beta_.append(Tuple2<label, scalar>(i, tbes[i]));
42  }
43 }
44 
45 
47 (
48  const speciesTable& species,
49  const dictionary& dict
50 )
51 :
53  (
54  species,
55  dict
56  ),
57  thirdBodyEfficiencies_(species, dict)
58 {
59  forAll(thirdBodyEfficiencies_, i)
60  {
61  beta_.append
62  (
64  (
65  i,
66  thirdBodyEfficiencies_[i]
67  )
68  );
69  }
70 }
71 
72 
73 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
74 
76 {
78 }
79 
80 
82 {
84 }
85 
86 
87 inline Foam::scalar Foam::thirdBodyArrheniusReactionRate::operator()
88 (
89  const scalar p,
90  const scalar T,
91  const scalarField& c,
92  const label li
93 ) const
94 {
95  return
96  thirdBodyEfficiencies_.M(c)
98 }
99 
100 
102 (
103  const scalar p,
104  const scalar T,
105  const scalarField& c,
106  const label li
107 ) const
108 {
109  return
110  thirdBodyEfficiencies_.M(c)
111  *ArrheniusReactionRate::ddT(p, T, c, li);
112 }
113 
114 
116 (
117  const scalar p,
118  const scalar T,
119  const scalarField& c,
120  const label li,
121  scalarField& dcidc
122 ) const
123 {
124  scalar M = thirdBodyEfficiencies_.M(c);
125  forAll(beta_, i)
126  {
127  dcidc[i] = beta_[i].second()/max(M, small);
128  }
129 }
130 
131 
133 (
134  const scalar p,
135  const scalar T,
136  const scalarField& c,
137  const label li
138 ) const
139 {
140  return -1.0/T;
141 }
142 
143 
145 {
147  thirdBodyEfficiencies_.write(os);
148 }
149 
150 
151 inline Foam::Ostream& Foam::operator<<
152 (
153  Ostream& os,
155 )
156 {
157  arr.write(os);
158  return os;
159 }
160 
161 
162 // ************************************************************************* //
void postEvaluate() const
Post-evaluation hook.
dictionary dict
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:434
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
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
scalar ddT(const scalar p, const scalar T, const scalarField &c, const label li) const
A 2-tuple for storing two objects of different types.
Definition: HashTable.H:65
void preEvaluate() const
Pre-evaluation hook.
void preEvaluate() const
Pre-evaluation hook.
const dimensionedScalar c
Speed of light in a vacuum.
void postEvaluate() const
Post-evaluation hook.
scalar M(const scalarList &c) const
Calculate and return M, the concentration of the third-bodies.
void write(Ostream &os) const
Write to stream.
scalar dcidT(const scalar p, const scalar T, const scalarField &c, const label li) const
Temperature derivative of the pressure dependent term.
scalar operator()(const scalar p, const scalar T, const scalarField &c, const label li) const
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 dcidc(const scalar p, const scalar T, const scalarField &c, const label li, scalarField &dcidc) const
Species concentration derivative of the pressure dependent term.
Arrhenius reaction rate enhanced by third-body interaction.
A wordList with hashed indices for faster lookup by name.
Arrhenius reaction rate given by:
thirdBodyArrheniusReactionRate(const scalar A, const scalar beta, const scalar Ta, const thirdBodyEfficiencies &tbes)
Construct from components.
void write(Ostream &os) const
Write to stream.
scalar ddT(const scalar p, const scalar T, const scalarField &c, const label li) const
volScalarField & p
void write(Ostream &os) const
Write to stream.
Third body efficiencies.
#define M(I)