FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

TroeFallOffFunctionI.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software: you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
00023 
00024 \*---------------------------------------------------------------------------*/
00025 
00026 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00027 
00028 // Construct from components
00029 inline Foam::TroeFallOffFunction::TroeFallOffFunction
00030 (
00031     const scalar alpha,
00032     const scalar Tsss,
00033     const scalar Ts,
00034     const scalar Tss
00035 )
00036 :
00037     alpha_(alpha),
00038     Tsss_(Tsss),
00039     Ts_(Ts),
00040     Tss_(Tss)
00041 {}
00042 
00043 
00044 // Construct from Istream
00045 inline Foam::TroeFallOffFunction::TroeFallOffFunction(Istream& is)
00046 :
00047     alpha_(readScalar(is.readBegin("TroeFallOffFunction(Istream&)"))),
00048     Tsss_(readScalar(is)),
00049     Ts_(readScalar(is)),
00050     Tss_(readScalar(is))
00051 {
00052     is.readEnd("TroeFallOffFunction(Istream&)");
00053 }
00054 
00055 
00056 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00057 
00058 inline Foam::scalar Foam::TroeFallOffFunction::operator()
00059 (
00060     const scalar T,
00061     const scalar Pr
00062 ) const
00063 {
00064     scalar logFcent = log10
00065     (
00066         max
00067         (
00068             (1 - alpha_)*exp(-T/Tsss_) + alpha_*exp(-T/Ts_) + exp(-Tss_/T),
00069             SMALL
00070         )
00071     );
00072 
00073     scalar c = -0.4 - 0.67*logFcent;
00074     static const scalar d = 0.14;
00075     scalar n = 0.75 - 1.27*logFcent;
00076 
00077     scalar logPr = log10(max(Pr, SMALL));
00078     return pow(10.0, logFcent/(1.0 + sqr((logPr + c)/(n - d*(logPr + c)))));
00079 }
00080 
00081 
00082 // * * * * * * * * * * * * * * * Ostream Operator  * * * * * * * * * * * * * //
00083 
00084 inline Foam::Ostream& Foam::operator<<
00085 (
00086     Foam::Ostream& os,
00087     const Foam::TroeFallOffFunction& tfof
00088 )
00089 {
00090     os  << token::BEGIN_LIST
00091         << tfof.alpha_
00092         << token::SPACE << tfof.Tsss_
00093         << token::SPACE << tfof.Ts_
00094         << token::SPACE << tfof.Tss_
00095         << token::END_LIST;
00096 
00097     return os;
00098 }
00099 
00100 
00101 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines