59int 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;
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
Input from file stream as an ISstream, normally using std::ifstream for the actual input.
Thermodynamics mapping class to expose the absolute enthalpy functions.
Extract command arguments and options from the supplied argc and argv parameters.
static void noFunctionObjects(bool addWithOption=false)
Remove '-noFunctionObjects' option and ignore any occurrences.
static void addArgument(const string &argName, const string &usage="")
Append a (mandatory) argument to validArgs.
static void noParallel()
Remove the parallel options.
static void addNote(const string ¬e)
Add extra notes for the usage information.
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)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
constexpr char nl
The newline '\n' character (0x0a).
Foam::argList args(argc, argv)
psiReactionThermo & thermo
Info<< "Creating temperaturePhaseChangeTwoPhaseMixture\n"<< endl;autoPtr< temperaturePhaseChangeTwoPhaseMixture > mixture