ENH: Added dicts for themo and chemistry + code tidying

This commit is contained in:
andy
2010-10-13 12:32:27 +01:00
parent 12d3b734ee
commit fc38a586a4
3 changed files with 25 additions and 38 deletions

View File

@ -104,10 +104,13 @@ public:
// Member Functions
//- Return access to the list of species
virtual const speciesTable& species() const = 0;
//- Return access to the thermo packages
virtual const HashPtrTable<ThermoType>& speciesThermo() const = 0;
//- Return access to the list of reactions
virtual const ReactionList<ThermoType>& reactions() const = 0;
};

View File

@ -37,17 +37,11 @@ Foam::foamChemistryReader<ThermoType>::foamChemistryReader
)
:
chemistryReader<ThermoType>(),
speciesThermo_(dictionary(IFstream(thermoFileName.expand())())),
speciesTable_
(
dictionary(IFstream(reactionsFileName.expand())()).lookup("species")
),
reactions_
(
speciesTable_,
speciesThermo_,
dictionary(IFstream(reactionsFileName))
)
chemDict_(IFstream(reactionsFileName.expand())),
thermoDict_(IFstream(thermoFileName.expand())),
speciesThermo_(thermoDict_),
speciesTable_(chemDict_.lookup("species")),
reactions_(speciesTable_, speciesThermo_, chemDict_)
{}
@ -58,38 +52,23 @@ Foam::foamChemistryReader<ThermoType>::foamChemistryReader
)
:
chemistryReader<ThermoType>(),
speciesThermo_
chemDict_
(
dictionary
IFstream
(
IFstream
(
fileName(thermoDict.lookup("foamChemistryThermoFile")).expand()
)()
)
fileName(thermoDict.lookup("foamChemistryFile")).expand()
)()
),
speciesTable_
thermoDict_
(
dictionary
IFstream
(
IFstream
(
fileName(thermoDict.lookup("foamChemistryFile")).expand()
)()
).lookup("species")
fileName(thermoDict.lookup("foamChemistryThermoFile")).expand()
)()
),
reactions_
(
speciesTable_,
speciesThermo_,
dictionary
(
IFstream
(
fileName(thermoDict.lookup("foamChemistryFile")).expand()
)()
)
)
speciesThermo_(thermoDict_),
speciesTable_(chemDict_.lookup("species")),
reactions_(speciesTable_, speciesThermo_, chemDict_)
{}

View File

@ -39,7 +39,6 @@ SourceFiles
#include "fileName.H"
#include "typeInfo.H"
#include "HashPtrTable.H"
#include "SLPtrList.H"
#include "labelList.H"
#include "speciesTable.H"
#include "atomicWeights.H"
@ -58,6 +57,12 @@ class foamChemistryReader
:
public chemistryReader<ThermoType>
{
//- Chemistry/reactions dictionary
dictionary chemDict_;
//- Thermo properties dictionary
dictionary thermoDict_;
//- Table of the thermodynamic data given in the foamChemistry file
HashPtrTable<ThermoType> speciesThermo_;