OpenFOAM logo
Open Source CFD Toolkit

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