1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
28 inline Foam::powerSeriesReactionRate::powerSeriesReactionRate
33 const FixedList<scalar, nCoeff_> coeffs
43 inline Foam::powerSeriesReactionRate::powerSeriesReactionRate
49 A_(readScalar(is.readBegin("powerSeriesReactionRate(Istream&)"))),
50 beta_(readScalar(is)),
54 is.readEnd("powerSeriesReactionRate(Istream&)");
58 inline Foam::powerSeriesReactionRate::powerSeriesReactionRate
61 const dictionary& dict
64 A_(readScalar(dict.lookup("A"))),
65 beta_(readScalar(dict.lookup("beta"))),
66 Ta_(readScalar(dict.lookup("Ta"))),
67 coeffs_(dict.lookup("coeffs"))
71 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
73 inline Foam::scalar Foam::powerSeriesReactionRate::operator()
82 if (mag(beta_) > VSMALL)
91 expArg += coeffs_[n]/pow(T, n);
100 inline void Foam::powerSeriesReactionRate::write(Ostream& os) const
102 os.writeKeyword("A") << A_ << token::END_STATEMENT << nl;
103 os.writeKeyword("beta") << beta_ << token::END_STATEMENT << nl;
104 os.writeKeyword("Ta") << Ta_ << token::END_STATEMENT << nl;
105 os.writeKeyword("coeffs") << coeffs_ << token::END_STATEMENT << nl;
109 inline Foam::Ostream& Foam::operator<<
112 const powerSeriesReactionRate& psrr
115 os << token::BEGIN_LIST
116 << psrr.A_ << token::SPACE << psrr.beta_ << token::SPACE << psrr.Ta_;
118 for (int n=0; n<powerSeriesReactionRate::nCoeff_; n++)
120 os << token::SPACE << psrr.coeffs_[n];
123 os << token::END_LIST;
129 // ************************************************************************* //