print all species nasa thermo coefs and reaction type and equation
This commit is contained in:
parent
a731c3ad4b
commit
5724334e1b
1 changed files with 96 additions and 1 deletions
97
ct2foam.C
97
ct2foam.C
|
|
@ -72,6 +72,102 @@ int main(int argc, char *argv[])
|
|||
Cantera::Transport *tr_ = Cantera::newTransportMgr("Mix", &gas_);
|
||||
label nCanteraSp_ = gas_.nSpecies();
|
||||
|
||||
int nsp = gas_.nSpecies();
|
||||
|
||||
int type;
|
||||
doublereal c[15];
|
||||
doublereal minTemp, maxTemp, refPressure;
|
||||
|
||||
Cantera::MultiSpeciesThermo& sp = gas_.speciesThermo();
|
||||
|
||||
int n, j;
|
||||
|
||||
// these constants define the location of coefficient "a6" in the
|
||||
// cofficient array c. The c array contains Tmid in the first
|
||||
// location, followed by the 7 low-temperature coefficients, then
|
||||
// the seven high-temperature ones.
|
||||
for (n = 0; n < nsp; n++)
|
||||
{
|
||||
Cantera::writelog("\n\n {} (original):", gas_.speciesName(n));
|
||||
|
||||
// get the NASA coefficients in array c
|
||||
sp.reportParams(n, type, c, minTemp, maxTemp, refPressure);
|
||||
|
||||
// print the unmodified NASA coefficients
|
||||
Cantera::writelog("\n ");
|
||||
for (j = 1; j < 8; j++) {
|
||||
Cantera::writelog(" A{} ", j);
|
||||
}
|
||||
Cantera::writelog("\n low:");
|
||||
for (j = 1; j < 8; j++) {
|
||||
Cantera::writelog(" {:10.4E} ", c[j]);
|
||||
}
|
||||
|
||||
Cantera::writelog("\n high:");
|
||||
for (j = 8; j < 15; j++) {
|
||||
Cantera::writelog(" {:10.4E} ", c[j]);
|
||||
}
|
||||
Cantera::writelog("\n ");
|
||||
|
||||
// print the modified NASA coefficients
|
||||
Cantera::writelog("\n\n {} (modified):", gas_.speciesName(n).c_str());
|
||||
Cantera::writelog("\n ");
|
||||
for (j = 1; j < 8; j++) {
|
||||
Cantera::writelog(" A{} ", j);
|
||||
}
|
||||
Cantera::writelog("\n low:");
|
||||
for (j = 1; j < 8; j++) {
|
||||
Cantera::writelog(" {:10.4E} ", c[j]);
|
||||
}
|
||||
|
||||
Cantera::writelog("\n high:");
|
||||
for (j = 8; j < 15; j++) {
|
||||
Cantera::writelog(" {:10.4E} ", c[j]);
|
||||
}
|
||||
Cantera::writelog("\n");
|
||||
}
|
||||
|
||||
label nrxn = gas_.nReactions();
|
||||
|
||||
for (label k = 0; k < nrxn; k++)
|
||||
{
|
||||
std::shared_ptr<Cantera::Reaction> r(gas_.reaction(k));
|
||||
|
||||
switch (gas_.reactionType(k))
|
||||
{
|
||||
case Cantera::ELEMENTARY_RXN:
|
||||
Info << "ELEMENTARY_RXN" << endl;
|
||||
break;
|
||||
|
||||
case Cantera::THREE_BODY_RXN:
|
||||
Info << "THREE_BODY_RXN" << endl;
|
||||
break;
|
||||
|
||||
case Cantera::FALLOFF_RXN:
|
||||
Info << "FALLOFF_RXN" << endl;
|
||||
break;
|
||||
|
||||
case Cantera::PLOG_RXN:
|
||||
Info << "PLOG_RXN" << endl;
|
||||
break;
|
||||
|
||||
case Cantera::CHEBYSHEV_RXN:
|
||||
Info << "CHEBYSHEV_RXN" << endl;
|
||||
break;
|
||||
|
||||
case Cantera::CHEMACT_RXN:
|
||||
Info << "CHEMACT_RXN" << endl;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Info << gas_.reactionString(k) << endl;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Info<< "\nCreate temperature space\n" << endl;
|
||||
|
||||
|
|
@ -84,7 +180,6 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
// initialize composition array
|
||||
|
||||
scalarField XY(nCanteraSp_, 0.0);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue