SootLib
Loading...
Searching...
No Matches
sootModel_MONO.cc
Go to the documentation of this file.
1#include "sootModel_MONO.h"
2
3using namespace std;
4using namespace soot;
5
18
20 nucleationModel *nucl_,
21 growthModel *grow_,
22 oxidationModel *oxid_,
23 coagulationModel *coag_) :
24 sootModel(nsoot_, nucl_, grow_, oxid_, coag_) {
25
26 if (nsoot_ != 2)
27 throw runtime_error("MONO requires nsoot=2");
28
30}
43
45 nucleationMech Nmech,
46 growthMech Gmech,
47 oxidationMech Omech,
48 coagulationMech Cmech) :
49 sootModel(nsoot_, Nmech, Gmech, Omech, Cmech) {
50
51 if (nsoot_ != 2)
52 throw runtime_error("MONO requires nsoot=2");
53
55}
56
68
70
71 //---------- get moments
72
73 double M0 = state.sootVar[0];
74 double M1 = state.sootVar[1];
75
76 //---------- set weights and abscissas
77
78 if (M0 > 0) {
79 state.wts[0] = M0;
80 state.absc[0] = M1 / M0;
81 }
82
83 //---------- get chemical rates
84
85 double jNuc = nucl->getNucleationSootRate(state); // #/m3*s
86 double kGrw = grow->getGrowthSootRate(state);
87 double kOxi = oxid->getOxidationSootRate(state);
88 double coa = coag->getCoagulationSootRate(state, state.absc[0], state.absc[0]);
89
90 //---------- nucleation terms
91
92 double N0 = 0;
93 double N1 = 0;
94
96 N0 = jNuc; // #/m3*s
97 N1 = jNuc * state.cMin * gasSpMW[(int)gasSp::C] / Na; // kg_soot/m3*s (as carbon)
98 }
99
100 //---------- PAH condensation terms
101
102 double Cnd0 = 0;
103 double Cnd1 = 0;
104
108
109 //---------- growth terms
110
111 double G0 = 0;
112 double G1 = 0;
113
114 double Am2m3 = M0 > 0 ? M_PI*pow(6./(M_PI*rhoSoot)*M1/M0, twothird)*M0 : 0;
115
117 G1 = kGrw * Am2m3;
118
119 //---------- oxidation terms
120
121 double X0 = 0;
122 double X1 = 0;
123
125 X1 = -kOxi * Am2m3;
126
127 //---------- coagulation terms
128
129 double C0 = 0;
130 double C1 = 0;
131
133 C0 = -0.5*coa*state.wts[0]*state.wts[0];
134
135 //---------- combine to make soot source terms
136
137 sources.sootSources[0] = N0 + Cnd0 + G0 + X0 + C0; // #/m3*s
138 sources.sootSources[1] = N1 + Cnd1 + G1 + X1 + C1; // kg/m3*s
139
140 //---------- set gas source terms
141
142 vector<double> nucl_gasSources((size_t)gasSp::size, 0.0);
143 vector<double> grow_gasSources((size_t)gasSp::size, 0.0);
144 vector<double> oxid_gasSources((size_t)gasSp::size, 0.0);
145
146 nucl->getNucleationGasRates(N1, nucl_gasSources);
147 grow->getGrowthGasRates( G1, grow_gasSources);
148 oxid->getOxidationGasRates( X1, oxid_gasSources);
149
150 for (size_t sp=0; sp<(size_t)gasSp::size; sp++)
151 sources.gasSources[sp] = nucl_gasSources[sp] + grow_gasSources[sp] + oxid_gasSources[sp];
152
153 //---------- set PAH source terms
154
156 sources.pahSources = nucl->nucleationPahRxnRates; // includes both nucleation and condensation
157}
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
Definition: growthModel.cc:16
virtual double getGrowthSootRate(const state &state) const =0
growthMech mechType
identity of the type of growth (child)
Definition: growthModel.h:24
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
virtual void setSourceTerms(state &state)
sootModel_MONO(size_t nsoot_, nucleationModel *nucl_, growthModel *grow_, oxidationModel *oxid_, coagulationModel *coag_)
coagulationModel * coag
pointer to coagulation mechanism
Definition: sootModel.h:33
psdMech psdMechType
one of MONO, LOGN, QMOM, MOMIC, SECT, etc.
Definition: sootModel.h:37
sourceTerms sources
struct containing soot, gas, and pah source terms vectors
Definition: sootModel.h:42
nucleationModel * nucl
pointer to nucleation mechanism
Definition: sootModel.h:30
growthModel * grow
pointer to growth mechanism
Definition: sootModel.h:31
oxidationModel * oxid
pointer to oxidation mechanism
Definition: sootModel.h:32
std::vector< double > wts
moment weights
Definition: state.h:34
std::vector< double > sootVar
soot variables (moments or # in sections>
Definition: state.h:32
double cMin
soot min num carbon atoms (dynamic for PAH nucleation)
Definition: state.h:36
std::vector< double > absc
moment abscissas
Definition: state.h:33
Definition: sootDefs.h:11
oxidationMech
Definition: sootDefs.h:33
const double rhoSoot
soot particle density
Definition: sootDefs.h:21
coagulationMech
Definition: sootDefs.h:34
growthMech
Definition: sootDefs.h:32
nucleationMech
Definition: sootDefs.h:31
const double twothird
Definition: sootDefs.h:25
const double Na
Avogadro's constant: #/kmol.
Definition: sootDefs.h:15
const std::vector< double > gasSpMW
(kg/kmol); make sure the order corresponds to the gasSp enum
Definition: sootDefs.h:74
std::vector< double > pahSources
kg/m3*s
Definition: sootDefs.h:143
std::vector< double > gasSources
kg/m3*s
Definition: sootDefs.h:142
std::vector< double > sootSources
kg^r/m3*s (moments), or #/m3*s (sections)
Definition: sootDefs.h:141