mixtureAdiabaticFlameT.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 "dictionary.H"
00036 #include "IFstream.H"
00037 #include "OSspecific.H"
00038
00039 #include "specieThermo.H"
00040 #include "janafThermo.H"
00041 #include "perfectGas.H"
00042 #include "mixture.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 << abort(FatalError);
00068 }
00069
00070 dictionary control(controlFile);
00071
00072
00073 scalar T0(readScalar(control.lookup("T0")));
00074 mixture rMix(control.lookup("reactants"));
00075 mixture pMix(control.lookup("products"));
00076
00077
00078 Info<< nl << "Reading Burcat data dictionary" << endl;
00079
00080 fileName BurcatCpDataFileName(findEtcFile("thermoData/BurcatCpData"));
00081
00082
00083 IFstream BurcatCpDataFile(BurcatCpDataFileName);
00084
00085
00086 if (!BurcatCpDataFile.good())
00087 {
00088 FatalErrorIn(args.executable())
00089 << "Cannot read file " << BurcatCpDataFileName
00090 << abort(FatalError);
00091 }
00092
00093 dictionary CpData(BurcatCpDataFile);
00094
00095
00096 thermo reactants
00097 (
00098 rMix[0].volFrac()*thermo(CpData.lookup(rMix[0].name()))
00099 );
00100
00101 for (label i = 1; i < rMix.size(); i++)
00102 {
00103 reactants = reactants
00104 + rMix[i].volFrac()*thermo(CpData.lookup(rMix[i].name()));
00105 }
00106
00107
00108 thermo products
00109 (
00110 2*pMix[0].volFrac()*thermo(CpData.lookup(pMix[0].name()))
00111 );
00112
00113 for (label i = 1; i < pMix.size(); i++)
00114 {
00115 products = products
00116 + 2*pMix[i].volFrac()*thermo(CpData.lookup(pMix[i].name()));
00117 }
00118
00119 Info << "Adiabatic flame temperature of mixture " << rMix.name() << " = "
00120 << products.TH(reactants.H(T0), 1000.0) << " K" << endl;
00121
00122 return 0;
00123 }
00124
00125
00126
Copyright © 2000-2009 OpenCFD Ltd