30 template<
class ThermoType>
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;
131 scalar sl =
R.rhs()[
s].stoichCoeff;
152 label curID = wAID[id];
153 scalar curwA = wA[id];
158 label sj =
R.lhs()[j].index;
164 label sj =
R.rhs()[j].index;
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;
static const Foam::dimensionedScalar A("A", Foam::dimPressure, 611.21)
static const Foam::dimensionedScalar B("B", Foam::dimless, 18.678)
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & shrink()
Shrink the allocated space to the number of elements used.
A FIFO stack based on a singly-linked list.
void push(const T &a)
Push an element onto the stack.
T pop()
Pop the bottom element off the stack.
A HashTable with keys but without contents.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
void append(const T &)
Append an element at the end of the list.
void size(const label)
Override size to be inconsistent with allocated storage.
Simple extension of ThermoType to handle reaction kinetics in addition to the equilibrium thermodynam...
Extends base chemistry model by adding a thermo package, and ODE functions. Introduces chemistry equa...
An abstract class for methods of chemical mechanism reduction.
void initReduceMechanism()
Protected Member Functions.
const dictionary coeffsDict_
Dictionary that store the algorithm data.
void endReduceMechanism(List< label > &ctos, DynamicList< label > &stoc)
End reduction of the mechanism.
PFA(const IOdictionary &dict, chemistryModel< ThermoType > &chemistry)
Construct from components.
virtual void reduceMechanism(const scalar p, const scalar T, const scalarField &c, List< label > &ctos, DynamicList< label > &stoc, const label li)
Reduce the mechanism.
virtual ~PFA()
Destructor.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
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.name(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
const dimensionedScalar c1
First radiation constant: default SI units: [W/m^2].
const dimensionedScalar c
Speed of light in a vacuum.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
static scalar R(const scalar a, const scalar x)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
basicChemistryModel & chemistry