53 int main(
int argc,
char *argv[])
61 IFstream controlFile(controlFileName);
64 if (!controlFile.good())
67 <<
"Cannot read file " << controlFileName
76 const word fuelName(control.lookup(
"fuel"));
81 Info<<
nl <<
"Reading thermodynamic data dictionary" <<
endl;
86 IFstream thermoDataFile(thermoDataFileName);
89 if (!thermoDataFile.good())
92 <<
"Cannot read file " << thermoDataFileName
99 scalar stoicO2 =
n + m/4.0;
100 scalar stoicN2 = (0.79/0.21)*(
n + m/4.0);
102 scalar stoicH2O = m/2.0;
107 thermo(thermoData.subDict(fuelName))
113 stoicO2*
thermo(thermoData.subDict(
"O2"))
114 + stoicN2*
thermo(thermoData.subDict(
"N2"))
119 "stoichiometricAirFuelMassRatio",
121 (oxidant.W()*oxidant.nMoles())/fuel.W()
124 Info<<
"stoichiometricAirFuelMassRatio " 125 << stoichiometricAirFuelMassRatio <<
';' <<
endl;
127 for (
int i=0; i<300; i++)
129 scalar equiv = (i + 1)*0.01;
130 scalar ft = 1/(1 + stoichiometricAirFuelMassRatio.value()/equiv);
132 Info<<
"phi = " << equiv <<
nl 133 <<
"ft = " << ft <<
endl;
135 scalar o2 = (1.0/equiv)*stoicO2;
136 scalar n2 = (0.79/0.21)*o2;
137 scalar fres =
max(1.0 - 1.0/equiv, 0.0);
138 scalar ores =
max(1.0/equiv - 1.0, 0.0);
139 scalar fburnt = 1.0 - fres;
144 thermo(thermoData.subDict(fuelName))
146 Info<<
"fuel " << fuel <<
';' <<
endl;
151 o2*
thermo(thermoData.subDict(
"O2"))
152 + n2*
thermo(thermoData.subDict(
"N2"))
154 Info<<
"oxidant " << (1/oxidant.nMoles())*oxidant <<
';' << endl;
161 Info<<
"reactants " << (1/reactants.nMoles())*reactants <<
';' << endl;
166 + (n2 - (0.79/0.21)*ores*stoicO2)*
thermo(thermoData.subDict(
"N2"))
167 + fburnt*stoicCO2*
thermo(thermoData.subDict(
"CO2"))
168 + fburnt*stoicH2O*
thermo(thermoData.subDict(
"H2O"))
170 Info<<
"burntProducts " 171 << (1/burntProducts.nMoles())*burntProducts <<
';' << endl;
177 + n2*
thermo(thermoData.subDict(
"N2"))
178 + fburnt*stoicCO2*
thermo(thermoData.subDict(
"CO2"))
179 + fburnt*stoicH2O*
thermo(thermoData.subDict(
"H2O"))
180 + ores*stoicO2*
thermo(thermoData.subDict(
"O2"))
183 Info<<
"products " << (1/products.nMoles())*products <<
';' << endl;
185 scalar Tad = products.THa(reactants.Ha(P, T0), P, 1000.0);
A class for handling file names.
errorManipArg< error, int > exit(error &err, const int errNo=1)
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.
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 function as the standard enthalpy functi...
psiReactionThermo & thermo
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
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 succesful.
fileName findEtcFile(const fileName &, bool mandatory=false)
Search for a file using findEtcFiles.
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Foam::argList args(argc, argv)