48int main(
int argc,
char *argv[])
51 Ostream::defaultPrecision(10);
55 "Convert CHEMKINIII thermodynamics and reaction data files into"
59 argList::noParallel();
60 argList::noFunctionObjects();
62 argList::addArgument(
"CHEMKINFile");
63 argList::addArgument(
"CHEMKINThermodynamicsFile");
64 argList::addArgument(
"CHEMKINTransport");
65 argList::addArgument(
"FOAMChemistryFile");
66 argList::addArgument(
"FOAMThermodynamicsFile");
68 argList::addBoolOption
71 "Read Chemkin thermo file in new format"
76 const bool newFormat =
args.
found(
"newFormat");
93 reactionsFile.writeEntry(
"elements", cr.elementNames()) <<
nl;
94 reactionsFile.writeEntry(
"species", cr.species()) <<
nl;
96 cr.reactions().write(reactionsFile);
103 cr.speciesThermo().write(
os);
109 const word& speciesName = dEntry.keyword();
114 for (
const specieElement& elem : cr.specieComposition()[speciesName])
116 elemDict.add(elem.name(), elem.nAtoms());
119 speciesDict.
add(
"elements", elemDict);
Input/output from string buffers.
Input from string buffer, using a ISstream. Always UNCOMPRESSED.
Output to file stream, using an OSstream.
Output to string buffer, using a OSstream. Always UNCOMPRESSED.
Extract command arguments and options from the supplied argc and argv parameters.
T get(const label index) const
Get a value from the argument at index.
bool found(const word &optName) const
Return true if the named option is found.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
entry * add(entry *entryPtr, bool mergeEntry=false)
Add a new entry.
A keyword and a list of tokens is an 'entry'.
A class for handling file names.
A wordList with hashed named lookup, which can be faster in some situations than using the normal lis...
A class for handling words, derived from Foam::string.
const dictionary & thermoDict
OBJstream os(runTime.globalPath()/outputName)
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
constexpr char nl
The newline '\n' character (0x0a)
Foam::argList args(argc, argv)