00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 namespace Foam
00033 {
00034
00035
00036
00037
00038 inline powerSeriesReactionRate::powerSeriesReactionRate
00039 (
00040 const scalar A,
00041 const scalar beta,
00042 const scalar Ta,
00043 const scalar b[]
00044 )
00045 :
00046 A_(A),
00047 beta_(beta),
00048 Ta_(Ta)
00049 {
00050 for (int n=0; n<nb_; n++)
00051 {
00052 b_[n] = b[n];
00053 }
00054 }
00055
00056
00057
00058 inline powerSeriesReactionRate::powerSeriesReactionRate
00059 (
00060 const speciesTable&,
00061 Istream& is
00062 )
00063 :
00064 A_(readScalar(is.readBegin("powerSeriesReactionRate(Istream&)"))),
00065 beta_(readScalar(is)),
00066 Ta_(readScalar(is))
00067 {
00068 for (int n=0; n<nb_; n++)
00069 {
00070 is >> b_[n];
00071 }
00072
00073 is.readEnd("powerSeriesReactionRate(Istream&)");
00074 }
00075
00076
00077
00078
00079 inline scalar powerSeriesReactionRate::operator()
00080 (
00081 const scalar T,
00082 const scalar,
00083 const scalarField&
00084 ) const
00085 {
00086 scalar lta = A_;
00087
00088 if (mag(beta_) > VSMALL)
00089 {
00090 lta *= pow(T, beta_);
00091 }
00092
00093 scalar expArg = 0.0;
00094
00095 for (int n=0; n<nb_; n++)
00096 {
00097 expArg += b_[n]/pow(T, n);
00098 }
00099
00100 lta *= exp(expArg);
00101
00102 return lta;
00103 }
00104
00105
00106 inline Ostream& operator<<(Ostream& os, const powerSeriesReactionRate& psrr)
00107 {
00108 os << token::BEGIN_LIST
00109 << psrr.A_ << token::SPACE << psrr.beta_ << token::SPACE << psrr.Ta_;
00110
00111 for (int n=0; n<powerSeriesReactionRate::nb_; n++)
00112 {
00113 os << token::SPACE << psrr.b_[n];
00114 }
00115
00116 os << token::END_LIST;
00117
00118 return os;
00119 }
00120
00121
00122
00123
00124 }
00125
00126