31 template<
class ThermoType>
41 reactionsDisabled_(
chemistry.nReaction(), false),
45 sumnActiveSpecies_(0),
51 template<
class ThermoType>
58 coeffsDict_(
dict.subDict(
"reduction")),
62 reactionsDisabled_(
chemistry.nReaction(), false),
64 log_(coeffsDict_.lookupOrDefault<
Switch>(
"log", false)),
65 tolerance_(coeffsDict_.lookupOrDefault<scalar>(
"tolerance", 1
e-4)),
66 sumnActiveSpecies_(0),
72 cpuReduceFile_ =
chemistry.logFile(
"cpu_reduce.out");
73 nActiveSpeciesFile_ =
chemistry.logFile(
"nActiveSpecies.out");
80 template<
class ThermoType>
87 template<
class ThermoType>
92 cpuTime_.cpuTimeIncrement();
97 template<
class ThermoType>
105 forAll(chemistry_.reactions(), i)
108 reactionsDisabled_[i] =
false;
113 if (!activeSpecies_[ss])
115 reactionsDisabled_[i] =
true;
120 if (!reactionsDisabled_[i])
125 if (!activeSpecies_[ss])
127 reactionsDisabled_[i] =
true;
135 nActiveSpecies_ =
count(activeSpecies_,
true);
141 if (activeSpecies_[i])
145 if (!chemistry_.thermo().speciesActive()[i])
147 chemistry_.thermo().setSpecieActive(i);
157 chemistry_.setNSpecie(nActiveSpecies_);
161 sumnActiveSpecies_ += nActiveSpecies_;
163 reduceMechCpuTime_ += cpuTime_.cpuTimeIncrement();
168 template<
class ThermoType>
174 << chemistry_.time().userTimeValue()
175 <<
" " << reduceMechCpuTime_ <<
endl;
180 nActiveSpeciesFile_()
181 << chemistry_.time().userTimeValue()
182 <<
" " << sumnActiveSpecies_/sumn_ <<
endl;
185 sumnActiveSpecies_ = 0;
187 reduceMechCpuTime_ = 0;
#define forAll(list, i)
Loop across all elements in list.
void setSize(const label)
Alter the addressed list size.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Simple extension of ThermoType to handle reaction kinetics in addition to the equilibrium thermodynam...
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Extends base chemistry model by adding a thermo package, and ODE functions. Introduces chemistry equa...
virtual ~chemistryReductionMethod()
Destructor.
void initReduceMechanism()
Protected Member Functions.
void endReduceMechanism(List< label > &ctos, DynamicList< label > &stoc)
End reduction of the mechanism.
chemistryReductionMethod(chemistryModel< ThermoType > &chemistry)
Construct from components.
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))
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static scalar R(const scalar a, const scalar x)
label count(const ListType &l, typename ListType::const_reference x)
Count the number of occurrences of a value in a list.
basicChemistryModel & chemistry