minor cleanup

This commit is contained in:
Dave Goodwin 2005-01-06 23:30:56 +00:00
parent 468c0173d9
commit 581ebadf11
2 changed files with 18 additions and 6 deletions

View file

@ -11,10 +11,19 @@
// precompiled headers
#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
void demo() {
int demo() {
try {
int i;
IdealGasMix gas("gri30.cti","gri30_mix");
@ -32,7 +41,6 @@ void demo() {
doublereal phi=1.1;
cout << "Enter phi: ";
cin >> phi;
cout << endl;
doublereal C_atoms=1.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{ x[k]=0.0; }
}
gas.setState_TPX(temp,pressure,x.begin());
doublereal rho_in=gas.density();
@ -66,6 +75,7 @@ void demo() {
double Tout=Tad;
double breakpt=0.2;
//============= build each domain ========================
@ -176,6 +186,7 @@ void demo() {
location will then be fixed for remainder of
calculation.*/
flow.solveEnergyEqn();
refine_grid=true;
flame.setFixedTemperature(900.0);
@ -198,12 +209,12 @@ void demo() {
cout << endl<<"Adiabatic flame temperature from equilibrium is: "<<Tad<<endl;
cout << "Flame speed for phi="<<phi<<" is "<<Uvec[0]<<" m/s."<<endl;
// return 0;
return 0;
}
catch (CanteraError) {
showErrors(cerr);
cerr << "program terminating." << endl;
//return -1;
return -1;
}
}
@ -215,5 +226,6 @@ int _tmain(int argc, _TCHAR* argv[])
#else
int main() {
return demo();
}
#endif

View file

@ -63,12 +63,12 @@ int transport_example1(int job) {
IdealGasMix gas("gri30.cti", "gri30");
doublereal temp = 500.0;
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
// mixture-averaged transport properties
Transport* tr = newTransportMgr("Multi", &gas);
Transport* tr = newTransportMgr("Mix", &gas);
int nsp = gas.nSpecies();