OpenFOAM logo
Open Source CFD Toolkit

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