Go to the documentation of this file.
52 int main(
int argc,
char *argv[])
60 IFstream controlFile(controlFileName);
63 if (!controlFile.good())
66 <<
"Cannot read file " << controlFileName
75 const word fuelName(control.lookup(
"fuel"));
80 Info<<
nl <<
"Reading thermodynamic data dictionary" <<
endl;
85 IFstream thermoDataFile(thermoDataFileName);
88 if (!thermoDataFile.good())
91 <<
"Cannot read file " << thermoDataFileName
98 scalar stoicO2 =
n + m/4.0;
99 scalar stoicN2 = (0.79/0.21)*(
n + m/4.0);
101 scalar stoicH2O = m/2.0;
106 thermo(thermoData.subDict(fuelName))
112 stoicO2*
thermo(thermoData.subDict(
"O2"))
113 + stoicN2*
thermo(thermoData.subDict(
"N2"))
118 "stoichiometricAirFuelMassRatio",
120 (oxidant.W()*oxidant.nMoles())/fuel.W()
123 Info<<
"stoichiometricAirFuelMassRatio "
124 << stoichiometricAirFuelMassRatio <<
';' <<
endl;
126 for (
int i=0; i<300; i++)
128 scalar equiv = (i + 1)*0.01;
129 scalar ft = 1/(1 + stoichiometricAirFuelMassRatio.value()/equiv);
131 Info<<
"phi = " << equiv <<
nl
132 <<
"ft = " << ft <<
endl;
134 scalar o2 = (1.0/equiv)*stoicO2;
135 scalar n2 = (0.79/0.21)*o2;
136 scalar fres =
max(1.0 - 1.0/equiv, 0.0);
137 scalar ores =
max(1.0/equiv - 1.0, 0.0);
138 scalar fburnt = 1.0 - fres;
143 thermo(thermoData.subDict(fuelName))
145 Info<<
"fuel " << fuel <<
';' <<
endl;
150 o2*
thermo(thermoData.subDict(
"O2"))
151 + n2*
thermo(thermoData.subDict(
"N2"))
153 Info<<
"oxidant " << (1/oxidant.nMoles())*oxidant <<
';' <<
endl;
160 Info<<
"reactants " << (1/reactants.nMoles())*reactants <<
';' <<
endl;
165 + (n2 - (0.79/0.21)*ores*stoicO2)*
thermo(thermoData.subDict(
"N2"))
166 + fburnt*stoicCO2*
thermo(thermoData.subDict(
"CO2"))
167 + fburnt*stoicH2O*
thermo(thermoData.subDict(
"H2O"))
169 Info<<
"burntProducts "
170 << (1/burntProducts.nMoles())*burntProducts <<
';' <<
endl;
176 + n2*
thermo(thermoData.subDict(
"N2"))
177 + fburnt*stoicCO2*
thermo(thermoData.subDict(
"CO2"))
178 + fburnt*stoicH2O*
thermo(thermoData.subDict(
"H2O"))
179 + ores*stoicO2*
thermo(thermoData.subDict(
"O2"))
182 Info<<
"products " << (1/products.nMoles())*products <<
';' <<
endl;
184 scalar Tad = products.THa(reactants.Ha(P, T0), P, 1000.0);
static SLList< string > validArgs
A list of valid (mandatory) arguments.
fileName findEtcFile(const fileName &, bool mandatory=false)
Search for a file using findEtcFiles.
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)
A class for handling words, derived from string.
A class for handling file names.
Thermodynamics mapping class to expose the absolute enthalpy function as the standard enthalpy functi...
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.
int main(int argc, char *argv[])
A list of keyword definitions, which are a keyword followed by any number of values (e....
Generic dimensioned Type class.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if succesful.
Foam::argList args(argc, argv)