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

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