26 #define FALL_OFF_FUNCTION_JACOBIAN false 30 template<
class ReactionRate,
class FallOffFunction>
34 const ReactionRate& k0,
35 const ReactionRate& kInf,
36 const FallOffFunction& F,
43 thirdBodyEfficiencies_(tbes)
47 template<
class ReactionRate,
class FallOffFunction>
55 k0_(species, dict.
subDict(
"k0")),
56 kInf_(species, dict.
subDict(
"kInf")),
58 thirdBodyEfficiencies_(species, dict.
subDict(
"thirdBodyEfficiencies"))
64 template<
class ReactionRate,
class FallOffFunction>
73 template<
class ReactionRate,
class FallOffFunction>
82 template<
class ReactionRate,
class FallOffFunction>
92 const scalar k0 = k0_(p, T, c, li);
93 const scalar kInf = kInf_(p, T, c, li);
94 const scalar
M = thirdBodyEfficiencies_.M(c);
95 const scalar Pr = k0/kInf*
M;
96 const scalar F = F_(T, Pr);
98 return kInf*(Pr/(1 + Pr))*
F;
102 template<
class ReactionRate,
class FallOffFunction>
112 const scalar k0 = k0_(p, T, c, li);
113 const scalar kInf = kInf_(p, T, c, li);
114 const scalar
M = thirdBodyEfficiencies_.M(c);
115 const scalar Pr = k0/kInf*
M;
116 const scalar F = F_(T, Pr);
118 const scalar dkInfdT = kInf_.ddT(p, T, c, li);
120 #if FALL_OFF_FUNCTION_JACOBIAN 122 const scalar dk0dT = k0_.ddT(p, T, c, li);
123 const scalar dPrdT = (M*dk0dT - Pr*dkInfdT)/kInf;
124 const scalar dFdT = F_.ddT(T, Pr, F) + F_.ddPr(T, Pr, F)*dPrdT;
127 dkInfdT*(Pr/(1 + Pr))*F
128 + kInf*dPrdT/
sqr(1 + Pr)*F
129 + kInf*(Pr/(1 + Pr))*dFdT;
133 return dkInfdT*(Pr/(1 + Pr))*
F;
139 template<
class ReactionRate,
class FallOffFunction>
147 template<
class ReactionRate,
class FallOffFunction>
157 const scalar k0 = k0_(p, T, c, li);
158 const scalar kInf = kInf_(p, T, c, li);
159 const scalar
M = thirdBodyEfficiencies_.M(c);
160 const scalar Pr = k0/kInf*
M;
161 const scalar F = F_(T, Pr);
163 #if FALL_OFF_FUNCTION_JACOBIAN 166 k0_.ddc(p, T, c, li, dk0dc);
168 kInf_.ddc(p, T, c, li, dkInfdc);
171 scalarField dPrdc((M*dk0dc - Pr*dkInfdc + k0*dMdc)/kInf);
172 const scalar dFdPr = F_.ddPr(T, Pr, F);
175 dkInfdc*(Pr/(1 + Pr))*F
176 + kInf*dPrdc/
sqr(1 + Pr)*F
177 + kInf*(Pr/(1 + Pr))*dFdPr*dPrdc;
181 kInf_.ddc(p, T, c, li, ddc);
183 ddc *= (Pr/(1 + Pr))*
F;
189 template<
class ReactionRate,
class FallOffFunction>
196 os <<
indent << token::BEGIN_BLOCK <<
nl;
200 os <<
indent << token::END_BLOCK <<
nl;
203 os <<
indent << token::BEGIN_BLOCK <<
nl;
207 os <<
indent << token::END_BLOCK <<
nl;
210 os <<
indent << token::BEGIN_BLOCK <<
nl;
214 os <<
indent << token::END_BLOCK <<
nl;
216 os <<
indent <<
"thirdBodyEfficiencies" <<
nl;
217 os <<
indent << token::BEGIN_BLOCK <<
nl;
219 thirdBodyEfficiencies_.
write(os);
221 os <<
indent << token::END_BLOCK <<
nl;
225 template<
class ReactionRate,
class FallOffFunction>
virtual Ostream & write(const char)=0
Write character.
Ostream & indent(Ostream &os)
Indent stream.
const dimensionedScalar F
Faraday constant: default SI units: [C/mol].
void postEvaluate() const
Post-evaluation hook.
A list of keyword definitions, which are a keyword followed by any number of values (e...
dimensionedSymmTensor sqr(const dimensionedVector &dv)
void size(const label)
Override size to be inconsistent with allocated storage.
General class for handling unimolecular/recombination fall-off reactions.
const dimensionedScalar c
Speed of light in a vacuum.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
bool hasDdc() const
Is the rate a function of concentration?
scalar ddT(const scalar p, const scalar T, const scalarField &c, const label li) const
The derivative of the rate w.r.t. temperature.
void write(Ostream &os) const
Write to stream.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
void ddc(const scalar p, const scalar T, const scalarField &c, const label li, scalarField &ddc) const
The derivative of the rate w.r.t. concentration.
FallOffReactionRate(const ReactionRate &k0, const ReactionRate &kInf, const FallOffFunction &F, const thirdBodyEfficiencies &tbes)
Construct from components.
friend Ostream & operator(Ostream &, const FallOffReactionRate< ReactionRate, FallOffFunction > &)
void preEvaluate() const
Pre-evaluation hook.
A wordList with hashed indices for faster lookup by name.
A class for managing temporary objects.
Ostream & incrIndent(Ostream &os)
Increment the indent level.