Go to the documentation of this file.
58 int main(
int argc,
char *argv[])
62 "Calculate the adiabatic flame temperature for a given fuel over a "
63 " range of unburnt temperatures and equivalence ratios."
76 IFstream controlFile(controlFileName);
79 if (!controlFile.good())
82 <<
"Cannot read file " << controlFileName
89 const scalar P(control.get<scalar>(
"P"));
90 const scalar
T0(control.get<scalar>(
"T0"));
91 const word fuelName(control.get<
word>(
"fuel"));
92 const scalar
n(control.get<scalar>(
"n"));
93 const scalar m(control.get<scalar>(
"m"));
95 Info<<
nl <<
"Reading thermodynamic data dictionary" <<
endl;
100 IFstream thermoDataFile(thermoDataFileName);
103 if (!thermoDataFile.good())
106 <<
"Cannot read file " << thermoDataFileName
113 scalar stoicO2 =
n + m/4.0;
114 scalar stoicN2 = (0.79/0.21)*stoicO2;
116 scalar stoicH2O = m/2.0;
121 thermo(thermoData.subDict(fuelName))
123 Info<<
"fuel " << FUEL <<
';' <<
endl;
129 thermo(thermoData.subDict(
"O2"))
136 thermo(thermoData.subDict(
"N2"))
143 thermo(thermoData.subDict(
"CO2"))
150 thermo(thermoData.subDict(
"H2O"))
160 Info<<
"oxidant " << (1/oxidant.Y())*oxidant <<
';' <<
endl;
164 "stoichiometricAirFuelMassRatio",
169 Info<<
"stoichiometricAirFuelMassRatio "
170 << stoichiometricAirFuelMassRatio <<
';' <<
endl;
172 for (
int i=0; i<300; i++)
174 scalar equiv = (i + 1)*0.01;
175 scalar ft = 1/(1 + stoichiometricAirFuelMassRatio.value()/equiv);
177 Info<<
"phi = " << equiv <<
nl
178 <<
"ft = " << ft <<
endl;
180 scalar o2 = (1.0/equiv)*stoicO2;
181 scalar n2 = (0.79/0.21)*o2;
182 scalar fres =
max(1.0 - 1.0/equiv, 0.0);
183 scalar ores =
max(1.0/equiv - 1.0, 0.0);
184 scalar fburnt = 1.0 - fres;
189 FUEL + (1.0/equiv)*oxidant
191 Info<<
"reactants " << (1/reactants.Y())*reactants <<
';' <<
endl;
196 + (n2 - (0.79/0.21)*ores*stoicO2)*
N2
197 + fburnt*stoicCO2*CO2
198 + fburnt*stoicH2O*
H2O
200 Info<<
"burntProducts "
201 << (1/burntProducts.Y())*burntProducts <<
';' <<
endl;
208 + fburnt*stoicCO2*CO2
209 + fburnt*stoicH2O*
H2O
213 Info<<
"products " << (1/products.Y())*products <<
';' <<
endl;
215 scalar Tad = products.THa(reactants.Ha(P,
T0), P, 1000.0);
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Dimensionless.
A class for handling words, derived from Foam::string.
A class for handling file names.
Input from file stream, using an ISstream.
psiReactionThermo & thermo
Thermodynamics mapping class to expose the absolute enthalpy functions.
static void addNote(const string ¬e)
Add extra notes for the usage information.
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
Extract command arguments and options from the supplied argc and argv parameters.
Ostream & endl(Ostream &os)
Add newline and flush stream.
scalar W() const
Molecular weight [kg/kmol].
static void addArgument(const string &argName, const string &usage="")
Append a (mandatory) argument to validArgs.
static void noFunctionObjects(bool addWithOption=false)
Remove '-noFunctionObjects' option and ignore any occurrences.
fileName findEtcFile(const fileName &name, const bool mandatory=false, unsigned short location=0777)
Search for a single FILE within the etc directories.
messageStream Info
Information stream (uses stdout - output is on the master only)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
errorManipArg< error, int > exit(error &err, const int errNo=1)
Functions to search 'etc' directories for configuration files etc.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static void noParallel()
Remove the parallel options.
Foam::argList args(argc, argv)