55 int main(
int argc,
char *argv[])
63 IFstream controlFile(controlFileName);
66 if (!controlFile.good())
69 <<
"Cannot read file " << controlFileName
77 const word fuelName(control.lookup(
"fuel"));
82 Info<<
nl <<
"Reading thermodynamic data dictionary" <<
endl;
87 IFstream thermoDataFile(thermoDataFileName);
90 if (!thermoDataFile.good())
93 <<
"Cannot read file " << thermoDataFileName
100 Info<<
nl <<
"Reading thermodynamic data for relevant species" 104 thermo FUEL(thermoData.subDict(fuelName));
105 thermo O2(thermoData.subDict(
"O2"));
106 thermo
N2(thermoData.subDict(
"N2"));
109 thermo CO2(thermoData.subDict(
"CO2"));
110 thermo
H2O(thermoData.subDict(
"H2O"));
113 thermo CO(thermoData.subDict(
"CO"));
114 thermo H2(thermoData.subDict(
"H2"));
131 scalar stoicO2 =
n + m/4.0;
132 scalar stoicN2 = (0.79/0.21)*(
n + m/4.0);
134 scalar stoicH2O = m/2.0;
146 "stoichiometricAirFuelMassRatio",
148 (oxidant.W()*oxidant.nMoles())/FUEL.W()
151 Info<<
"stoichiometricAirFuelMassRatio " 152 << stoichiometricAirFuelMassRatio <<
';' <<
endl;
154 Info<<
"Equilibrium flame temperature data (" 155 << P/1e5 <<
" bar)" <<
nl <<
nl 161 <<
setw(12) <<
"Terror" 162 <<
setw(20) <<
"O2res (mole frac)" <<
nl 167 for (
int i=0; i<16; i++)
169 scalar equiv = 0.6 + i*0.05;
170 scalar ft = 1/(1 + stoichiometricAirFuelMassRatio.value()/equiv);
173 for (
int j=0; j<28; j++)
175 scalar T0 = 300.0 + j*100.0;
178 scalar o2 = (1.0/equiv)*stoicO2;
179 scalar n2 = (0.79/0.21)*o2;
180 scalar fres =
max(1.0 - 1.0/equiv, 0.0);
181 scalar fburnt = 1.0 - fres;
185 scalar oresInit =
max(1.0/equiv - 1.0, 0.0)*stoicO2;
186 scalar co2Init = fburnt*stoicCO2;
187 scalar h2oInit = fburnt*stoicH2O;
189 scalar ores = oresInit;
190 scalar co2 = co2Init;
191 scalar h2o = h2oInit;
197 scalar
N = fres + n2 + co2 + h2o + ores;
201 scalar adiabaticFlameTemperature =
203 + (fburnt/(1.0 + o2 + n2))/(1.0/(1.0 + (1.0 + 0.79/0.21)*stoicO2))
206 scalar equilibriumFlameTemperature = adiabaticFlameTemperature;
210 for (
int j=0; j<20; j++)
218 CO2BreakUp.Kn(P, equilibriumFlameTemperature,
N)
226 H2OBreakUp.Kn(P, equilibriumFlameTemperature,
N)
233 ores = oresInit + 0.5*co + 0.5*h2;
243 fres*FUEL + ores*O2 + n2*
N2 244 + co2*CO2 + h2o*
H2O + co*CO + h2*H2
248 scalar equilibriumFlameTemperatureNew =
249 products.THa(reactants.Ha(P, T0), P, adiabaticFlameTemperature);
253 adiabaticFlameTemperature = equilibriumFlameTemperatureNew;
257 equilibriumFlameTemperature = 0.5*
259 equilibriumFlameTemperature
260 + equilibriumFlameTemperatureNew
268 <<
setw(12) << adiabaticFlameTemperature
269 <<
setw(12) << equilibriumFlameTemperature
271 << adiabaticFlameTemperature - equilibriumFlameTemperature
272 <<
setw(12) << ores/
N A class for handling file names.
A list of keyword definitions, which are a keyword followed by any number of values (e...
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensionedScalar sqrt(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static SLList< string > validArgs
A list of valid (mandatory) arguments.
Thermodynamics mapping class to expose the absolute enthalpy function as the standard enthalpy functi...
psiReactionThermo & thermo
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
A class for handling words, derived from string.
Functions to search 'etc' directories for configuration files etc.
Extract command arguments and options from the supplied argc and argv parameters. ...
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if succesful.
errorManip< error > abort(error &err)
fileName findEtcFile(const fileName &, bool mandatory=false)
Search for a file using findEtcFiles.
Istream and Ostream manipulators taking arguments.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Omanip< int > setw(const int i)
Foam::argList args(argc, argv)