51 int main(
int argc,
char *argv[])
61 IFstream propertiesDict(propertiesDictName);
64 if (!propertiesDict.good())
67 <<
"Cannot read file " << propertiesDictName
74 scalar P(control.lookup<scalar>(
"P"));
75 scalar
T0(control.lookup<scalar>(
"T0"));
76 const word fuelName(control.lookup(
"fuel"));
77 scalar
n(control.lookup<scalar>(
"n"));
78 scalar m(control.lookup<scalar>(
"m"));
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)*stoicO2;
102 scalar stoicH2O = m/2.0;
107 thermo(thermoData.subDict(fuelName))
109 Info<<
"fuel " << FUEL <<
';' <<
endl;
115 thermo(thermoData.subDict(
"O2"))
122 thermo(thermoData.subDict(
"N2"))
129 thermo(thermoData.subDict(
"CO2"))
136 thermo(thermoData.subDict(
"H2O"))
146 Info<<
"oxidant " << (1/oxidant.Y())*oxidant <<
';' << endl;
150 "stoichiometricAirFuelMassRatio",
155 Info<<
"stoichiometricAirFuelMassRatio " 156 << stoichiometricAirFuelMassRatio <<
';' <<
endl;
158 for (
int i=0; i<300; i++)
160 scalar equiv = (i + 1)*0.01;
161 scalar ft = 1/(1 + stoichiometricAirFuelMassRatio.value()/equiv);
163 Info<<
"phi = " << equiv <<
nl 164 <<
"ft = " << ft <<
endl;
166 scalar o2 = (1.0/equiv)*stoicO2;
167 scalar n2 = (0.79/0.21)*o2;
168 scalar fres =
max(1.0 - 1.0/equiv, 0.0);
169 scalar ores =
max(1.0/equiv - 1.0, 0.0);
170 scalar fburnt = 1.0 - fres;
175 FUEL + (1.0/equiv)*oxidant
177 Info<<
"reactants " << (1/reactants.Y())*reactants <<
';' << endl;
182 + (n2 - (0.79/0.21)*ores*stoicO2)*
N2 183 + fburnt*stoicCO2*CO2
184 + fburnt*stoicH2O*
H2O 186 Info<<
"burntProducts " 187 << (1/burntProducts.Y())*burntProducts <<
';' << endl;
194 + fburnt*stoicCO2*CO2
195 + fburnt*stoicH2O*
H2O 199 Info<<
"products " << (1/products.Y())*products <<
';' << endl;
201 scalar Tad = products.THa(reactants.Ha(P,
T0), P, 1000.0);
fluidReactionThermo & thermo
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 functions.
const dimensionSet dimless
A class for handling words, derived from string.
Functions to search 'etc' directories for configuration files etc.
scalar W() const
Molecular weight [kg/kmol].
Extract command arguments and options from the supplied argc and argv parameters. ...
fileName findEtcFile(const fileName &, bool mandatory=false)
Search for a file using findEtcFiles.
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
Foam::argList args(argc, argv)