59 int main(
int argc,
char *argv[])
63 "Calculate adiabatic flame temperature for a given mixture" 64 " at a given temperature" 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 mixture rMix(control.lookup(
"reactants"));
92 mixture pMix(control.lookup(
"products"));
95 Info<<
nl <<
"Reading thermodynamic data dictionary" <<
endl;
100 IFstream thermoDataFile(thermoDataFileName);
103 if (!thermoDataFile.good())
106 <<
"Cannot read file " << thermoDataFileName
115 rMix[0].volFrac()*
thermo(thermoData.subDict(rMix[0].name()))
118 for (label i = 1; i < rMix.size(); i++)
120 reactants = reactants
121 + rMix[i].volFrac()*
thermo(thermoData.subDict(rMix[i].name()));
127 2*pMix[0].volFrac()*
thermo(thermoData.subDict(pMix[0].name()))
130 for (label i = 1; i < pMix.size(); i++)
133 + 2*pMix[i].volFrac()*
thermo(thermoData.subDict(pMix[i].name()));
136 Info<<
"Adiabatic flame temperature of mixture " << rMix.name() <<
" = " 137 << products.THa(reactants.Ha(P,
T0), P, 1000.0) <<
" K" <<
endl;
static void noFunctionObjects(bool addWithOption=false)
Remove '-noFunctionObjects' option and ignore any occurrences.
static void addNote(const string ¬e)
Add extra notes for the usage information.
A class for handling file names.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static void noParallel()
Remove the parallel options.
Thermodynamics mapping class to expose the absolute enthalpy functions.
psiReactionThermo & thermo
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
Functions to search 'etc' directories for configuration files etc.
Extract command arguments and options from the supplied argc and argv parameters. ...
errorManip< error > abort(error &err)
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
Input from file stream, using an ISstream.
T get(const label index) const
Get a value from the argument at index.
fileName findEtcFile(const fileName &name, const bool mandatory=false, unsigned short location=0777)
Search for a single FILE within the etc directories.
static void addArgument(const string &argName, const string &usage="")
Append a (mandatory) argument to validArgs.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Foam::argList args(argc, argv)