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

FallOffReactionRateI.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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00027 
00028 namespace Foam
00029 {
00030 
00031 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00032 
00033 // Construct from components
00034 template<class ReactionRate, class FallOffFunction>
00035 inline FallOffReactionRate<ReactionRate, FallOffFunction>::FallOffReactionRate
00036 (
00037     const ReactionRate& k0,
00038     const ReactionRate& kInf,
00039     const FallOffFunction& F,
00040     const thirdBodyEfficiencies& tbes
00041 )
00042 :
00043     k0_(k0),
00044     kInf_(kInf),
00045     F_(F),
00046     thirdBodyEfficiencies_(tbes)
00047 {}
00048 
00049 
00050 //- Construct from Istream
00051 template<class ReactionRate, class FallOffFunction>
00052 inline FallOffReactionRate<ReactionRate, FallOffFunction>::FallOffReactionRate
00053 (
00054     const speciesTable& species,
00055     Istream& is
00056 )
00057 :
00058     k0_(species, is.readBegin("FallOffReactionRate(Istream&)")),
00059     kInf_(species, is),
00060     F_(is),
00061     thirdBodyEfficiencies_(species, is)
00062 {
00063     is.readEnd("FallOffReactionRate(Istream&)");
00064 }
00065 
00066 
00067 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00068 
00069 template<class ReactionRate, class FallOffFunction>
00070 inline scalar FallOffReactionRate<ReactionRate, FallOffFunction>::operator()
00071 (
00072     const scalar T,
00073     const scalar p,
00074     const scalarField& c
00075 ) const
00076 {
00077     scalar k0 = k0_(T, p, c);
00078     scalar kInf = kInf_(T, p, c);
00079 
00080     scalar Pr = k0*thirdBodyEfficiencies_.M(c)/kInf;
00081 
00082     return kInf*(Pr/(1 + Pr))*F_(T, Pr);
00083 }
00084 
00085 
00086 template<class ReactionRate, class FallOffFunction>
00087 inline Ostream& operator<<
00088 (
00089     Ostream& os,
00090     const FallOffReactionRate<ReactionRate, FallOffFunction>& forr
00091 )
00092 {
00093     os  << token::BEGIN_LIST
00094         << forr.k0_ << token::SPACE
00095         << forr.kInf_ << token::SPACE
00096         << forr.F_ << token::SPACE
00097         << forr.thirdBodyEfficiencies_
00098         << token::END_LIST;
00099     return os;
00100 }
00101 
00102 
00103 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00104 
00105 } // End namespace Foam
00106 
00107 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines