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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2017 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
28 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
29 
30 template<class ReactionRate, class ChemicallyActivationFunction>
32 <
33  ReactionRate,
34  ChemicallyActivationFunction
35 >::ChemicallyActivatedReactionRate
36 (
37  const ReactionRate& k0,
38  const ReactionRate& kInf,
39  const ChemicallyActivationFunction& F,
40  const thirdBodyEfficiencies& tbes
41 )
42 :
43  k0_(k0),
44  kInf_(kInf),
45  F_(F),
46  thirdBodyEfficiencies_(tbes)
47 {}
48 
49 
50 template<class ReactionRate, class ChemicallyActivationFunction>
52 <
53  ReactionRate,
54  ChemicallyActivationFunction
56 (
57  const speciesTable& species,
58  const dictionary& dict
59 )
60 :
61  k0_(species, dict),
62  kInf_(species, dict),
63  F_(dict),
64  thirdBodyEfficiencies_(species, dict)
65 {}
66 
67 
68 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
69 
70 template<class ReactionRate, class ChemicallyActivationFunction>
71 inline Foam::scalar Foam::ChemicallyActivatedReactionRate
72 <
73  ReactionRate,
74  ChemicallyActivationFunction
75 >::operator()
76 (
77  const scalar p,
78  const scalar T,
79  const scalarField& c
80 ) const
81 {
82  scalar k0 = k0_(p, T, c);
83  scalar kInf = kInf_(p, T, 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>
93 <
94  ReactionRate,
95  ChemicallyActivationFunction
96 >::write(Ostream& os) const
97 {
98  k0_.write(os);
99  kInf_.write(os);
100  F_.write(os);
101  thirdBodyEfficiencies_.write(os);
102 }
103 
104 
105 template<class ReactionRate, class ChemicallyActivationFunction>
106 inline Foam::Ostream& Foam::operator<<
107 (
108  Ostream& os,
110  <ReactionRate, ChemicallyActivationFunction>& carr
111 )
112 {
113  carr.write(os);
114  return os;
115 }
116 
117 
118 // ************************************************************************* //
p
volScalarField & p
Definition: createFieldRefs.H:8
F
volVectorField F(fluid.F())
Foam::thirdBodyEfficiencies
Third body efficiencies.
Definition: thirdBodyEfficiencies.H:57
Foam::Field< scalar >
Foam::hashedWordList
A wordList with hashed named lookup, which can be faster in some situations than using the normal lis...
Definition: hashedWordList.H:54
Pr
dimensionedScalar Pr("Pr", dimless, laminarTransport)
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
os
OBJstream os(runTime.globalPath()/outputName)
Foam::Ostream::write
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
T
const volScalarField & T
Definition: createFieldRefs.H:2
Foam::vtk::write
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
Definition: foamVtkOutputTemplates.C:36
Foam::ChemicallyActivatedReactionRate
General class for handling chemically-activated bimolecular reactions.
Definition: ChemicallyActivatedReactionRate.H:49
Foam::constant::universal::c
const dimensionedScalar c
Speed of light in a vacuum.
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56