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

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