OpenFOAM logo
Open Source CFD Toolkit

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-2005 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 the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     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, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Description
00026 
00027 \*---------------------------------------------------------------------------*/
00028 
00029 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00030 
00031 // Construct from components
00032 inline Foam::TroeFallOffFunction::TroeFallOffFunction
00033 (
00034     const scalar alpha,
00035     const scalar Tsss,
00036     const scalar Ts,
00037     const scalar Tss
00038 )
00039 :
00040     alpha_(alpha),
00041     Tsss_(Tsss),
00042     Ts_(Ts),
00043     Tss_(Tss)
00044 {}
00045 
00046 
00047 // Construct from Istream
00048 inline Foam::TroeFallOffFunction::TroeFallOffFunction(Istream& is)
00049 :
00050     alpha_(readScalar(is.readBegin("TroeFallOffFunction(Istream&)"))),
00051     Tsss_(readScalar(is)),
00052     Ts_(readScalar(is)),
00053     Tss_(readScalar(is))
00054 {
00055     is.readEnd("TroeFallOffFunction(Istream&)");
00056 }
00057 
00058 
00059 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00060 
00061 inline Foam::scalar Foam::TroeFallOffFunction::operator()
00062 (
00063     const scalar T,
00064     const scalar Pr
00065 ) const
00066 {
00067     scalar logFcent = log10
00068     (
00069         max
00070         (
00071             (1 - alpha_)*exp(-T/Tsss_) + alpha_*exp(-T/Ts_) + exp(-Tss_/T),
00072             SMALL
00073         )
00074     );
00075 
00076     scalar c = -0.4 - 0.67*logFcent;
00077     static const scalar d = 0.14;
00078     scalar n = 0.75 - 1.27*logFcent;
00079 
00080     scalar logPr = log10(max(Pr, SMALL));
00081     return pow(10.0, logFcent/(1.0 + sqr((logPr + c)/(n - d*(logPr + c)))));
00082 }
00083 
00084 
00085 // * * * * * * * * * * * * * * * Ostream Operator  * * * * * * * * * * * * * //
00086 
00087 inline Foam::Ostream& Foam::operator<<
00088 (
00089     Foam::Ostream& os,
00090     const Foam::TroeFallOffFunction& tfof
00091 )
00092 {
00093     os  << token::BEGIN_LIST
00094         << tfof.alpha_
00095         << token::SPACE << tfof.Tsss_
00096         << token::SPACE << tfof.Ts_
00097         << token::SPACE << tfof.Tss_
00098         << token::END_LIST;
00099 
00100     return os;
00101 }
00102 
00103 
00104 // ************************************************************************* //
For further information go to www.openfoam.org