OpenFOAM logo
Open Source CFD Toolkit

LangmuirHinshelwoodReactionRateI.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 
00032 namespace Foam
00033 {
00034 
00035 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00036 
00037 // Construct from components
00038 inline LangmuirHinshelwoodReactionRate::LangmuirHinshelwoodReactionRate
00039 (
00040     const scalar A[],
00041     const scalar Ta[],
00042     const label co,
00043     const label c3h6,
00044     const label no
00045 )
00046 :
00047     co_(co),
00048     c3h6_(c3h6),
00049     no_(no)
00050 {
00051     for (int i=0; i<n_; i++)
00052     {
00053         A_[i] = A[i];
00054         Ta_[i] = Ta[i];
00055     }
00056 }
00057 
00058 
00059 //- Construct from Istream
00060 inline LangmuirHinshelwoodReactionRate::LangmuirHinshelwoodReactionRate
00061 (
00062     const speciesTable& st,
00063     Istream& is
00064 )
00065 :
00066     co_(st["CO"]),
00067     c3h6_(st["C3H6"]),
00068     no_(st["NO"])
00069 {
00070     is.readBegin("LangmuirHinshelwoodReactionRate(Istream&)");
00071 
00072     for (int i=0; i<n_; i++)
00073     {
00074         is >> A_[i] >> Ta_[i];
00075     }
00076 
00077     is.readEnd("LangmuirHinshelwoodReactionRate(Istream&)");
00078 }
00079 
00080 
00081 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00082 
00083 inline scalar LangmuirHinshelwoodReactionRate::operator()
00084 (
00085     const scalar T,
00086     const scalar,
00087     const scalarField& c
00088 ) const
00089 {
00090     return A_[0]*exp(-Ta_[0]/T)/
00091     (
00092         T
00093        *sqr(1 + A_[1]*exp(-Ta_[1]/T)*c[co_] + A_[2]*exp(-Ta_[2]/T)*c[c3h6_])
00094        *(1 + A_[3]*exp(-Ta_[3]/T)*sqr(c[co_])*sqr(c[c3h6_]))
00095        *(1 + A_[4]*exp(-Ta_[4]/T)*pow(c[no_], 0.7))
00096     );
00097 }
00098 
00099 
00100 inline Ostream& operator<<
00101 (
00102     Ostream& os,
00103     const LangmuirHinshelwoodReactionRate& lhrr
00104 )
00105 {
00106     os  << token::BEGIN_LIST;
00107 
00108     for (int i=0; i<LangmuirHinshelwoodReactionRate::n_; i++)
00109     {
00110         os  << token::SPACE << lhrr.A_[i] << token::SPACE << lhrr.Ta_[i];
00111     }
00112 
00113     os << token::END_LIST;
00114 
00115     return os;
00116 }
00117 
00118 
00119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00120 
00121 } // End namespace Foam
00122 
00123 // ************************************************************************* //
For further information go to www.openfoam.org