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-2018 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 
75 inline Foam::scalar Foam::thirdBodyArrheniusReactionRate::operator()
76 (
77  const scalar p,
78  const scalar T,
79  const scalarField& c
80 ) const
81 {
82  return
83  thirdBodyEfficiencies_.M(c)
84  *ArrheniusReactionRate::operator()(p, T, c);
85 }
86 
87 
89 (
90  const scalar p,
91  const scalar T,
92  const scalarField& c
93 ) const
94 {
95  return
96  thirdBodyEfficiencies_.M(c)
97  *ArrheniusReactionRate::ddT(p, T, c);
98 }
99 
100 
102 (
103  const scalar p,
104  const scalar T,
105  const scalarField& c,
106  scalarField& dcidc
107 ) const
108 {
109  scalar M = thirdBodyEfficiencies_.M(c);
110  forAll(beta_, i)
111  {
112  dcidc[i] = beta_[i].second()/max(M, small);
113  }
114 }
115 
116 
118 (
119  const scalar p,
120  const scalar T,
121  const scalarField& c
122 ) const
123 {
124  return -1.0/T;
125 }
126 
127 
129 {
131  thirdBodyEfficiencies_.write(os);
132 }
133 
134 
135 inline Foam::Ostream& Foam::operator<<
136 (
137  Ostream& os,
139 )
140 {
141  arr.write(os);
142  return os;
143 }
144 
145 
146 // ************************************************************************* //
dictionary dict
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:434
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
A 2-tuple for storing two objects of different types.
Definition: HashTable.H:65
void dcidc(const scalar p, const scalar T, const scalarField &c, scalarField &dcidc) const
Species concentration derivative of the pressure dependent term.
void write(Ostream &os) const
Write to stream.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
const volScalarField & T
scalar ddT(const scalar p, const scalar T, const scalarField &c) const
Arrhenius reaction rate enhanced by third-body interaction.
A wordList with hashed indices for faster lookup by name.
const dimensionedScalar c
Speed of light in a vacuum.
scalar dcidT(const scalar p, const scalar T, const scalarField &c) const
Temperature derivative of the pressure dependent term.
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.
virtual Ostream & write(const token &)=0
Write next token to stream.
volScalarField & p
void write(Ostream &os) const
Write to stream.
Third body efficiencies.
#define M(I)