Skip to content
Snippets Groups Projects
Commit fc38a586 authored by Andrew Heather's avatar Andrew Heather
Browse files

ENH: Added dicts for themo and chemistry + code tidying

parent 12d3b734
Branches
Tags
No related merge requests found
......@@ -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;
};
......
......@@ -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_)
{}
......
......@@ -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_;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment