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

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