30 template<
class ThermoType>
40 const wordHashSet initSet(this->coeffsDict_.lookup(
"initialSet"));
43 searchInitSet_.append(chemistry.
mixture().species()[iter.key()]);
50 template<
class ThermoType>
57 template<
class ThermoType>
93 forAll(this->chemistry_.reactions(), i)
98 scalar omegaf, omegar;
99 const scalar omegai = R.
omega(p, T, c1, li, omegaf, omegar);
111 scalar sl = -R.
lhs()[
s].stoichCoeff;
124 wA.append(sl*omegai);
131 scalar sl = R.
rhs()[
s].stoichCoeff;
144 wA.append(sl*omegai);
152 label curID = wAID[id];
153 scalar curwA = wA[id];
169 deltaBi[curID] =
false;
171 while(!usedIndex.empty())
175 if (deltaBi[curIndex])
177 deltaBi[curIndex] =
false;
178 if (rABPos(curID, curIndex)==-1)
180 rABPos(curID, curIndex) = NbrABInit[curID];
181 rABOtherSpec(curID, NbrABInit[curID]) = curIndex;
184 PAB(curID, NbrABInit[curID]) = curwA;
188 CAB(curID, NbrABInit[curID]) = -curwA;
196 PAB(curID, rABPos(curID, curIndex)) += curwA;
200 CAB(curID, rABPos(curID, curIndex)) += -curwA;
210 if (PA[curID] == 0.0)
221 if (CA[curID] == 0.0)
258 for (
int i=0; i<NbrABInit[A]; i++)
260 label ri = rABOtherSpec(A, i);
261 scalar maxPACA =
max(PA[ri],CA[ri]);
262 if (maxPACA > vSmall)
264 for (
int j=0; j<NbrABInit[ri]; j++)
266 label B = rABOtherSpec(ri, j);
269 if (rABPos2nd(A, B)==-1)
271 rABPos2nd(A, B) = NbrABInit2nd[A]++;
272 rABOtherSpec2nd(A, rABPos2nd(A, B)) = B;
273 PAB2nd(A, rABPos2nd(A, B)) =
274 PAB(A, i)*PAB(ri, j)/maxPACA;
275 CAB2nd(A, rABPos2nd(A, B)) =
276 CAB(A, i)*CAB(ri, j)/maxPACA;
280 PAB2nd(A, rABPos2nd(A, B)) +=
281 PAB(A, i)*PAB(ri, j)/maxPACA;
282 CAB2nd(A, rABPos2nd(A, B)) +=
283 CAB(A, i)*CAB(ri, j)/maxPACA;
296 this->activeSpecies_[i] =
false;
300 const labelList& SIS(this->searchInitSet_);
306 this->activeSpecies_[q] =
true;
314 scalar Den =
max(PA[u],CA[u]);
319 for (
label v=0; v<NbrABInit[u]; v++)
321 label otherSpec = rABOtherSpec(u, v);
322 scalar rAB = (PAB(u, v)+CAB(u, v))/Den;
323 label id2nd = rABPos2nd(u, otherSpec);
326 rAB += (PAB2nd(u, id2nd)+CAB2nd(u, id2nd))/Den;
331 rAB >= this->tolerance()
332 && !this->activeSpecies_[otherSpec]
336 this->activeSpecies_[otherSpec] =
true;
341 for (
label v=0; v<NbrABInit2nd[u]; v++)
343 label otherSpec = rABOtherSpec2nd(u, v);
344 scalar rAB = (PAB2nd(u, v)+CAB2nd(u, v))/Den;
348 rAB >= this->tolerance()
349 && !this->activeSpecies_[otherSpec]
353 this->activeSpecies_[otherSpec] =
true;
A FIFO stack based on a singly-linked list.
A HashTable with keys but without contents.
#define forAll(list, i)
Loop across all elements in list.
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
scalar omega(const scalar p, const scalar T, const scalarField &c, const label li, scalar &omegaf, scalar &omegar) const
Net reaction rate.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
void size(const label)
Override size to be inconsistent with allocated storage.
const List< specieCoeffs > & lhs() const
Return the components of the left hand side.
Simple extension of ReactionThermo to handle reaction kinetics in addition to the equilibrium thermod...
virtual void reduceMechanism(const scalar p, const scalar T, const scalarField &c, List< label > &ctos, DynamicList< label > &stoc, const label li)
Reduce the mechanism.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
const dimensionedScalar c1
First radiation constant: default SI units: [W/m^2].
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().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))
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
PFA(const IOdictionary &dict, chemistryModel< ThermoType > &chemistry)
Construct from components.
basicChemistryModel & chemistry
const multiComponentMixture< ThermoType > & mixture() const
Return reference to the mixture.
virtual ~PFA()
Destructor.
Extends base chemistry model by adding a thermo package, and ODE functions. Introduces chemistry equa...
const List< specieCoeffs > & rhs() const
Return the components of the right hand side.
#define R(A, B, C, D, E, F, K, M)
void push(const T &a)
Push an element onto the stack.
T pop()
Pop the bottom element off the stack.
An abstract class for methods of chemical mechanism reduction.