59int main(
int argc,
char *argv[])
63 "Calculate adiabatic flame temperature for a given mixture"
64 " at a given temperature"
67 argList::noParallel();
68 argList::noFunctionObjects();
69 argList::addArgument(
"controlFile");
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
107 <<
abort(FatalError);
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;
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
Input from file stream, using an ISstream.
Thermodynamics mapping class to expose the absolute enthalpy functions.
Extract command arguments and options from the supplied argc and argv parameters.
T get(const label index) const
Get a value from the argument at index.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A class for handling file names.
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Functions to search 'etc' directories for configuration files etc.
messageStream Info
Information stream (stdout output on master, null elsewhere)
fileName findEtcFile(const fileName &name, const bool mandatory=false, unsigned short location=0777)
Search for a single FILE within the etc directories.
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
constexpr char nl
The newline '\n' character (0x0a)
Foam::argList args(argc, argv)