adiabaticFlameT.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 #include "argList.H"
00035 #include "Time.H"
00036 #include "dictionary.H"
00037 #include "IFstream.H"
00038 #include "OSspecific.H"
00039
00040 #include "specieThermo.H"
00041 #include "janafThermo.H"
00042 #include "perfectGas.H"
00043
00044 using namespace Foam;
00045
00046 typedef specieThermo<janafThermo<perfectGas> > thermo;
00047
00048
00049
00050
00051 int main(int argc, char *argv[])
00052 {
00053 argList::validArgs.clear();
00054 argList::validArgs.append("controlFile");
00055 argList args(argc, argv);
00056
00057 fileName controlFileName(args.additionalArgs()[0]);
00058
00059
00060 IFstream controlFile(controlFileName);
00061
00062
00063 if (!controlFile.good())
00064 {
00065 FatalErrorIn(args.executable())
00066 << "Cannot read file " << controlFileName
00067 << exit(FatalError);
00068 }
00069
00070 dictionary control(controlFile);
00071
00072
00073 scalar T0(readScalar(control.lookup("T0")));
00074 word fuelName(control.lookup("fuel"));
00075 scalar n(readScalar(control.lookup("n")));
00076 scalar m(readScalar(control.lookup("m")));
00077
00078
00079 Info<< nl << "Reading Burcat data dictionary" << endl;
00080
00081 fileName BurcatCpDataFileName(findEtcFile("thermoData/BurcatCpData"));
00082
00083
00084 IFstream BurcatCpDataFile(BurcatCpDataFileName);
00085
00086
00087 if (!BurcatCpDataFile.good())
00088 {
00089 FatalErrorIn(args.executable())
00090 << "Cannot read file " << BurcatCpDataFileName
00091 << exit(FatalError);
00092 }
00093
00094 dictionary CpData(BurcatCpDataFile);
00095
00096
00097 scalar stoicO2 = n + m/4.0;
00098 scalar stoicN2 = (0.79/0.21)*(n + m/4.0);
00099 scalar stoicCO2 = n;
00100 scalar stoicH2O = m/2.0;
00101
00102 thermo fuel
00103 (
00104 "fuel",
00105 thermo(CpData.lookup(fuelName))
00106 );
00107
00108 thermo oxidant
00109 (
00110 "oxidant",
00111 stoicO2*thermo(CpData.lookup("O2"))
00112 + stoicN2*thermo(CpData.lookup("N2"))
00113 );
00114
00115 dimensionedScalar stoichiometricAirFuelMassRatio
00116 (
00117 "stoichiometricAirFuelMassRatio",
00118 dimless,
00119 (oxidant.W()*oxidant.nMoles())/fuel.W()
00120 );
00121
00122 Info<< "stoichiometricAirFuelMassRatio "
00123 << stoichiometricAirFuelMassRatio << ';' << endl;
00124
00125 for (int i=0; i<300; i++)
00126 {
00127 scalar equiv = (i + 1)*0.01;
00128 scalar ft = 1/(1 + stoichiometricAirFuelMassRatio.value()/equiv);
00129
00130 Info<< "phi = " << equiv << nl
00131 << "ft = " << ft << endl;
00132
00133 scalar o2 = (1.0/equiv)*stoicO2;
00134 scalar n2 = (0.79/0.21)*o2;
00135 scalar fres = max(1.0 - 1.0/equiv, 0.0);
00136 scalar ores = max(1.0/equiv - 1.0, 0.0);
00137 scalar fburnt = 1.0 - fres;
00138
00139 thermo fuel
00140 (
00141 "fuel",
00142 thermo(CpData.lookup(fuelName))
00143 );
00144 Info<< "fuel " << fuel << ';' << endl;
00145
00146 thermo oxidant
00147 (
00148 "oxidant",
00149 o2*thermo(CpData.lookup("O2"))
00150 + n2*thermo(CpData.lookup("N2"))
00151 );
00152 Info<< "oxidant " << (1/oxidant.nMoles())*oxidant << ';' << endl;
00153
00154 thermo reactants
00155 (
00156 "reactants",
00157 fuel + oxidant
00158 );
00159 Info<< "reactants " << (1/reactants.nMoles())*reactants << ';' << endl;
00160
00161 thermo burntProducts
00162 (
00163 "burntProducts",
00164 + (n2 - (0.79/0.21)*ores*stoicO2)*thermo(CpData.lookup("N2"))
00165 + fburnt*stoicCO2*thermo(CpData.lookup("CO2"))
00166 + fburnt*stoicH2O*thermo(CpData.lookup("H2O"))
00167 );
00168 Info<< "burntProducts "
00169 << (1/burntProducts.nMoles())*burntProducts << ';' << endl;
00170
00171 thermo products
00172 (
00173 "products",
00174 fres*fuel
00175 + n2*thermo(CpData.lookup("N2"))
00176 + fburnt*stoicCO2*thermo(CpData.lookup("CO2"))
00177 + fburnt*stoicH2O*thermo(CpData.lookup("H2O"))
00178 + ores*stoicO2*thermo(CpData.lookup("O2"))
00179 );
00180
00181 Info<< "products " << (1/products.nMoles())*products << ';' << endl;
00182
00183 scalar Tad = products.TH(reactants.H(T0), 1000.0);
00184 Info<< "Tad = " << Tad << nl << endl;
00185 }
00186
00187 Info<< nl << "end" << endl;
00188
00189 return 0;
00190 }
00191
00192
00193
Copyright © 2000-2009 OpenCFD Ltd