Merge branch 'upstream/OpenFOAM' into master
[freefoam.git] / src / thermophysicalModels / specie / reaction / reactionRate / ChemicallyActivatedReactionRate / ChemicallyActivatedReactionRateI.H
blob26a4d41446c04bb59560417dfca21bf7ce57c0f4
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     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
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
27 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
29 namespace Foam
32 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
34 // Construct from components
35 template<class ReactionRate, class ChemicallyActivationFunction>
36 inline
37 ChemicallyActivatedReactionRate<ReactionRate, ChemicallyActivationFunction>::
38 ChemicallyActivatedReactionRate
40     const ReactionRate& k0,
41     const ReactionRate& kInf,
42     const ChemicallyActivationFunction& F,
43     const thirdBodyEfficiencies& tbes
46     k0_(k0),
47     kInf_(kInf),
48     F_(F),
49     thirdBodyEfficiencies_(tbes)
53 //- Construct from Istream
54 template<class ReactionRate, class ChemicallyActivationFunction>
55 inline
56 ChemicallyActivatedReactionRate<ReactionRate, ChemicallyActivationFunction>::
57 ChemicallyActivatedReactionRate
59     const speciesTable& species,
60     Istream& is
63     k0_(species, is.readBegin("ChemicallyActivatedReactionRate(Istream&)")),
64     kInf_(species, is),
65     F_(is),
66     thirdBodyEfficiencies_(species, is)
68     is.readEnd("ChemicallyActivatedReactionRate(Istream&)");
72 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
74 template<class ReactionRate, class ChemicallyActivationFunction>
75 inline scalar ChemicallyActivatedReactionRate
76     <ReactionRate, ChemicallyActivationFunction>::operator()
78     const scalar T,
79     const scalar p,
80     const scalarField& c
81 ) const
83     scalar k0 = k0_(T, p, c);
84     scalar kInf = kInf_(T, p, c);
86     scalar Pr = k0*thirdBodyEfficiencies_.M(c)/kInf;
88     return k0*(1/(1 + Pr))*F_(T, Pr);
92 template<class ReactionRate, class ChemicallyActivationFunction>
93 inline Ostream& operator<<
95     Ostream& os,
96     const ChemicallyActivatedReactionRate
97         <ReactionRate, ChemicallyActivationFunction>& carr
100     os  << token::BEGIN_LIST
101         << carr.k0_ << token::SPACE << carr.kInf_ << token::SPACE << carr.F_
102         << token::END_LIST;
103     return os;
107 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
109 } // End namespace Foam
111 // ************************ vim: set sw=4 sts=4 et: ************************ //