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;
104 thermo FUEL(
"fuel", thermoData.subDict(fuelName));
105 Info<<
"fuel " << FUEL <<
';' <<
endl;
108 thermo O2(
"O2", thermoData.subDict(
"O2"));
111 thermo N2(
"N2", thermoData.subDict(
"N2"));
114 thermo CO2(
"CO2", thermoData.subDict(
"CO2"));
117 thermo H2O(
"H2O", thermoData.subDict(
"H2O"));
120 thermo oxidant(
"oxidant", stoicO2*O2 + stoicN2*
N2);
121 Info<<
"oxidant " << (1/oxidant.Y())*oxidant <<
';' <<
endl;
125 "stoichiometricAirFuelMassRatio",
130 Info<<
"stoichiometricAirFuelMassRatio "
131 << stoichiometricAirFuelMassRatio <<
';' <<
endl;
133 for (
int i=0; i<300; i++)
135 scalar equiv = (i + 1)*0.01;
136 scalar ft = 1/(1 + stoichiometricAirFuelMassRatio.value()/equiv);
138 Info<<
"phi = " << equiv <<
nl
139 <<
"ft = " << ft <<
endl;
141 scalar o2 = (1.0/equiv)*stoicO2;
142 scalar n2 = (0.79/0.21)*o2;
143 scalar fres =
max(1.0 - 1.0/equiv, 0.0);
144 scalar ores =
max(1.0/equiv - 1.0, 0.0);
145 scalar fburnt = 1.0 - fres;
150 FUEL + (1.0/equiv)*oxidant
152 Info<<
"reactants " << (1/reactants.Y())*reactants <<
';' <<
endl;
157 + (n2 - (0.79/0.21)*ores*stoicO2)*
N2
158 + fburnt*stoicCO2*CO2
159 + fburnt*stoicH2O*
H2O
161 Info<<
"burntProducts "
162 << (1/burntProducts.Y())*burntProducts <<
';' <<
endl;
169 + fburnt*stoicCO2*CO2
170 + fburnt*stoicH2O*
H2O
174 Info<<
"products " << (1/products.Y())*products <<
';' <<
endl;
176 scalar Tad = products.Tha(reactants.ha(P,
T0), P, 1000.0);
Thermodynamics mapping class to expose the absolute enthalpy functions.
Extract command arguments and options from the supplied argc and argv parameters.
static SLList< string > validArgs
A list of valid (mandatory) arguments.
A list of keyword definitions, which are a keyword followed by any number of values (e....
A class for handling file names.
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
scalar W() const
Molecular weight [kg/kmol].
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Functions to search 'etc' directories for configuration files etc.
int main(int argc, char *argv[])
errorManipArg< error, int > exit(error &err, const int errNo=1)
Ostream & endl(Ostream &os)
Add newline and flush stream.
const dimensionSet dimless
fileName findEtcFile(const fileName &, bool mandatory=false)
Search for a file using findEtcFiles.
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
Foam::argList args(argc, argv)
fluidMulticomponentThermo & thermo