32 template<
class CompType,
class ThermoType>
40 coeffsDict_(model.subDict(modelName +
"Coeffs")),
41 cTauChem_(
readScalar(coeffsDict_.lookup(
"cTauChem"))),
42 equil_(coeffsDict_.lookup(
"equilibriumRateLimiter"))
48 template<
class CompType,
class ThermoType>
55 template<
class CompType,
class ThermoType>
65 scalar pf, cf, pr, cr;
68 label nSpecie = this->model_.nSpecie();
71 for (label i=0; i<nSpecie; i++)
73 c[i] =
max(0.0, c[i]);
76 for (label i=0; i<nSpecie; i++)
81 for (label i=0; i<this->model_.reactions().size(); i++)
85 scalar omegai = this->model_.omega
87 R, c, T, p, pf, cf, lRef, pr, cr, rRef
95 corr = 1.0/(1.0 + pr*dt);
99 corr = 1.0/(1.0 + pf*dt);
103 for (label s=0; s<R.
lhs().
size(); s++)
105 label si = R.
lhs()[s].index;
106 scalar sl = R.
lhs()[s].stoichCoeff;
107 RR[si][rRef] -= sl*pr*corr;
108 RR[si][lRef] += sl*pf*corr;
111 for (label s=0; s<R.
rhs().
size(); s++)
113 label si = R.
rhs()[s].index;
114 scalar sr = R.
rhs()[s].stoichCoeff;
115 RR[si][lRef] -= sr*pf*corr;
116 RR[si][rRef] += sr*pr*corr;
122 for (label i=0; i<nSpecie; i++)
128 for (label i=0; i<nSpecie; i++)
130 c[i] =
max(0.0, c[i]);
135 label nEqns = this->model_.nEqns();
138 for (label i=0; i<nSpecie; i++)
146 this->model_.derivatives(0.0, c1, dcdt);
148 scalar sumC =
sum(c);
150 for (label i=0; i<nSpecie; i++)
155 tMin =
min(tMin, -(c[i] + SMALL)/d);
160 scalar cm =
max(sumC - c[i], 1.0
e-5);
161 tMin =
min(tMin, cm/d);
165 return cTauChem_*tMin;