OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

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-2009 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 \*---------------------------------------------------------------------------*/
00026 
00027 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00028 
00029 // Construct from components
00030 inline Foam::TroeFallOffFunction::TroeFallOffFunction
00031 (
00032     const scalar alpha,
00033     const scalar Tsss,
00034     const scalar Ts,
00035     const scalar Tss
00036 )
00037 :
00038     alpha_(alpha),
00039     Tsss_(Tsss),
00040     Ts_(Ts),
00041     Tss_(Tss)
00042 {}
00043 
00044 
00045 // Construct from Istream
00046 inline Foam::TroeFallOffFunction::TroeFallOffFunction(Istream& is)
00047 :
00048     alpha_(readScalar(is.readBegin("TroeFallOffFunction(Istream&)"))),
00049     Tsss_(readScalar(is)),
00050     Ts_(readScalar(is)),
00051     Tss_(readScalar(is))
00052 {
00053     is.readEnd("TroeFallOffFunction(Istream&)");
00054 }
00055 
00056 
00057 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00058 
00059 inline Foam::scalar Foam::TroeFallOffFunction::operator()
00060 (
00061     const scalar T,
00062     const scalar Pr
00063 ) const
00064 {
00065     scalar logFcent = log10
00066     (
00067         max
00068         (
00069             (1 - alpha_)*exp(-T/Tsss_) + alpha_*exp(-T/Ts_) + exp(-Tss_/T),
00070             SMALL
00071         )
00072     );
00073 
00074     scalar c = -0.4 - 0.67*logFcent;
00075     static const scalar d = 0.14;
00076     scalar n = 0.75 - 1.27*logFcent;
00077 
00078     scalar logPr = log10(max(Pr, SMALL));
00079     return pow(10.0, logFcent/(1.0 + sqr((logPr + c)/(n - d*(logPr + c)))));
00080 }
00081 
00082 
00083 // * * * * * * * * * * * * * * * Ostream Operator  * * * * * * * * * * * * * //
00084 
00085 inline Foam::Ostream& Foam::operator<<
00086 (
00087     Foam::Ostream& os,
00088     const Foam::TroeFallOffFunction& tfof
00089 )
00090 {
00091     os  << token::BEGIN_LIST
00092         << tfof.alpha_
00093         << token::SPACE << tfof.Tsss_
00094         << token::SPACE << tfof.Ts_
00095         << token::SPACE << tfof.Tss_
00096         << token::END_LIST;
00097 
00098     return os;
00099 }
00100 
00101 
00102 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd