54 int main(
int argc,
char *argv[])
64 IFstream propertiesDict(propertiesDictName);
67 if (!propertiesDict.good())
70 <<
"Cannot read file " << propertiesDictName
78 const word fuelName(control.lookup(
"fuel"));
83 Info<<
nl <<
"Reading thermodynamic data dictionary" <<
endl;
88 IFstream thermoDataFile(thermoDataFileName);
91 if (!thermoDataFile.good())
94 <<
"Cannot read file " << thermoDataFileName
101 Info<<
nl <<
"Reading thermodynamic data for relevant species" 105 thermo FUEL(thermoData.subDict(fuelName)); FUEL *= FUEL.W();
108 thermo O2(thermoData.subDict(
"O2")); O2 *= O2.W();
109 thermo N2(thermoData.subDict(
"N2")); N2 *= N2.W();
112 thermo H2(thermoData.subDict(
"H2")); H2 *= H2.W();
115 thermo CO2(thermoData.subDict(
"CO2")); CO2 *= CO2.W();
116 thermo H2O(thermoData.subDict(
"H2O")); H2O *= H2O.W();
117 thermo CO(thermoData.subDict(
"CO")); CO *= CO.W();
134 scalar stoicO2 =
n + m/4.0;
135 scalar stoicN2 = (0.79/0.21)*(
n + m/4.0);
137 scalar stoicH2O = m/2.0;
149 "stoichiometricAirFuelMassRatio",
154 Info<<
"stoichiometricAirFuelMassRatio " 155 << stoichiometricAirFuelMassRatio <<
';' <<
endl;
157 Info<<
"Equilibrium flame temperature data (" 158 << P/1e5 <<
" bar)" <<
nl <<
nl 164 <<
setw(12) <<
"Terror" 165 <<
setw(20) <<
"O2res (mole frac)" <<
nl 170 for (
int i=0; i<16; i++)
172 scalar equiv = 0.6 + i*0.05;
173 scalar ft = 1/(1 + stoichiometricAirFuelMassRatio.value()/equiv);
176 for (
int j=0; j<28; j++)
178 scalar T0 = 300.0 + j*100.0;
181 scalar o2 = (1.0/equiv)*stoicO2;
182 scalar n2 = (0.79/0.21)*o2;
183 scalar fres =
max(1.0 - 1.0/equiv, 0.0);
184 scalar fburnt = 1.0 - fres;
188 scalar oresInit =
max(1.0/equiv - 1.0, 0.0)*stoicO2;
189 scalar co2Init = fburnt*stoicCO2;
190 scalar h2oInit = fburnt*stoicH2O;
192 scalar ores = oresInit;
193 scalar co2 = co2Init;
194 scalar h2o = h2oInit;
200 scalar
N = fres + n2 + co2 + h2o + ores;
204 scalar adiabaticFlameTemperature =
206 + (fburnt/(1.0 + o2 + n2))/(1.0/(1.0 + (1.0 + 0.79/0.21)*stoicO2))
209 scalar equilibriumFlameTemperature = adiabaticFlameTemperature;
213 for (
int j=0; j<20; j++)
220 CO2BreakUp.Kn(P, equilibriumFlameTemperature,
N)
228 H2OBreakUp.Kn(P, equilibriumFlameTemperature,
N)
235 ores = oresInit + 0.5*co + 0.5*h2;
245 fres*FUEL + ores*O2 + n2*N2
246 + co2*CO2 + h2o*H2O + co*CO + h2*H2
250 scalar equilibriumFlameTemperatureNew =
251 products.THa(reactants.Ha(P, T0), P, adiabaticFlameTemperature);
255 adiabaticFlameTemperature = equilibriumFlameTemperatureNew;
259 equilibriumFlameTemperature = 0.5*
261 equilibriumFlameTemperature
262 + equilibriumFlameTemperatureNew
270 <<
setw(12) << adiabaticFlameTemperature
271 <<
setw(12) << equilibriumFlameTemperature
273 << adiabaticFlameTemperature - equilibriumFlameTemperature
274 <<
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 functions.
rhoReactionThermo & thermo
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 successful.
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)
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
Omanip< int > setw(const int i)
Foam::argList args(argc, argv)