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

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