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

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-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 ChemicallyActivationFunction>
00036 inline
00037 ChemicallyActivatedReactionRate<ReactionRate, ChemicallyActivationFunction>::
00038 ChemicallyActivatedReactionRate
00039 (
00040     const ReactionRate& k0,
00041     const ReactionRate& kInf,
00042     const ChemicallyActivationFunction& 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 ChemicallyActivationFunction>
00055 inline
00056 ChemicallyActivatedReactionRate<ReactionRate, ChemicallyActivationFunction>::
00057 ChemicallyActivatedReactionRate
00058 (
00059     const speciesTable& species,
00060     Istream& is
00061 )
00062 :
00063     k0_(species, is.readBegin("ChemicallyActivatedReactionRate(Istream&)")),
00064     kInf_(species, is),
00065     F_(is),
00066     thirdBodyEfficiencies_(species, is)
00067 {
00068     is.readEnd("ChemicallyActivatedReactionRate(Istream&)");
00069 }
00070 
00071 
00072 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00073 
00074 template<class ReactionRate, class ChemicallyActivationFunction>
00075 inline scalar ChemicallyActivatedReactionRate
00076     <ReactionRate, ChemicallyActivationFunction>::operator()
00077 (
00078     const scalar T,
00079     const scalar p,
00080     const scalarField& c
00081 ) const
00082 {
00083     scalar k0 = k0_(T, p, c);
00084     scalar kInf = kInf_(T, p, c);
00085 
00086     scalar Pr = k0*thirdBodyEfficiencies_.M(c)/kInf;
00087 
00088     return k0*(1/(1 + Pr))*F_(T, Pr);
00089 }
00090 
00091 
00092 template<class ReactionRate, class ChemicallyActivationFunction>
00093 inline Ostream& operator<<
00094 (
00095     Ostream& os,
00096     const ChemicallyActivatedReactionRate
00097         <ReactionRate, ChemicallyActivationFunction>& carr
00098 )
00099 {
00100     os  << token::BEGIN_LIST
00101         << carr.k0_ << token::SPACE << carr.kInf_ << token::SPACE << carr.F_
00102         << token::END_LIST;
00103     return os;
00104 }
00105 
00106 
00107 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00108 
00109 } // End namespace Foam
00110 
00111 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd