26 double binGrowthFactor_,
28 sootModel(nsoot_, nucl_, grow_, oxid_, coag_),
29 binGrowthFactor(binGrowthFactor_) {
32 throw runtime_error(
"SECT requires nsoot>1");
62 double binGrowthFactor_,
64 sootModel(nsoot_, Nmech, Gmech, Omech, Cmech),
65 binGrowthFactor(binGrowthFactor_) {
68 throw runtime_error(
"SECT requires nsoot>1");
89 for (
size_t k = 0; k <
nsoot; k++)
114 for(k=0; k<
nsoot; k++)
119 double I_beta_DS = 0.0;
124 I_beta_DS -= term1*
mBins[0];
126 for(k=1; k<
nsoot-1; k++) {
128 I_beta_DS +=
mBins[k] * (term1 - term2);
134 I_beta_DS +=
mBins[k] * (term1 + term2);
165 vector<double> Snuc(
nsoot, 0.0);
169 Snuc[0] = jNuc * mNuc /
mBins[0];
174 vector<double> Am2m3(
nsoot, 0);
175 for (k = 0; k <
nsoot; k++)
180 vector<double> Sgrw(
nsoot, 0.0);
187 for(k=1; k<
nsoot-1; k++) {
194 Sgrw[k] = term + kGrw*Am2m3[k]/
mBins[k];
201 vector<double> Scnd(
nsoot, 0.0);
209 for(k=1; k<
nsoot-1; k++) {
224 vector<double> Soxi(
nsoot, 0.0);
231 for(k=
nsoot-2; k>0; k--) {
237 Soxi[k] = term - kOxi*Am2m3[k]/
mBins[k];
243 vector<double> Scoa(
nsoot, 0.0);
249 for(
size_t i=0; i<
nsoot; i++) {
250 for(
size_t j=i; j<
nsoot; j++) {
263 if (i==j) term *= 0.5;
265 size_t k =
static_cast<size_t>(ilnF * log((
mBins[i]+
mBins[j])/
mBins[0]));
273 Scoa[k] += Xk * term;
274 Scoa[k+1] += (1.0-Xk) * term;
282 for (
size_t k=0; k<
nsoot; k++)
287 double mdotN=0, mdotG=0, mdotO=0;
288 for(
size_t k=0; k<
nsoot; k++) {
289 mdotN += Snuc[k]*
mBins[k];
290 mdotG += Sgrw[k]*
mBins[k];
291 mdotO += Soxi[k]*
mBins[k];
294 vector<double> nucl_gasSources((
size_t)
gasSp::size, 0.0);
295 vector<double> grow_gasSources((
size_t)
gasSp::size, 0.0);
296 vector<double> oxid_gasSources((
size_t)
gasSp::size, 0.0);
303 sources.
gasSources[sp] = nucl_gasSources[sp] + grow_gasSources[sp] + oxid_gasSources[sp];
320 for (
size_t k=0; k<
nsoot; k++)
334 for (
size_t k=0; k<
nsoot; k++)
coagulationMech mechType
identity of the type of coagulation (child)
virtual double getCoagulationSootRate(const state &state, double m1, double m2) const =0
void getGrowthGasRates(const double &msootDotGrow, std::vector< double > &gasSourcesGrow) const
virtual double getGrowthSootRate(const state &state) const =0
growthMech mechType
identity of the type of growth (child)
std::vector< double > nucleationPahRxnRates
mole ratios for PAH gas species rate coupling
void getNucleationGasRates(const double &msootDotNucl, std::vector< double > &gasSourcesNucl) const
dimerStruct DIMER
used for PAH nucleation only
nucleationMech mechType
identity of the type of nucleation (child)
virtual double getNucleationSootRate(state &state)=0
void getOxidationGasRates(const double &msootDotOxid, std::vector< double > &gasSourcesOxid) const
oxidationMech mechType
identity of the type of oxidation (child)
virtual double getOxidationSootRate(const state &state) const =0
double binGrowthFactor
F^0, F^1, F^2, ... (set F here, F=2, say)
void set_mBins(const int cMin_)
virtual void setSourceTerms(state &state)
sootModel_SECT(size_t nsoot_, nucleationModel *nucl_, growthModel *grow_, oxidationModel *oxid_, coagulationModel *coag_, double binGrowthFactor_=2.0, int cMin_=100)
std::vector< double > beta_DSi
store beta_dimer_soot_i for PAH nuc to avoid double computing
virtual double get_M1_sectional(const state &state)
virtual double pahSootCollisionRatePerDimer(const state &state, const double mDimer)
virtual double get_M0_sectional(const state &state)
std::vector< double > mBins
mass in sections for the sectional model
coagulationModel * coag
pointer to coagulation mechanism
psdMech psdMechType
one of MONO, LOGN, QMOM, MOMIC, SECT, etc.
sourceTerms sources
struct containing soot, gas, and pah source terms vectors
nucleationModel * nucl
pointer to nucleation mechanism
growthModel * grow
pointer to growth mechanism
size_t nsoot
# of soot variables: moments or sections
oxidationModel * oxid
pointer to oxidation mechanism
std::vector< double > sootVar
soot variables (moments or # in sections>
double cMin
soot min num carbon atoms (dynamic for PAH nucleation)
const double rhoSoot
soot particle density
const double Na
Avogadro's constant: #/kmol.
const std::vector< double > gasSpMW
(kg/kmol); make sure the order corresponds to the gasSp enum
std::vector< double > pahSources
kg/m3*s
std::vector< double > gasSources
kg/m3*s
std::vector< double > sootSources
kg^r/m3*s (moments), or #/m3*s (sections)