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

LandauTellerReactionRateI.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 LandauTellerReactionRate::LandauTellerReactionRate
00036 (
00037     const scalar A,
00038     const scalar beta,
00039     const scalar Ta,
00040     const scalar B,
00041     const scalar C
00042 )
00043 :
00044     A_(A),
00045     beta_(beta),
00046     Ta_(Ta),
00047     B_(B),
00048     C_(C)
00049 {}
00050 
00051 
00052 //- Construct from Istream
00053 inline LandauTellerReactionRate::LandauTellerReactionRate
00054 (
00055     const speciesTable&,
00056     Istream& is
00057 )
00058 :
00059     A_(readScalar(is.readBegin("LandauTellerReactionRate(Istream&)"))),
00060     beta_(readScalar(is)),
00061     Ta_(readScalar(is)),
00062     B_(readScalar(is)),
00063     C_(readScalar(is))
00064 {
00065     is.readEnd("LandauTellerReactionRate(Istream&)");
00066 }
00067 
00068 
00069 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00070 
00071 inline scalar LandauTellerReactionRate::operator()
00072 (
00073     const scalar T,
00074     const scalar,
00075     const scalarField&
00076 ) const
00077 {
00078     scalar lta = A_;
00079 
00080     if (mag(beta_) > VSMALL)
00081     {
00082         lta *= pow(T, beta_);
00083     }
00084 
00085     scalar expArg = 0.0;
00086 
00087     if (mag(Ta_) > VSMALL)
00088     {
00089         expArg -= Ta_/T;
00090     }
00091 
00092     if (mag(B_) > VSMALL)
00093     {
00094         expArg += B_/cbrt(T);
00095     }
00096 
00097     if (mag(C_) > VSMALL)
00098     {
00099         expArg += C_/pow(T, 2.0/3.0);
00100     }
00101 
00102     if (mag(expArg) > VSMALL)
00103     {
00104         lta *= exp(expArg);
00105     }
00106 
00107     return lta;
00108 }
00109 
00110 
00111 inline Ostream& operator<<(Ostream& os, const LandauTellerReactionRate& arr)
00112 {
00113     os  << token::BEGIN_LIST
00114         << arr.A_ << token::SPACE << arr.beta_ << token::SPACE << arr.Ta_
00115         << token::SPACE << arr.B_ << token::SPACE << arr.C_
00116         << token::END_LIST;
00117     return os;
00118 }
00119 
00120 
00121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00122 
00123 } // End namespace Foam
00124 
00125 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd