FreeFOAM The Cross-Platform CFD Toolkit
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) 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
34 template<class ReactionRate, class ChemicallyActivationFunction>
35 inline
38 (
39  const ReactionRate& k0,
40  const ReactionRate& kInf,
41  const ChemicallyActivationFunction& F,
42  const thirdBodyEfficiencies& tbes
43 )
44 :
45  k0_(k0),
46  kInf_(kInf),
47  F_(F),
48  thirdBodyEfficiencies_(tbes)
49 {}
50 
51 
52 //- Construct from Istream
53 template<class ReactionRate, class ChemicallyActivationFunction>
54 inline
57 (
58  const speciesTable& species,
59  Istream& is
60 )
61 :
62  k0_(species, is.readBegin("ChemicallyActivatedReactionRate(Istream&)")),
63  kInf_(species, is),
64  F_(is),
65  thirdBodyEfficiencies_(species, is)
66 {
67  is.readEnd("ChemicallyActivatedReactionRate(Istream&)");
68 }
69 
70 
71 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
72 
73 template<class ReactionRate, class ChemicallyActivationFunction>
75  <ReactionRate, ChemicallyActivationFunction>::operator()
76 (
77  const scalar T,
78  const scalar p,
79  const scalarField& c
80 ) const
81 {
82  scalar k0 = k0_(T, p, c);
83  scalar kInf = kInf_(T, p, c);
84 
85  scalar Pr = k0*thirdBodyEfficiencies_.M(c)/kInf;
86 
87  return k0*(1/(1 + Pr))*F_(T, Pr);
88 }
89 
90 
91 template<class ReactionRate, class ChemicallyActivationFunction>
92 inline Ostream& operator<<
93 (
94  Ostream& os,
96  <ReactionRate, ChemicallyActivationFunction>& carr
97 )
98 {
99  os << token::BEGIN_LIST
100  << carr.k0_ << token::SPACE << carr.kInf_ << token::SPACE << carr.F_
101  << token::END_LIST;
102  return os;
103 }
104 
105 
106 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
107 
108 } // End namespace Foam
109 
110 // ************************ vim: set sw=4 sts=4 et: ************************ //