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")),
57 F_(
dict.subDict(
"F")),
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>
216 os <<
indent <<
"thirdBodyEfficiencies" <<
nl;
219 thirdBodyEfficiencies_.
write(os);
225 template<
class ReactionRate,
class FallOffFunction>
General class for handling unimolecular/recombination fall-off reactions.
void preEvaluate() const
Pre-evaluation hook.
FallOffReactionRate(const ReactionRate &k0, const ReactionRate &kInf, const FallOffFunction &F, const thirdBodyEfficiencies &tbes)
Construct from components.
void postEvaluate() const
Post-evaluation hook.
void write(Ostream &os) const
Write to stream.
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.
scalar ddT(const scalar p, const scalar T, const scalarField &c, const label li) const
The derivative of the rate w.r.t. temperature.
friend Ostream & operator(Ostream &, const FallOffReactionRate< ReactionRate, FallOffFunction > &)
bool hasDdc() const
Is the rate a function of concentration?
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
virtual Ostream & write(const char)=0
Write character.
A list of keyword definitions, which are a keyword followed by any number of values (e....
A wordList with hashed indices for faster lookup by name.
A class for managing temporary objects.
const dimensionedScalar F
Faraday constant: default SI units: [C/mol].
const dimensionedScalar c
Speed of light in a vacuum.
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Ostream & incrIndent(Ostream &os)
Increment the indent level.
Ostream & indent(Ostream &os)
Indent stream.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)