// #ifdef WIN32 #pragma warning(disable:4786) /*Warning messages that are identified as Warning C4786: are created when MSVC generates extremely long names that it uses for debugging purposes. The long names are generated by the template expansion process and the warning messages normally can be ignored. Since these warnings tend to hide more interesting warning/error messages, you may wish to suppress the warning*/ #endif #include #include #include #include #include using namespace Cantera; int flamespeed(int np, void* p) { try { int i; IdealGasMix gas("gri30.cti","gri30_mix"); doublereal temp = 300.0; // K doublereal pressure = 1.0*OneAtm; //atm doublereal uin=0.3; //m/sec gas.setState_TPX(temp, pressure, "CH4:1.0, O2:2.0, N2:7.52"); int nsp = gas.nSpecies(); vector_fp x; x.resize(nsp); double phi = 0.0; if (np > 0) phi = *(double*)(p); if (phi == 0.0) { cout << "Enter phi: "; cin >> phi; } doublereal C_atoms=1.0; doublereal H_atoms=4.0; doublereal ax=C_atoms+H_atoms/4.0; doublereal fa_stoic=1.0/(4.76*ax); for(int k=0;k domains; domains.push_back(&inlet); domains.push_back(&flow); domains.push_back(&outlet); // OneDim flamesim(domains); Sim1D flame(domains); //----------- Supply initial guess---------------------- vector_fp locs; vector_fp value; locs.resize(3); value.resize(3); //ramp values from inlet to adiabatic flame conditions // over 70% of domain and then level off at equilibrium double z1=0.7; double uout; uout=inlet.mdot()/rho_out; uin=inlet.mdot()/rho_in; locs[0]=0.0; locs[1]=z1; locs[2]=1.0; value[0]=uin; value[1]=uout; value[2]=uout; flame.setInitialGuess("u",locs,value); value[0]=temp; value[1]=Tad; value[2]=Tad; flame.setInitialGuess("T",locs,value); for(i=0;i zvec,Tvec,COvec,CO2vec,Uvec; printf("\n%9s\t%8s\t%5s\t%7s\n","z (m)", "T (K)", "U (m/s)", "Y(CO)"); for(int n=0;n