OpenFOAM logo
Open Source CFD Toolkit

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