1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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.
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
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/>.
24 \*---------------------------------------------------------------------------*/
26 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
28 template<class ReactionRate, class FallOffFunction>
29 inline Foam::FallOffReactionRate<ReactionRate, FallOffFunction>::
32 const ReactionRate& k0,
33 const ReactionRate& kInf,
34 const FallOffFunction& F,
35 const thirdBodyEfficiencies& tbes
41 thirdBodyEfficiencies_(tbes)
45 template<class ReactionRate, class FallOffFunction>
46 inline Foam::FallOffReactionRate<ReactionRate, FallOffFunction>::
49 const speciesTable& species,
53 k0_(species, is.readBegin("FallOffReactionRate(Istream&)")),
56 thirdBodyEfficiencies_(species, is)
58 is.readEnd("FallOffReactionRate(Istream&)");
62 template<class ReactionRate, class FallOffFunction>
63 inline Foam::FallOffReactionRate<ReactionRate, FallOffFunction>::
66 const speciesTable& species,
67 const dictionary& dict
73 thirdBodyEfficiencies_(species, dict)
77 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
79 template<class ReactionRate, class FallOffFunction>
81 Foam::FallOffReactionRate<ReactionRate, FallOffFunction>::operator()
88 scalar k0 = k0_(T, p, c);
89 scalar kInf = kInf_(T, p, c);
91 scalar Pr = k0*thirdBodyEfficiencies_.M(c)/kInf;
93 return kInf*(Pr/(1 + Pr))*F_(T, Pr);
97 template<class ReactionRate, class FallOffFunction>
98 inline void Foam::FallOffReactionRate<ReactionRate, FallOffFunction>::write
106 thirdBodyEfficiencies_.write(os);
110 template<class ReactionRate, class FallOffFunction>
111 inline Foam::Ostream& Foam::operator<<
114 const FallOffReactionRate<ReactionRate, FallOffFunction>& forr
117 os << token::BEGIN_LIST
118 << forr.k0_ << token::SPACE
119 << forr.kInf_ << token::SPACE
120 << forr.F_ << token::SPACE
121 << forr.thirdBodyEfficiencies_
127 // ************************************************************************* //