24 sootModel(nsoot_, nucl_, grow_, oxid_, coag_) {
27 throw runtime_error(
"LOGN requires nsoot=3");
32 throw runtime_error(
"LOGN requires coagulation to be FM or CONTINUUM or HM");
55 sootModel(nsoot_, Nmech, Gmech, Omech, Cmech) {
58 throw runtime_error(
"LOGN requires nsoot=3");
63 throw runtime_error(
"LOGN requires coagulation to be FM or CONTINUUM or HM");
96 const double M26 =
Mr( 2.0/6.0, M0, M1, M2);
97 const double M46 =
Mr( 4.0/6.0, M0, M1, M2);
98 const double Mn36 =
Mr(-3.0/6.0, M0, M1, M2);
99 const double Mn16 =
Mr(-1.0/6.0, M0, M1, M2);
100 const double Mn26 =
Mr(-2.0/6.0, M0, M1, M2);
101 const double Mn46 =
Mr(-4.0/6.0, M0, M1, M2);
102 const double M16 =
Mr( 1.0/6.0, M0, M1, M2);
104 const double mD16 = pow(mDimer, 1./6.);
105 const double mDn16 = pow(mDimer, -1./6.);
106 const double mDn36 = pow(mDimer, -0.5);
107 const double mD26 = pow(mDimer,
onethird);
108 const double mDn26 = pow(mDimer, -
onethird);
109 const double mD46 = pow(mDimer,
twothird);
110 const double mDn46 = pow(mDimer, -
twothird);
115 const double Ifm1 = Kfm*
bCoag * (M0 *mD16 + 2.*M26*mDn16 +
116 M46 *mDn36 + 2.*Mn16*mD26 +
123 const double Ic1 = Kc * ( 2.*M0 + Mn26*mD26 + M26*mDn26 +
124 Kcp*(M0*mDn26 + Mn26 + M26*mDn46 + Mn46*mD26) );
128 return Ifm1*Ic1/(Ifm1 + Ic1);
145 double N0 = 0, N1 = 0, N2 = 0;
146 double G0 = 0, G1 = 0, G2 = 0;
147 double X0 = 0, X1 = 0, X2 = 0;
148 double C0 = 0, C1 = 0, C2 = 0;
149 double Cnd0 = 0, Cnd1 = 0, Cnd2 = 0;
159 const double M26 =
Mr( 2.0/6.0, M0, M1, M2);
160 const double M46 =
Mr( 4.0/6.0, M0, M1, M2);
161 const double Mn36 =
Mr(-3.0/6.0, M0, M1, M2);
162 const double Mn16 =
Mr(-1.0/6.0, M0, M1, M2);
163 const double Mn26 =
Mr(-2.0/6.0, M0, M1, M2);
164 const double Mn46 =
Mr(-4.0/6.0, M0, M1, M2);
165 const double M86 =
Mr( 8.0/6.0, M0, M1, M2);
166 const double M106=
Mr(10.0/6.0, M0, M1, M2);
167 const double M36 =
Mr( 3.0/6.0, M0, M1, M2);
168 const double M56 =
Mr( 5.0/6.0, M0, M1, M2);
169 const double M76 =
Mr( 7.0/6.0, M0, M1, M2);
170 const double M16 =
Mr( 1.0/6.0, M0, M1, M2);
181 N2 = Jnuc * mMin * mMin;
191 const double mD16 = pow(mDimer, 1./6.);
192 const double mDn16 = pow(mDimer, -1./6.);
193 const double mDn36 = pow(mDimer, -0.5);
194 const double mD26 = pow(mDimer,
onethird);
195 const double mDn26 = pow(mDimer, -
onethird);
196 const double mD46 = pow(mDimer,
twothird);
197 const double mDn46 = pow(mDimer, -
twothird);
199 double Ifm1, Ifm2, Ic1, Ic2;
205 Ifm1 = Kfm*
bCoag * (M0 *mD16 + 2.*M26*mDn16 +
206 M46 *mDn36 + 2.*Mn16*mD26 +
209 Ifm2 = 2.*Kfm*
bCoag * (M1 *mD16 + 2.*M86*mDn16 +
210 M106*mDn36 + 2.*M56*mD26 +
218 Ic1 = Kc * ( 2.*M0 + Mn26*mD26 + M26*mDn26 +
219 Kcp*(M0*mDn26 + Mn26 + M26*mDn46 + Mn46*mD26) );
222 Ic2 = 2.*Kc * ( 2.*M1 + M46 *mD26 + M86*mDn26 +
223 Kcp*(M1*mDn26 + M46 + M86*mDn46 + M26*mD26) );
228 Cnd1 = mDimer*nDimer*(Ifm1*Ic1)/(Ifm1 + Ic1);
229 Cnd2 = mDimer*nDimer*(Ifm2*Ic2)/(Ifm2 + Ic2);
256 double C0_fm, C2_fm, C0_c, C2_c;
261 C0_fm = -Kfm*
bCoag*(M0*M16 + 2.*M26*Mn16 + M46*Mn36);
262 C2_fm = 2.*Kfm*
bCoag*(M1*M76 + 2.*M86*M56 + M106*M36);
269 C0_c = -Kc*(M0*M0 + M26*Mn26 + Kcp*(M0*Mn26 + M26*Mn46));
270 C2_c = 2.*Kc*(M1*M1 + M46*M86 + Kcp*(M1*M46 + M26*M86));
284 C0 = (C0_fm > 0 || C0_c > 0) ? C0_fm*C0_c/(C0_fm + C0_c) : 0.0;
285 C2 = (C2_fm > 0 || C2_c > 0) ? C2_fm*C2_c/(C2_fm + C2_c) : 0.0;
297 vector<double> nucl_gasSources((
size_t)
gasSp::size, 0.0);
298 vector<double> grow_gasSources((
size_t)
gasSp::size, 0.0);
299 vector<double> oxid_gasSources((
size_t)
gasSp::size, 0.0);
306 sources.
gasSources[sp] = nucl_gasSources[sp] + grow_gasSources[sp] + oxid_gasSources[sp];
328 if (M0 <= 0.0)
return 0;
330 double M0_exp = 1. + 0.5*r*(r - 3.);
331 double M1_exp = r*(2. - r);
332 double M2_exp = 0.5*r*(r - 1.);
334 if ( (M0 <= 0.0 && M0_exp <= 0) || (M1 <= 0.0 && M1_exp <= 0) || (M2 <= 0.0 && M2_exp <= 0) )
337 return pow(M0, M0_exp) * pow(M1, M1_exp) * pow(M2, M2_exp);
virtual double getKcp(const state &state) const
coagulationMech mechType
identity of the type of coagulation (child)
virtual double getKfm(const state &state) const
virtual double getKc(const state &state) const
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 Mr(double k, double M0, double M1, double M2) const
sootModel_LOGN(size_t nsoot_, nucleationModel *nucl_, growthModel *grow_, oxidationModel *oxid_, coagulationModel *coag_)
virtual double pahSootCollisionRatePerDimer(const state &state, const double mDimer) const
virtual void setSourceTerms(state &state)
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
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 bCoag
coagulation constant, bounded 1/sqrt(2) < bCoag < 1
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)