equilibriumFlameT.C
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #include "argList.H"
00036 #include "Time.H"
00037 #include "dictionary.H"
00038 #include "IFstream.H"
00039 #include "OSspecific.H"
00040 #include "IOmanip.H"
00041
00042 #include "specieThermo.H"
00043 #include "janafThermo.H"
00044 #include "perfectGas.H"
00045
00046 using namespace Foam;
00047
00048 typedef specieThermo<janafThermo<perfectGas> > thermo;
00049
00050
00051
00052 int main(int argc, char *argv[])
00053 {
00054 argList::validArgs.clear();
00055 argList::validArgs.append("controlFile");
00056 argList args(argc, argv);
00057
00058 fileName controlFileName(args.additionalArgs()[0]);
00059
00060
00061 IFstream controlFile(controlFileName);
00062
00063
00064 if (!controlFile.good())
00065 {
00066 FatalErrorIn(args.executable())
00067 << "Cannot read file " << controlFileName
00068 << abort(FatalError);
00069 }
00070
00071 dictionary control(controlFile);
00072
00073
00074 scalar P(readScalar(control.lookup("P")));
00075 word fuel(control.lookup("fuel"));
00076 scalar n(readScalar(control.lookup("n")));
00077 scalar m(readScalar(control.lookup("m")));
00078
00079
00080 Info<< nl << "Reading Burcat data dictionary" << endl;
00081
00082 fileName BurcatCpDataFileName(findEtcFile("thermoData/BurcatCpData"));
00083
00084
00085 IFstream BurcatCpDataFile(BurcatCpDataFileName);
00086
00087
00088 if (!BurcatCpDataFile.good())
00089 {
00090 FatalErrorIn(args.executable())
00091 << "Cannot read file " << BurcatCpDataFileName
00092 << abort(FatalError);
00093 }
00094
00095 dictionary thermoData(BurcatCpDataFile);
00096
00097
00098 Info<< nl << "Reading Burcat data for relevant species" << nl << endl;
00099
00100
00101 thermo FUEL(thermoData.lookup(fuel));
00102 thermo O2(thermoData.lookup("O2"));
00103 thermo N2(thermoData.lookup("N2"));
00104
00105
00106 thermo CO2(thermoData.lookup("CO2"));
00107 thermo H2O(thermoData.lookup("H2O"));
00108
00109
00110 thermo CO(thermoData.lookup("CO"));
00111 thermo H2(thermoData.lookup("H2"));
00112
00113
00114
00115
00116 thermo CO2BreakUp
00117 (
00118 CO2 == CO + 0.5* O2
00119 );
00120
00121 thermo H2OBreakUp
00122 (
00123 H2O == H2 + 0.5*O2
00124 );
00125
00126
00127
00128 scalar stoicO2 = n + m/4.0;
00129 scalar stoicN2 = (0.79/0.21)*(n + m/4.0);
00130 scalar stoicCO2 = n;
00131 scalar stoicH2O = m/2.0;
00132
00133
00134 thermo oxidant
00135 (
00136 "oxidant",
00137 stoicO2*O2
00138 + stoicN2*N2
00139 );
00140
00141 dimensionedScalar stoichiometricAirFuelMassRatio
00142 (
00143 "stoichiometricAirFuelMassRatio",
00144 dimless,
00145 (oxidant.W()*oxidant.nMoles())/FUEL.W()
00146 );
00147
00148 Info<< "stoichiometricAirFuelMassRatio "
00149 << stoichiometricAirFuelMassRatio << ';' << endl;
00150
00151 Info<< "Equilibrium flame temperature data ("
00152 << P/1e5 << " bar)" << nl << nl
00153 << setw(3) << "Phi"
00154 << setw(12) << "ft"
00155 << setw(7) << "T0"
00156 << setw(12) << "Tad"
00157 << setw(12) << "Teq"
00158 << setw(12) << "Terror"
00159 << setw(20) << "O2res (mole frac)" << nl
00160 << endl;
00161
00162
00163
00164 for (int i=0; i<16; i++)
00165 {
00166 scalar equiv = 0.6 + i*0.05;
00167 scalar ft = 1/(1 + stoichiometricAirFuelMassRatio.value()/equiv);
00168
00169
00170 for (int j=0; j<28; j++)
00171 {
00172 scalar T0 = 300.0 + j*100.0;
00173
00174
00175 scalar o2 = (1.0/equiv)*stoicO2;
00176 scalar n2 = (0.79/0.21)*o2;
00177 scalar fres = max(1.0 - 1.0/equiv, 0.0);
00178 scalar fburnt = 1.0 - fres;
00179
00180
00181
00182 scalar oresInit = max(1.0/equiv - 1.0, 0.0)*stoicO2;
00183 scalar co2Init = fburnt*stoicCO2;
00184 scalar h2oInit = fburnt*stoicH2O;
00185
00186 scalar ores = oresInit;
00187 scalar co2 = co2Init;
00188 scalar h2o = h2oInit;
00189
00190 scalar co = 0.0;
00191 scalar h2 = 0.0;
00192
00193
00194 scalar N = fres + n2 + co2 + h2o + ores;
00195
00196
00197
00198 scalar adiabaticFlameTemperature =
00199 T0
00200 + (fburnt/(1.0 + o2 + n2))/(1.0/(1.0 + (1.0 + 0.79/0.21)*stoicO2))
00201 *2000.0;
00202
00203 scalar equilibriumFlameTemperature = adiabaticFlameTemperature;
00204
00205
00206
00207 for (int j=0; j<20; j++)
00208 {
00209
00210 if (j > 0)
00211 {
00212 co = co2*
00213 min
00214 (
00215 CO2BreakUp.Kn(equilibriumFlameTemperature, P, N)
00216 /::sqrt(max(ores, 0.001)),
00217 1.0
00218 );
00219
00220 h2 = h2o*
00221 min
00222 (
00223 H2OBreakUp.Kn(equilibriumFlameTemperature, P, N)
00224 /::sqrt(max(ores, 0.001)),
00225 1.0
00226 );
00227
00228 co2 = co2Init - co;
00229 h2o = h2oInit - h2;
00230 ores = oresInit + 0.5*co + 0.5*h2;
00231 }
00232
00233 thermo reactants
00234 (
00235 FUEL + o2*O2 + n2*N2
00236 );
00237
00238 thermo products
00239 (
00240 fres*FUEL + ores*O2 + n2*N2
00241 + co2*CO2 + h2o*H2O + co*CO + h2*H2
00242 );
00243
00244
00245 scalar equilibriumFlameTemperatureNew =
00246 products.TH(reactants.H(T0), adiabaticFlameTemperature);
00247
00248 if (j==0)
00249 {
00250 adiabaticFlameTemperature = equilibriumFlameTemperatureNew;
00251 }
00252 else
00253 {
00254 equilibriumFlameTemperature = 0.5*
00255 (
00256 equilibriumFlameTemperature
00257 + equilibriumFlameTemperatureNew
00258 );
00259 }
00260 }
00261
00262 Info<< setw(3) << equiv
00263 << setw(12) << ft
00264 << setw(7) << T0
00265 << setw(12) << adiabaticFlameTemperature
00266 << setw(12) << equilibriumFlameTemperature
00267 << setw(12)
00268 << adiabaticFlameTemperature - equilibriumFlameTemperature
00269 << setw(12) << ores/N
00270 << endl;
00271 }
00272 }
00273
00274 Info<< nl << "end" << endl;
00275
00276 return 0;
00277 }
00278
00279
00280
Copyright © 2000-2009 OpenCFD Ltd