ChemicallyActivatedReactionRateI.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) 2011-2017 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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
27 
28 template<class ReactionRate, class ChemicallyActivationFunction>
30 <
31  ReactionRate,
32  ChemicallyActivationFunction
33 >::ChemicallyActivatedReactionRate
34 (
35  const ReactionRate& k0,
36  const ReactionRate& kInf,
37  const ChemicallyActivationFunction& F,
38  const thirdBodyEfficiencies& tbes
39 )
40 :
41  k0_(k0),
42  kInf_(kInf),
43  F_(F),
44  thirdBodyEfficiencies_(tbes)
45 {}
46 
47 
48 template<class ReactionRate, class ChemicallyActivationFunction>
50 <
51  ReactionRate,
52  ChemicallyActivationFunction
54 (
55  const speciesTable& species,
56  const dictionary& dict
57 )
58 :
59  k0_(species, dict),
60  kInf_(species, dict),
61  F_(dict),
62  thirdBodyEfficiencies_(species, dict)
63 {}
64 
65 
66 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
67 
68 template<class ReactionRate, class ChemicallyActivationFunction>
69 inline Foam::scalar Foam::ChemicallyActivatedReactionRate
70 <
71  ReactionRate,
72  ChemicallyActivationFunction
73 >::operator()
74 (
75  const scalar p,
76  const scalar T,
77  const scalarField& c
78 ) const
79 {
80  scalar k0 = k0_(p, T, c);
81  scalar kInf = kInf_(p, T, c);
82 
83  scalar Pr = k0*thirdBodyEfficiencies_.M(c)/kInf;
84 
85  return k0*(1/(1 + Pr))*F_(T, Pr);
86 }
87 
88 
89 template<class ReactionRate, class ChemicallyActivationFunction>
91 <
92  ReactionRate,
93  ChemicallyActivationFunction
94 >::write(Ostream& os) const
95 {
96  k0_.write(os);
97  kInf_.write(os);
98  F_.write(os);
99  thirdBodyEfficiencies_.write(os);
100 }
101 
102 
103 template<class ReactionRate, class ChemicallyActivationFunction>
104 inline Foam::Ostream& Foam::operator<<
105 (
106  Ostream& os,
108  <ReactionRate, ChemicallyActivationFunction>& carr
109 )
110 {
111  carr.write(os);
112  return os;
113 }
114 
115 
116 // ************************************************************************* //
dimensionedScalar Pr("Pr", dimless, laminarTransport)
dictionary dict
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
void write(Ostream &, const label, const dictionary &)
Write with dictionary lookup.
General class for handling chemically-activated bimolecular reactions.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
const volScalarField & T
A wordList with hashed indices for faster lookup by name.
const dimensionedScalar c
Speed of light in a vacuum.
virtual Ostream & write(const token &)=0
Write next token to stream.
volScalarField & p
Third body efficiencies.