initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / thermophysicalModels / specie / reaction / reactionRate / fallOffFunctions / SRIFallOffFunction / SRIFallOffFunctionI.H
blob120a102182806f58f283f79a422478f18f8a0912
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 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
29 // Construct from components
30 inline Foam::SRIFallOffFunction::SRIFallOffFunction
32     const scalar a,
33     const scalar b,
34     const scalar c,
35     const scalar d,
36     const scalar e
39     a_(a),
40     b_(b),
41     c_(c),
42     d_(d),
43     e_(e)
47 // Construct from Istream
48 inline Foam::SRIFallOffFunction::SRIFallOffFunction(Istream& is)
50     a_(readScalar(is.readBegin("SRIFallOffFunction(Istream&)"))),
51     b_(readScalar(is)),
52     c_(readScalar(is)),
53     d_(readScalar(is)),
54     e_(readScalar(is))
56     is.readEnd("SRIFallOffFunction(Istream&)");
60 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
62 inline Foam::scalar Foam::SRIFallOffFunction::operator()
64     const scalar T,
65     const scalar Pr
66 ) const
68     scalar X = 1.0/(1.0 + sqr(log10(max(Pr, SMALL))));
69     return d_*pow(a_*exp(-b_/T) + exp(-T/c_), X)*pow(T, e_);
73 // * * * * * * * * * * * * * * * Ostream Operator  * * * * * * * * * * * * * //
75 inline Foam::Ostream& Foam::operator<<
77     Foam::Ostream& os,
78     const Foam::SRIFallOffFunction& srifof
81     os  << token::BEGIN_LIST
82         << srifof.a_
83         << token::SPACE << srifof.b_
84         << token::SPACE << srifof.c_
85         << token::SPACE << srifof.d_
86         << token::SPACE << srifof.e_
87         << token::END_LIST;
89     return os;
93 // ************************************************************************* //