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-------------------------------------------------------------------------------
10License
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
30template<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
50template<class ReactionRate, class ChemicallyActivationFunction>
52<
53 ReactionRate,
54 ChemicallyActivationFunction
55>::ChemicallyActivatedReactionRate
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
70template<class ReactionRate, class ChemicallyActivationFunction>
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
91template<class ReactionRate, class ChemicallyActivationFunction>
93<
94 ReactionRate,
95 ChemicallyActivationFunction
97{
98 k0_.write(os);
99 kInf_.write(os);
100 F_.write(os);
101 thirdBodyEfficiencies_.write(os);
102}
103
104
105template<class ReactionRate, class ChemicallyActivationFunction>
106inline 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// ************************************************************************* //
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:62
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A wordList with hashed named lookup, which can be faster in some situations than using the normal lis...
Third body efficiencies.
volScalarField & p
const volScalarField & T
OBJstream os(runTime.globalPath()/outputName)
volVectorField F(fluid.F())
runTime write()
dictionary dict
dimensionedScalar Pr("Pr", dimless, laminarTransport)