mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Propagated dictionary constructors through lib reaction thermo
This commit is contained in:
@ -38,6 +38,7 @@ SourceFiles
|
||||
#include "typeInfo.H"
|
||||
#include "runTimeSelectionTables.H"
|
||||
#include "Reaction.H"
|
||||
#include "ReactionList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -107,7 +108,7 @@ public:
|
||||
|
||||
virtual const HashPtrTable<ThermoType>& speciesThermo() const = 0;
|
||||
|
||||
virtual const SLPtrList<Reaction<ThermoType> >& reactions() const = 0;
|
||||
virtual const PtrList<Reaction<ThermoType> >& reactions() const = 0;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -296,8 +296,8 @@ List<specieElement> currentSpecieComposition(5);
|
||||
scalar currentLowT = 0;
|
||||
scalar currentHighT = 0;
|
||||
scalar currentCommonT = 0;
|
||||
gasThermoPhysics::coeffArray highCpCoeffs = {0, 0, 0, 0, 0, 0, 0};
|
||||
gasThermoPhysics::coeffArray lowCpCoeffs = {0, 0, 0, 0, 0, 0, 0};
|
||||
gasThermoPhysics::coeffArray highCpCoeffs(scalarList(7));
|
||||
gasThermoPhysics::coeffArray lowCpCoeffs(scalarList(7));
|
||||
|
||||
gasReaction::specieCoeffs currentSpecieCoeff;
|
||||
|
||||
|
||||
@ -716,7 +716,7 @@ void Foam::chemkinReader::addReaction
|
||||
Afactor*ArrheniusCoeffs[0],
|
||||
ArrheniusCoeffs[1],
|
||||
ArrheniusCoeffs[2]/RR,
|
||||
JanevCoeffs.begin()
|
||||
FixedList<scalar, 9>(JanevCoeffs)
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -738,7 +738,7 @@ void Foam::chemkinReader::addReaction
|
||||
Afactor*ArrheniusCoeffs[0],
|
||||
ArrheniusCoeffs[1],
|
||||
ArrheniusCoeffs[2]/RR,
|
||||
powerSeriesCoeffs.begin()
|
||||
FixedList<scalar, 4>(powerSeriesCoeffs)
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -850,7 +850,6 @@ void Foam::chemkinReader::read
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructor * * * * * * * * * * * * * * * //
|
||||
|
||||
// Construct from components
|
||||
Foam::chemkinReader::chemkinReader
|
||||
(
|
||||
const fileName& CHEMKINFileName,
|
||||
@ -865,7 +864,6 @@ Foam::chemkinReader::chemkinReader
|
||||
}
|
||||
|
||||
|
||||
// Construct from components
|
||||
Foam::chemkinReader::chemkinReader(const dictionary& thermoDict)
|
||||
:
|
||||
lineNo_(1),
|
||||
@ -902,4 +900,5 @@ Foam::chemkinReader::chemkinReader(const dictionary& thermoDict)
|
||||
read(chemkinFile, thermoFile);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
@ -40,7 +40,7 @@ SourceFiles
|
||||
#include "fileName.H"
|
||||
#include "typeInfo.H"
|
||||
#include "HashPtrTable.H"
|
||||
#include "SLPtrList.H"
|
||||
#include "ReactionList.H"
|
||||
#include "DynamicList.H"
|
||||
#include "labelList.H"
|
||||
#include "speciesTable.H"
|
||||
@ -205,7 +205,7 @@ private:
|
||||
HashTable<List<specieElement> > specieComposition_;
|
||||
|
||||
//- List of the reactions
|
||||
SLPtrList<gasReaction> reactions_;
|
||||
SLPtrList<Reaction<gasThermoPhysics> > reactions_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
@ -375,9 +375,10 @@ public:
|
||||
}
|
||||
|
||||
//- List of the reactions
|
||||
const SLPtrList<gasReaction>& reactions() const
|
||||
const PtrList<Reaction<gasThermoPhysics> >& reactions() const
|
||||
{
|
||||
return reactions_;
|
||||
return PtrList<Reaction<gasThermoPhysics> >(reactions_);
|
||||
// return reactions_;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -37,12 +37,16 @@ Foam::foamChemistryReader<ThermoType>::foamChemistryReader
|
||||
)
|
||||
:
|
||||
chemistryReader<ThermoType>(),
|
||||
speciesThermo_(IFstream(thermoFileName)()),
|
||||
speciesTable_(dictionary(IFstream(reactionsFileName)()).lookup("species")),
|
||||
speciesThermo_(dictionary(IFstream(thermoFileName.expand())())),
|
||||
speciesTable_
|
||||
(
|
||||
dictionary(IFstream(reactionsFileName.expand())()).lookup("species")
|
||||
),
|
||||
reactions_
|
||||
(
|
||||
dictionary(IFstream(reactionsFileName)()).lookup("reactions"),
|
||||
Reaction<ThermoType>::iNew(speciesTable_, speciesThermo_)
|
||||
speciesTable_,
|
||||
speciesThermo_,
|
||||
dictionary(IFstream(reactionsFileName))
|
||||
)
|
||||
{}
|
||||
|
||||
@ -55,11 +59,14 @@ Foam::foamChemistryReader<ThermoType>::foamChemistryReader
|
||||
:
|
||||
chemistryReader<ThermoType>(),
|
||||
speciesThermo_
|
||||
(
|
||||
dictionary
|
||||
(
|
||||
IFstream
|
||||
(
|
||||
fileName(thermoDict.lookup("foamChemistryThermoFile")).expand()
|
||||
)()
|
||||
)
|
||||
),
|
||||
speciesTable_
|
||||
(
|
||||
@ -73,14 +80,15 @@ Foam::foamChemistryReader<ThermoType>::foamChemistryReader
|
||||
),
|
||||
reactions_
|
||||
(
|
||||
speciesTable_,
|
||||
speciesThermo_,
|
||||
dictionary
|
||||
(
|
||||
IFstream
|
||||
(
|
||||
fileName(thermoDict.lookup("foamChemistryFile")).expand()
|
||||
)()
|
||||
).lookup("reactions"),
|
||||
typename Reaction<ThermoType>::iNew(speciesTable_, speciesThermo_)
|
||||
)
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
@ -65,7 +65,7 @@ class foamChemistryReader
|
||||
speciesTable speciesTable_;
|
||||
|
||||
//- List of the reactions
|
||||
SLPtrList<Reaction<ThermoType> > reactions_;
|
||||
ReactionList<ThermoType> reactions_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
@ -117,9 +117,9 @@ public:
|
||||
}
|
||||
|
||||
//- List of the reactions
|
||||
const SLPtrList<Reaction<ThermoType> >& reactions() const
|
||||
const PtrList<Reaction<ThermoType> >& reactions() const
|
||||
{
|
||||
return reactions_;
|
||||
return reactions_.reactions();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -51,7 +51,7 @@ Foam::hCombustionThermo::hCombustionThermo(const fvMesh& mesh)
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionSet(0, 2, -2, 0, 0),
|
||||
dimEnergy/dimMass,
|
||||
this->hBoundaryTypes()
|
||||
)
|
||||
{}
|
||||
|
||||
@ -48,8 +48,8 @@ Foam::homogeneousMixture<ThermoType>::homogeneousMixture
|
||||
mesh
|
||||
),
|
||||
|
||||
reactants_(thermoDict.lookup("reactants")),
|
||||
products_(thermoDict.lookup("products")),
|
||||
reactants_(thermoDict.subDict("reactants")),
|
||||
products_(thermoDict.subDict("products")),
|
||||
mixture_("mixture", reactants_),
|
||||
b_(Y("b"))
|
||||
{}
|
||||
|
||||
@ -46,13 +46,9 @@ Foam::reactingMixture<ThermoType>::reactingMixture
|
||||
autoPtr<chemistryReader<ThermoType> >::operator()().speciesThermo(),
|
||||
mesh
|
||||
),
|
||||
PtrList<Reaction<ThermoType> >
|
||||
(
|
||||
PtrList<Reaction<ThermoType> >
|
||||
(
|
||||
autoPtr<chemistryReader<ThermoType> >::operator()().reactions()
|
||||
),
|
||||
this->species_
|
||||
)
|
||||
{
|
||||
autoPtr<chemistryReader<ThermoType> >::clear();
|
||||
|
||||
Reference in New Issue
Block a user