minor cleanup
This commit is contained in:
parent
468c0173d9
commit
581ebadf11
2 changed files with 18 additions and 6 deletions
|
|
@ -11,10 +11,19 @@
|
||||||
// precompiled headers
|
// precompiled headers
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
|
|
||||||
|
#else
|
||||||
|
#include <cantera/Cantera.h>
|
||||||
|
#include <cantera/onedim.h>
|
||||||
|
#include <cantera/IdealGasMix.h>
|
||||||
|
#include <cantera/equilibrium.h>
|
||||||
|
#include <cantera/transport.h>
|
||||||
|
|
||||||
|
using namespace Cantera;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
void demo() {
|
int demo() {
|
||||||
try {
|
try {
|
||||||
int i;
|
int i;
|
||||||
IdealGasMix gas("gri30.cti","gri30_mix");
|
IdealGasMix gas("gri30.cti","gri30_mix");
|
||||||
|
|
@ -32,7 +41,6 @@ void demo() {
|
||||||
doublereal phi=1.1;
|
doublereal phi=1.1;
|
||||||
cout << "Enter phi: ";
|
cout << "Enter phi: ";
|
||||||
cin >> phi;
|
cin >> phi;
|
||||||
cout << endl;
|
|
||||||
|
|
||||||
doublereal C_atoms=1.0;
|
doublereal C_atoms=1.0;
|
||||||
doublereal H_atoms=4.0;
|
doublereal H_atoms=4.0;
|
||||||
|
|
@ -44,6 +52,7 @@ void demo() {
|
||||||
else if(k==gas.speciesIndex("N2")){ x[k]=0.79/phi/fa_stoic; }
|
else if(k==gas.speciesIndex("N2")){ x[k]=0.79/phi/fa_stoic; }
|
||||||
else{ x[k]=0.0; }
|
else{ x[k]=0.0; }
|
||||||
}
|
}
|
||||||
|
|
||||||
gas.setState_TPX(temp,pressure,x.begin());
|
gas.setState_TPX(temp,pressure,x.begin());
|
||||||
doublereal rho_in=gas.density();
|
doublereal rho_in=gas.density();
|
||||||
|
|
||||||
|
|
@ -66,6 +75,7 @@ void demo() {
|
||||||
double Tout=Tad;
|
double Tout=Tad;
|
||||||
double breakpt=0.2;
|
double breakpt=0.2;
|
||||||
|
|
||||||
|
|
||||||
//============= build each domain ========================
|
//============= build each domain ========================
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -176,6 +186,7 @@ void demo() {
|
||||||
location will then be fixed for remainder of
|
location will then be fixed for remainder of
|
||||||
calculation.*/
|
calculation.*/
|
||||||
|
|
||||||
|
|
||||||
flow.solveEnergyEqn();
|
flow.solveEnergyEqn();
|
||||||
refine_grid=true;
|
refine_grid=true;
|
||||||
flame.setFixedTemperature(900.0);
|
flame.setFixedTemperature(900.0);
|
||||||
|
|
@ -198,12 +209,12 @@ void demo() {
|
||||||
cout << endl<<"Adiabatic flame temperature from equilibrium is: "<<Tad<<endl;
|
cout << endl<<"Adiabatic flame temperature from equilibrium is: "<<Tad<<endl;
|
||||||
cout << "Flame speed for phi="<<phi<<" is "<<Uvec[0]<<" m/s."<<endl;
|
cout << "Flame speed for phi="<<phi<<" is "<<Uvec[0]<<" m/s."<<endl;
|
||||||
|
|
||||||
// return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
catch (CanteraError) {
|
catch (CanteraError) {
|
||||||
showErrors(cerr);
|
showErrors(cerr);
|
||||||
cerr << "program terminating." << endl;
|
cerr << "program terminating." << endl;
|
||||||
//return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -215,5 +226,6 @@ int _tmain(int argc, _TCHAR* argv[])
|
||||||
#else
|
#else
|
||||||
int main() {
|
int main() {
|
||||||
return demo();
|
return demo();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -63,12 +63,12 @@ int transport_example1(int job) {
|
||||||
IdealGasMix gas("gri30.cti", "gri30");
|
IdealGasMix gas("gri30.cti", "gri30");
|
||||||
doublereal temp = 500.0;
|
doublereal temp = 500.0;
|
||||||
doublereal pres = 2.0*OneAtm;
|
doublereal pres = 2.0*OneAtm;
|
||||||
gas.setState_TPX(temp, pres, "H2:1.0, O2:0.5, CH4:0.1, N2:0.2");
|
gas.setState_TPX(temp, pres, "H2:1.0, CH4:0.1");
|
||||||
|
|
||||||
// create a transport manager that implements
|
// create a transport manager that implements
|
||||||
// mixture-averaged transport properties
|
// mixture-averaged transport properties
|
||||||
|
|
||||||
Transport* tr = newTransportMgr("Multi", &gas);
|
Transport* tr = newTransportMgr("Mix", &gas);
|
||||||
|
|
||||||
int nsp = gas.nSpecies();
|
int nsp = gas.nSpecies();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue