27 auto csol = Cantera::newSolution(
"gri30.yaml");
28 auto gas = csol->thermo();
32 YAML::Node inputFile = YAML::LoadFile(
"../input/input_diffusion_table.yaml");
36 size_t ngrd = inputFile[
"ngrd"].as<
size_t>();
37 double L = inputFile[
"L"].as<
double>();
38 double nTauSS = inputFile[
"nTauSS"].as<
double>();
39 double nTauU = inputFile[
"nTauU"].as<
double>();
40 int nsaveSS = inputFile[
"nsaveSS"].as<
int>();
41 int nsaveU = inputFile[
"nsaveU"].as<
int>();
44 for(
size_t i=0; i<inputFile[
"Ls"].size(); i++)
45 Ls.push_back(inputFile[
"Ls"][i].as<
double>());
49 double P = inputFile[
"P"].as<
double>();
51 double TLbc = inputFile[
"LBC"][
"TLbc"].as<
double>();
52 vector<double> yLbc(gas->nSpecies());
53 YAML::Node yy = inputFile[
"LBC"][
"comp"];
54 for(
auto it=yy.begin(); it!=yy.end(); it++)
55 yLbc[gas->speciesIndex(it->first.as<
string>())] = it->second.as<
double>();
57 double TRbc = inputFile[
"RBC"][
"TRbc"].as<
double>();
58 vector<double> yRbc(gas->nSpecies());
59 yy = inputFile[
"RBC"][
"comp"];
60 for(
auto it=yy.begin(); it!=yy.end(); it++)
61 yRbc[gas->speciesIndex(it->first.as<
string>())] = it->second.as<
double>();
65 bool doSoot = inputFile[
"doSoot"].as<
bool>();
66 size_t nsoot = doSoot ? inputFile[
"nsoot"].as<
size_t>() : 0;
68 shared_ptr<sootModel> SM;
69 shared_ptr<state> SMstate;
73 nucleationModel *nucl =
new soot::nucleationModel_LL();
74 growthModel *grow =
new soot::growthModel_LL();
75 oxidationModel *oxid =
new soot::oxidationModel_LL();
76 coagulationModel *coag =
new soot::coagulationModel_FM();
78 SM = make_shared<sootModel_QMOM>(nsoot, nucl, grow, oxid, coag);
79 SM->coag->set_FM_multiplier(9.0/2.0/2.2);
84 SMstate = make_shared<state>(nsoot);
90 string radType = inputFile[
"radType"] ? inputFile[
"radType"].as<
string>() :
"planckmean";
94 bool doEnergyEqn =
true;
95 bool isPremixed =
false;
96 bool isFlamelet =
false;
100 ignis flm(isPremixed, doEnergyEqn, isFlamelet, doSoot,
101 ngrd, L, P, csol, radType,
102 yLbc, yRbc, TLbc, TRbc,
107 flm.
setIC(
"equilibrium");
115 for(
int i=0; i<Ls.size(); i++) {
120 Tmax = *max_element(flm.
T.begin(), flm.
T.end());
121 flm.
setGrid(L); cout <<
"\n\nL = " << flm.
L << endl;
122 cout << endl <<
"do SS"; cout.flush();
128 if(*max_element(flm.
T.begin(), flm.
T.end()) < 1.5*min(TLbc, TRbc)) {
129 cout << endl <<
"Extinction for L=" << flm.
L << endl;
130 Tmin = *max_element(flm.
T.begin(), flm.
T.end());
132 stringstream ss; ss <<
"L_" << L <<
"S_" << setfill(
'0') << setw(3) << 0 <<
".dat";
133 string fname = ss.str();
139 stringstream ss; ss <<
"L_" << L <<
"S_" << setfill(
'0') << setw(3) << 0 <<
".dat";
140 string fname = ss.str();
143 Tmax = *max_element(flm.
T.begin(), flm.
T.end());
148 cout << endl <<
"do unsteady to get Tmin";
151 Tmin = *max_element(flm.
T.begin(), flm.
T.end());
156 cout << endl <<
"do unsteady";