71template<
class CompType,
class ThermoType>
81 for(label i=0; i<this->nSpecie_; i++)
86 c1[this->nSpecie_] =
T;
87 c1[this->nSpecie_+1] =
p;
102 scalar pf, cf, pr, cr;
104 forAll(this->chemistry_.reactions(), i)
108 scalar omegai = this->chemistry_.omega
110 R, c1,
T,
p, pf, cf, lRef, pr, cr, rRef
122 label ss =
R.lhs()[
s].index;
123 scalar sl = -
R.lhs()[
s].stoichCoeff;
136 wA.append(sl*omegai);
142 label ss =
R.rhs()[
s].index;
143 scalar sl =
R.rhs()[
s].stoichCoeff;
156 wA.append(sl*omegai);
167 label curID = wAID[id];
170 scalar curwA = ((wA[id]>=0) ? wA[id] : -wA[id]);
172 List<bool> deltaBi(this->nSpecie_,
false);
173 FIFOStack<label> usedIndex;
176 label sj =
R.lhs()[j].index;
182 label sj =
R.rhs()[j].index;
188 deltaBi[curID] =
false;
189 while(!usedIndex.empty())
191 label curIndex = usedIndex.pop();
193 if (deltaBi[curIndex])
196 deltaBi[curIndex] =
false;
199 if (rABPos(curID, curIndex)==-1)
201 rABPos(curID, curIndex) = NbrABInit[curID];
203 rABNum(curID, rABPos(curID, curIndex)) = curwA;
204 rABOtherSpec(curID, rABPos(curID, curIndex)) = curIndex;
208 rABNum(curID, rABPos(curID, curIndex)) += curwA;
212 if (rABDen[curID] == 0.0)
214 rABDen[curID] = curwA;
218 rABDen[curID] +=curwA;
224 label speciesNumber = 0;
228 for (label i=0; i<this->nSpecie_; i++)
230 this->activeSpecies_[i] =
false;
237 for (label i=0; i<searchInitSet_.size(); i++)
239 label q = searchInitSet_[i];
240 this->activeSpecies_[q] =
true;
249 scalar Den = rABDen[u];
253 for (label v=0; v<NbrABInit[u]; v++)
255 label otherSpec = rABOtherSpec(u, v);
256 scalar rAB = rABNum(u, v)/Den;
267 rAB >= this->tolerance()
268 && !this->activeSpecies_[otherSpec]
272 this->activeSpecies_[otherSpec] =
true;
280 forAll(this->chemistry_.reactions(), i)
282 const Reaction<ThermoType>&
R = this->chemistry_.reactions()[i];
283 this->chemistry_.reactionsDisabled()[i] =
false;
287 label ss =
R.lhs()[
s].index;
290 if (!this->activeSpecies_[ss])
293 this->chemistry_.reactionsDisabled()[i] =
true;
299 if (!this->chemistry_.reactionsDisabled()[i])
303 label ss =
R.rhs()[
s].index;
304 if (!this->activeSpecies_[ss])
306 this->chemistry_.reactionsDisabled()[i] =
true;
313 this->NsSimp_ = speciesNumber;
314 this->chemistry_.simplifiedC().setSize(this->NsSimp_+2);
315 this->chemistry_.simplifiedToCompleteIndex().setSize(this->NsSimp_);
318 for (label i=0; i<this->nSpecie_; i++)
320 if (this->activeSpecies_[i])
322 this->chemistry_.simplifiedToCompleteIndex()[j] = i;
323 this->chemistry_.simplifiedC()[j] =
c[i];
324 this->chemistry_.completeToSimplifiedIndex()[i] = j++;
325 if (!this->chemistry_.active(i))
327 this->chemistry_.setActive(i);
332 this->chemistry_.completeToSimplifiedIndex()[i] = -1;
336 this->chemistry_.simplifiedC()[this->NsSimp_] =
T;
#define R(A, B, C, D, E, F, K, M)
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))