reactingMixture: Rationalised the reading of the species thermo and reactions

which are now read directly from the thermophysicalProperties dictionary for
consistency with non-reacting mixture thermodynamics.  The species thermo and
reactions lists can still be in separate files if convenient and included into
the thermophysicalProperties file using the standard dictionary #include.
This commit is contained in:
Henry Weller
2019-08-02 22:47:45 +01:00
parent 4baf73b54d
commit 5acfe8b20a
99 changed files with 1759 additions and 805 deletions

View File

@ -64,43 +64,47 @@ int main(int argc, char *argv[])
bool newFormat = args.optionFound("newFormat");
speciesTable species;
chemkinReader cr(species, args[1], args[3], args[2], newFormat);
const HashPtrTable<gasHThermoPhysics>& speciesThermo = cr.speciesThermo();
OFstream reactionsFile(args[4]);
writeEntry(reactionsFile, "elements", cr.elementNames());
reactionsFile << nl;
writeEntry(reactionsFile, "species", cr.species());
reactionsFile << nl;
cr.reactions().write(reactionsFile);
dictionary thermoDict;
thermoDict.add("species", cr.species());
// Add the species thermo formatted entries
{
OStringStream os;
speciesThermo.write(os);
dictionary speciesThermoDict(IStringStream(os.str())());
thermoDict.merge(speciesThermoDict);
}
// Temporary hack to splice the specie composition data into the thermo file
// pending complete integration into the thermodynamics structure
OStringStream os;
cr.speciesThermo().write(os);
dictionary thermoDict(IStringStream(os.str())());
wordList speciesList(thermoDict.toc());
// Add elements
forAll(speciesList, si)
forAllConstIter(HashPtrTable<gasHThermoPhysics>, speciesThermo, iter)
{
const word specieName(iter.key());
dictionary elementsDict("elements");
forAll(cr.specieComposition()[speciesList[si]], ei)
forAll(cr.specieComposition()[specieName], ei)
{
elementsDict.add
(
cr.specieComposition()[speciesList[si]][ei].name(),
cr.specieComposition()[speciesList[si]][ei].nAtoms()
cr.specieComposition()[specieName][ei].name(),
cr.specieComposition()[specieName][ei].nAtoms()
);
}
thermoDict.subDict(speciesList[si]).add("elements", elementsDict);
thermoDict.subDict(specieName).add("elements", elementsDict);
}
thermoDict.write(OFstream(args[5])(), false);
OFstream reactionsFile(args[4]);
cr.reactions().write(reactionsFile);
reactionsFile << nl;
writeEntry

View File

@ -72,7 +72,7 @@ controlMeshQualityCoeffs
{
// Name of the dictionary that has the mesh quality coefficients used
// by motionSmoother::checkMesh
#include "meshQualityDict";
#include "meshQualityDict"
// The amount that minimumEdgeLength will be reduced by for each
// edge if that edge's collapse generates a poor quality face

View File

@ -14,7 +14,7 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "$FOAM_CASE/constant/initialConditions";
#include "$FOAM_CASE/constant/initialConditions"
dimensions [0 0 0 1 0 0 0];

View File

@ -14,7 +14,7 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "$FOAM_CASE/constant/initialConditions";
#include "$FOAM_CASE/constant/initialConditions"
dimensions [1 -1 -2 0 0 0 0];

View File

@ -14,7 +14,7 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "$FOAM_CASE/constant/initialConditions";
#include "$FOAM_CASE/constant/initialConditions"
dimensions [ 1 -1 -2 0 0 0 0 ];

View File

@ -14,7 +14,7 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "$FOAM_CASE/constant/initialConditions";
#include "$FOAM_CASE/constant/initialConditions"
dimensions [ 0 0 0 1 0 0 0 ];

View File

@ -14,7 +14,7 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "$FOAM_CASE/constant/initialConditions";
#include "$FOAM_CASE/constant/initialConditions"
dimensions [1 -1 -2 0 0 0 0];

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -73,34 +73,6 @@ void Foam::multiComponentMixture<ThermoType>::correctMassFractions()
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ThermoType>
Foam::multiComponentMixture<ThermoType>::multiComponentMixture
(
const dictionary& thermoDict,
const wordList& specieNames,
const HashPtrTable<ThermoType>& thermoData,
const fvMesh& mesh,
const word& phaseName
)
:
basicSpecieMixture(thermoDict, specieNames, mesh, phaseName),
speciesData_(species_.size()),
mixture_("mixture", *thermoData[specieNames[0]]),
mixtureVol_("volMixture", *thermoData[specieNames[0]])
{
forAll(species_, i)
{
speciesData_.set
(
i,
new ThermoType(*thermoData[species_[i]])
);
}
correctMassFractions();
}
template<class ThermoType>
Foam::multiComponentMixture<ThermoType>::multiComponentMixture
(

View File

@ -86,17 +86,6 @@ public:
// Constructors
//- Construct from dictionary, specie names, thermo database,
// mesh and phase name
multiComponentMixture
(
const dictionary&,
const wordList& specieNames,
const HashPtrTable<ThermoType>& thermoData,
const fvMesh&,
const word&
);
//- Construct from dictionary, mesh and phase name
multiComponentMixture(const dictionary&, const fvMesh&, const word&);

View File

@ -1,185 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "foamChemistryReader.H"
#include "IFstream.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class ThermoType>
Foam::speciesTable& Foam::foamChemistryReader<ThermoType>::setSpecies
(
const dictionary& dict,
speciesTable& species
)
{
wordList s(dict.lookup("species"));
species.transfer(s);
return species;
}
template<class ThermoType>
void Foam::foamChemistryReader<ThermoType>::readSpeciesComposition()
{
if (!chemDict_.found("elements"))
{
Info<< " elements not defined in " << chemDict_.name() << endl;
return;
}
wordList e(chemDict_.lookup("elements"));
label currentElementIndex(0);
DynamicList<word> elementNames_;
HashTable<label> elementIndices_;
forAll(e, ei)
{
if (!elementIndices_.found(e[ei]))
{
elementIndices_.insert(e[ei], currentElementIndex++);
elementNames_.append(e[ei]);
}
else
{
IOWarningInFunction(chemDict_)
<< "element " << e[ei] << " already in table." << endl;
}
}
// Loop through all species in thermoDict to retrieve
// the species composition
forAll(speciesTable_, si)
{
if (thermoDict_.subDict(speciesTable_[si]).isDict("elements"))
{
dictionary currentElements
(
thermoDict_.subDict(speciesTable_[si]).subDict("elements")
);
wordList currentElementsName(currentElements.toc());
List<specieElement> currentComposition(currentElementsName.size());
forAll(currentElementsName, eni)
{
currentComposition[eni].name() = currentElementsName[eni];
currentComposition[eni].nAtoms() =
currentElements.lookupOrDefault
(
currentElementsName[eni],
0
);
}
// Add current specie composition to the hash table
speciesCompositionTable::iterator specieCompositionIter
(
speciesComposition_.find(speciesTable_[si])
);
if (specieCompositionIter != speciesComposition_.end())
{
speciesComposition_.erase(specieCompositionIter);
}
speciesComposition_.insert(speciesTable_[si], currentComposition);
}
else
{
FatalIOErrorInFunction(thermoDict_)
<< "Specie " << speciesTable_[si]
<< " does not contain element description."
<< exit(FatalIOError);
}
}
}
// * * * * * * * * * * * * * * * * Constructor * * * * * * * * * * * * * * * //
template<class ThermoType>
Foam::foamChemistryReader<ThermoType>::foamChemistryReader
(
const fileName& reactionsFileName,
speciesTable& species,
const fileName& thermoFileName
)
:
chemDict_
(
IFstream
(
fileName(reactionsFileName).expand()
)()
),
thermoDict_
(
IFstream
(
fileName(thermoFileName).expand()
)()
),
speciesTable_(setSpecies(chemDict_, species)),
speciesThermo_(thermoDict_),
reactions_(speciesTable_, speciesThermo_, chemDict_)
{
readSpeciesComposition();
}
template<class ThermoType>
Foam::foamChemistryReader<ThermoType>::foamChemistryReader
(
const dictionary& thermoDict,
speciesTable& species
)
:
chemDict_
(
IFstream
(
fileName(thermoDict.lookup("foamChemistryFile")).expand()
)()
),
thermoDict_
(
IFstream
(
fileName(thermoDict.lookup("foamChemistryThermoFile")).expand()
)()
),
speciesTable_(setSpecies(chemDict_, species)),
speciesThermo_(thermoDict_),
reactions_(speciesTable_, speciesThermo_, chemDict_)
{
readSpeciesComposition();
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -1,178 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::foamChemistryReader
Description
Chemistry reader for OpenFOAM format
SourceFiles
foamChemistryReader.C
\*---------------------------------------------------------------------------*/
#ifndef foamChemistryReader_H
#define foamChemistryReader_H
#include "specieElement.H"
#include "ReactionList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
typedef HashTable<List<specieElement>> speciesCompositionTable;
/*---------------------------------------------------------------------------*\
Class foamChemistry Declaration
\*---------------------------------------------------------------------------*/
template<class ThermoType>
class foamChemistryReader
{
//- Chemistry/reactions dictionary
dictionary chemDict_;
//- Thermo properties dictionary
dictionary thermoDict_;
//- List of elements
DynamicList<word> elementNames_;
//- Element indices
HashTable<label> elementIndices_;
//- Table of species
speciesTable& speciesTable_;
//- Table of species composition
speciesCompositionTable speciesComposition_;
//- Table of the thermodynamic data given in the foamChemistry file
HashPtrTable<ThermoType> speciesThermo_;
//- List of the reactions
ReactionList<ThermoType> reactions_;
// Private Member Functions
//- Set the species list
speciesTable& setSpecies(const dictionary& dict, speciesTable& species);
//- Read the species composition
void readSpeciesComposition();
public:
// Constructors
//- Construct from foamChemistry and thermodynamics file names
foamChemistryReader
(
const fileName& reactionsFileName,
speciesTable& species,
const fileName& thermoFileName
);
//- Construct by getting the foamChemistry and thermodynamics file names
// from dictionary
foamChemistryReader
(
const dictionary& thermoDict,
speciesTable& species
);
//- Disallow default bitwise copy construction
foamChemistryReader(const foamChemistryReader&) = delete;
//- Destructor
virtual ~foamChemistryReader()
{}
// Member Functions
//- List of elements
const wordList& elementNames() const
{
return elementNames_;
}
//- Element indices
const HashTable<label>& elementIndices() const
{
return elementIndices_;
}
//- Table of species
const speciesTable& species() const
{
return speciesTable_;
}
//- Table of species composition
const speciesCompositionTable& specieComposition() const
{
return speciesComposition_;
}
//- Table of the thermodynamic data given in the foamChemistry file
const HashPtrTable<ThermoType>& speciesThermo() const
{
return speciesThermo_;
}
//- List of the reactions
const ReactionList<ThermoType>& reactions() const
{
return reactions_;
}
// Member Operators
//- Disallow default bitwise assignment
void operator=(const foamChemistryReader&) = delete;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "foamChemistryReader.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -26,6 +26,63 @@ License
#include "reactingMixture.H"
#include "fvMesh.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class ThermoType>
Foam::speciesCompositionTable
Foam::reactingMixture<ThermoType>::readSpeciesComposition
(
const dictionary& thermoDict,
const speciesTable& species
) const
{
speciesCompositionTable speciesComposition_;
// Loop through all species in thermoDict to retrieve
// the species composition
forAll(species, si)
{
if (thermoDict.subDict(species[si]).isDict("elements"))
{
dictionary currentElements
(
thermoDict.subDict(species[si]).subDict("elements")
);
wordList currentElementsName(currentElements.toc());
List<specieElement> currentComposition(currentElementsName.size());
forAll(currentElementsName, eni)
{
currentComposition[eni].name() = currentElementsName[eni];
currentComposition[eni].nAtoms() =
currentElements.lookupOrDefault
(
currentElementsName[eni],
0
);
}
// Add current specie composition to the hash table
speciesCompositionTable::iterator specieCompositionIter
(
speciesComposition_.find(species[si])
);
if (specieCompositionIter != speciesComposition_.end())
{
speciesComposition_.erase(specieCompositionIter);
}
speciesComposition_.insert(species[si], currentComposition);
}
}
return speciesComposition_;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ThermoType>
@ -36,30 +93,35 @@ Foam::reactingMixture<ThermoType>::reactingMixture
const word& phaseName
)
:
speciesTable(),
autoPtr<foamChemistryReader<ThermoType>>
(
new foamChemistryReader<ThermoType>(thermoDict, *this)
),
multiComponentMixture<ThermoType>
(
thermoDict,
*this,
autoPtr<foamChemistryReader<ThermoType>>::operator()().speciesThermo(),
mesh,
phaseName
),
reactions_
(
autoPtr<foamChemistryReader<ThermoType>>::operator()().reactions()
),
speciesComposition_
(
autoPtr<foamChemistryReader<ThermoType>>::
operator()().specieComposition()
)
speciesComposition_(readSpeciesComposition(thermoDict, this->species()))
{
autoPtr<foamChemistryReader<ThermoType>>::clear();
HashPtrTable<ThermoType> thermoDatabase;
const PtrList<ThermoType>& speciesData = this->speciesData();
forAll(speciesData, i)
{
thermoDatabase.insert
(
speciesData[i].name(),
speciesData[i].clone().ptr()
);
}
reactions_ = PtrList<Reaction<ThermoType>>
(
ReactionList<ThermoType>
(
this->species(),
thermoDatabase,
thermoDict
)
);
}

View File

@ -35,15 +35,17 @@ SourceFiles
#ifndef reactingMixture_H
#define reactingMixture_H
#include "speciesTable.H"
#include "foamChemistryReader.H"
#include "multiComponentMixture.H"
#include "ReactionList.H"
#include "specieElement.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
typedef HashTable<List<specieElement>> speciesCompositionTable;
/*---------------------------------------------------------------------------*\
Class reactingMixture Declaration
\*---------------------------------------------------------------------------*/
@ -51,17 +53,21 @@ namespace Foam
template<class ThermoType>
class reactingMixture
:
public speciesTable,
public autoPtr<foamChemistryReader<ThermoType>>,
public multiComponentMixture<ThermoType>
{
// Private member data
PtrList<Reaction<ThermoType>> reactions_;
//- Table of species composition
speciesCompositionTable speciesComposition_;
PtrList<Reaction<ThermoType>> reactions_;
speciesCompositionTable readSpeciesComposition
(
const dictionary& thermoDict,
const speciesTable& speciesTable_
) const;
public:

View File

@ -96,6 +96,9 @@ public:
//- Construct from dictionary
constAnIsoSolidTransport(const dictionary&);
//- Construct and return a clone
inline autoPtr<constAnIsoSolidTransport> clone() const;
// Selector from dictionary
inline static autoPtr<constAnIsoSolidTransport> New
(

View File

@ -49,6 +49,17 @@ inline Foam::constAnIsoSolidTransport<Thermo>::constAnIsoSolidTransport
{}
template<class Thermo>
inline Foam::autoPtr<Foam::constAnIsoSolidTransport<Thermo>>
Foam::constAnIsoSolidTransport<Thermo>::clone() const
{
return autoPtr<constAnIsoSolidTransport<Thermo>>
(
new constAnIsoSolidTransport<Thermo>(*this)
);
}
template<class Thermo>
inline Foam::autoPtr<Foam::constAnIsoSolidTransport<Thermo>>
Foam::constAnIsoSolidTransport<Thermo>::New

View File

@ -97,6 +97,9 @@ public:
//- Construct from dictionary
constIsoSolidTransport(const dictionary& dict);
//- Construct and return a clone
inline autoPtr<constIsoSolidTransport> clone() const;
// Selector from dictionary
inline static autoPtr<constIsoSolidTransport> New
(

View File

@ -25,30 +25,41 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class thermo>
inline Foam::constIsoSolidTransport<thermo>::constIsoSolidTransport
template<class Thermo>
inline Foam::constIsoSolidTransport<Thermo>::constIsoSolidTransport
(
const thermo& t,
const Thermo& t,
const scalar kappa
)
:
thermo(t),
Thermo(t),
kappa_(kappa)
{}
template<class thermo>
inline Foam::constIsoSolidTransport<thermo>::constIsoSolidTransport
template<class Thermo>
inline Foam::constIsoSolidTransport<Thermo>::constIsoSolidTransport
(
const word& name,
const constIsoSolidTransport& ct
)
:
thermo(name, ct),
Thermo(name, ct),
kappa_(ct.kappa_)
{}
template<class Thermo>
inline Foam::autoPtr<Foam::constIsoSolidTransport<Thermo>>
Foam::constIsoSolidTransport<Thermo>::clone() const
{
return autoPtr<constIsoSolidTransport<Thermo>>
(
new constIsoSolidTransport<Thermo>(*this)
);
}
template<class Thermo>
inline Foam::autoPtr<Foam::constIsoSolidTransport<Thermo>>
Foam::constIsoSolidTransport<Thermo>::New
@ -62,25 +73,26 @@ Foam::constIsoSolidTransport<Thermo>::New
);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class thermo>
inline Foam::scalar Foam::constIsoSolidTransport<thermo>::
template<class Thermo>
inline Foam::scalar Foam::constIsoSolidTransport<Thermo>::
kappa(const scalar p, const scalar T) const
{
return kappa_;
}
template<class thermo>
inline Foam::vector Foam::constIsoSolidTransport<thermo>::
template<class Thermo>
inline Foam::vector Foam::constIsoSolidTransport<Thermo>::
Kappa(const scalar p, const scalar T) const
{
return vector(kappa_, kappa_, kappa_);
}
template<class thermo>
inline Foam::scalar Foam::constIsoSolidTransport<thermo>::
template<class Thermo>
inline Foam::scalar Foam::constIsoSolidTransport<Thermo>::
mu(const scalar p, const scalar T) const
{
NotImplemented;
@ -88,8 +100,8 @@ mu(const scalar p, const scalar T) const
}
template<class thermo>
inline Foam::scalar Foam::constIsoSolidTransport<thermo>::
template<class Thermo>
inline Foam::scalar Foam::constIsoSolidTransport<Thermo>::
alphah(const scalar p, const scalar T) const
{
return kappa_/this->Cp(p, T);
@ -97,14 +109,14 @@ alphah(const scalar p, const scalar T) const
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class thermo>
inline void Foam::constIsoSolidTransport<thermo>::operator+=
template<class Thermo>
inline void Foam::constIsoSolidTransport<Thermo>::operator+=
(
const constIsoSolidTransport<thermo>& ct
const constIsoSolidTransport<Thermo>& ct
)
{
scalar Y1 = this->Y();
thermo::operator+=(ct);
Thermo::operator+=(ct);
Y1 /= this->Y();
scalar Y2 = ct.Y()/this->Y();
@ -116,16 +128,16 @@ inline void Foam::constIsoSolidTransport<thermo>::operator+=
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
template<class thermo>
inline Foam::constIsoSolidTransport<thermo> Foam::operator*
template<class Thermo>
inline Foam::constIsoSolidTransport<Thermo> Foam::operator*
(
const scalar s,
const constIsoSolidTransport<thermo>& ct
const constIsoSolidTransport<Thermo>& ct
)
{
return constIsoSolidTransport<thermo>
return constIsoSolidTransport<Thermo>
(
s*static_cast<const thermo&>(ct),
s*static_cast<const Thermo&>(ct),
ct.kappa_
);
}

View File

@ -106,6 +106,9 @@ public:
//- Construct from dictionary
exponentialSolidTransport(const dictionary&);
//- Construct and return a clone
inline autoPtr<exponentialSolidTransport> clone() const;
// Selector from dictionary
inline static autoPtr<exponentialSolidTransport> New
(

View File

@ -55,6 +55,17 @@ inline Foam::exponentialSolidTransport<Thermo>::exponentialSolidTransport
{}
template<class Thermo>
inline Foam::autoPtr<Foam::exponentialSolidTransport<Thermo>>
Foam::exponentialSolidTransport<Thermo>::clone() const
{
return autoPtr<exponentialSolidTransport<Thermo>>
(
new exponentialSolidTransport<Thermo>(*this)
);
}
template<class Thermo>
inline Foam::autoPtr<Foam::exponentialSolidTransport<Thermo>>
Foam::exponentialSolidTransport<Thermo>::New

View File

@ -79,7 +79,7 @@ public:
const HashPtrTable<ThermoType>& thermoDatabase
);
//- Construct from dictionary
//- Construct from thermoDatabase and dictionary
ReactionList
(
const speciesTable& species,
@ -87,6 +87,14 @@ public:
const dictionary& dict
);
//- Construct from thermo list and dictionary
ReactionList
(
const speciesTable& species,
const PtrList<ThermoType>& thermoDatabase,
const dictionary& dict
);
//- Construct copy
ReactionList(const ReactionList<ThermoType>& reactions);

View File

@ -6,7 +6,7 @@ cd ${0%/*} || exit 1 # Run from this directory
cleanCase
rm -rf 0 chemFoam.out constant/reactions constant/thermo \
rm -rf 0 chemFoam.out constant/reactions constant/speciesThermo \
validation/OF_vs_CHEMKINII.eps validation/chemkinII
#------------------------------------------------------------------------------

View File

@ -9,7 +9,7 @@ application=$(getApplication)
runApplication chemkinToFoam \
chemkin/chem.inp chemkin/therm.dat chemkin/transportProperties \
constant/reactions constant/thermo
constant/reactions constant/speciesThermo
runApplication $application

File diff suppressed because it is too large Load Diff

View File

@ -26,7 +26,7 @@ thermoType
specie specie;
}
foamChemistryFile "$FOAM_CASE/constant/reactions";
foamChemistryThermoFile "$FOAM_CASE/constant/thermo";
#include "speciesThermo"
#include "reactions"
// ************************************************************************* //

View File

@ -6,7 +6,7 @@ cd ${0%/*} || exit 1 # Run from this directory
cleanCase
rm -rf 0 chemFoam.out constant/reactions constant/thermo \
rm -rf 0 chemFoam.out constant/reactions constant/speciesThermo \
validation/OF_vs_CHEMKINII.eps validation/chemkinII
#------------------------------------------------------------------------------

View File

@ -9,7 +9,7 @@ application=$(getApplication)
runApplication chemkinToFoam \
chemkin/chem.inp chemkin/therm.dat chemkin/transportProperties \
constant/reactions constant/thermo
constant/reactions constant/speciesThermo
runApplication $application

View File

@ -26,7 +26,7 @@ thermoType
specie specie;
}
foamChemistryFile "$FOAM_CASE/constant/reactions";
foamChemistryThermoFile "$FOAM_CASE/constant/thermo";
#include "speciesThermo"
#include "reactions"
// ************************************************************************* //

View File

@ -6,7 +6,7 @@ cd ${0%/*} || exit 1 # Run from this directory
cleanCase
rm -rf 0 chemFoam.out constant/reactions constant/thermo \
rm -rf 0 chemFoam.out constant/reactions constant/speciesThermo \
validation/OF_vs_CHEMKINII.eps validation/chemkinII
#------------------------------------------------------------------------------

View File

@ -9,7 +9,7 @@ application=$(getApplication)
runApplication chemkinToFoam \
chemkin/chem.inp chemkin/therm.dat chemkin/transportProperties \
constant/reactions constant/thermo
constant/reactions constant/speciesThermo
runApplication $application

View File

@ -26,7 +26,7 @@ thermoType
specie specie;
}
foamChemistryFile "$FOAM_CASE/constant/reactions";
foamChemistryThermoFile "$FOAM_CASE/constant/thermo";
#include "speciesThermo"
#include "reactions"
// ************************************************************************* //

View File

@ -6,7 +6,7 @@ cd ${0%/*} || exit 1 # Run from this directory
cleanCase
rm -rf 0 chemFoam.out constant/reactions constant/thermo \
rm -rf 0 chemFoam.out constant/reactions constant/speciesThermo \
validation/OF_vs_CHEMKINII.eps validation/chemkinII
#------------------------------------------------------------------------------

View File

@ -9,7 +9,7 @@ application=$(getApplication)
runApplication chemkinToFoam \
chemkin/chem.inp chemkin/therm.dat chemkin/transportProperties \
constant/reactions constant/thermo
constant/reactions constant/speciesThermo
runApplication $application

View File

@ -26,7 +26,7 @@ thermoType
specie specie;
}
foamChemistryFile "$FOAM_CASE/constant/reactions";
foamChemistryThermoFile "$FOAM_CASE/constant/thermo";
#include "speciesThermo"
#include "reactions"
// ************************************************************************* //

View File

@ -6,7 +6,7 @@ cd ${0%/*} || exit 1 # Run from this directory
cleanCase
rm -rf 0 chemFoam.out constant/reactions constant/thermo \
rm -rf 0 chemFoam.out constant/reactions constant/speciesThermo \
validation/OF_vs_CHEMKINII.eps validation/chemkinII
#------------------------------------------------------------------------------

View File

@ -9,7 +9,7 @@ application=$(getApplication)
runApplication chemkinToFoam \
chemkin/chem.inp chemkin/therm.dat chemkin/transportProperties \
constant/reactions constant/thermo
constant/reactions constant/speciesThermo
runApplication $application

View File

@ -26,7 +26,7 @@ thermoType
specie specie;
}
foamChemistryFile "$FOAM_CASE/constant/reactions";
foamChemistryThermoFile "$FOAM_CASE/constant/thermo";
#include "speciesThermo"
#include "reactions"
// ************************************************************************* //

View File

@ -28,10 +28,7 @@ thermoType
inertSpecie air;
foamChemistryFile "$FOAM_CASE/constant/include/reactions.air";
foamChemistryThermoFile "$FOAM_CASE/constant/include/thermo.air";
#include "include/thermo.air"
#include "include/reactions.air"
// ************************************************************************* //

View File

@ -25,12 +25,6 @@ thermoType
energy sensibleEnthalpy;
}
foamChemistryFile "$FOAM_CASE/constant/pyrolysisRegion/reactions";
foamChemistryThermoFile "$FOAM_CASE/constant/pyrolysisRegion/thermo.solid";
gasThermoType
{
transport sutherland;
@ -40,7 +34,6 @@ gasThermoType
energy sensibleEnthalpy;
}
gas
{
specie
@ -62,5 +55,7 @@ gas
}
}
#include "thermo.solid"
#include "reactions"
// ************************************************************************* //

View File

@ -31,9 +31,9 @@ inertSpecie N2;
fuel C3H8;
foamChemistryFile "$FOAM_CASE/constant/reactions";
#include "reactions"
foamChemistryThermoFile "$FOAM_CASE/constant/thermo.compressibleGas";
#include "thermo.compressibleGas"
liquids
{

View File

@ -25,12 +25,6 @@ thermoType
energy sensibleEnthalpy;
}
foamChemistryFile "$FOAM_CASE/constant/panelRegion/reactions";
foamChemistryThermoFile "$FOAM_CASE/constant/panelRegion/thermo.solid";
gasThermoType
{
transport sutherland;
@ -62,5 +56,7 @@ gas
}
}
#include "thermo.solid"
#include "reactions"
// ************************************************************************* //

View File

@ -31,9 +31,9 @@ inertSpecie N2;
fuel C3H8;
foamChemistryFile "$FOAM_CASE/constant/reactions";
#include "reactions"
foamChemistryThermoFile "$FOAM_CASE/constant/thermo.compressibleGas";
#include "thermo.compressibleGas"
// ************************************************************************* //

View File

@ -31,9 +31,9 @@ inertSpecie N2;
fuel CH4;
foamChemistryFile "$FOAM_CASE/constant/reactions";
#include "reactions"
foamChemistryThermoFile "$FOAM_CASE/constant/thermo.compressibleGas";
#include "thermo.compressibleGas"
// ************************************************************************* //

View File

@ -31,9 +31,9 @@ inertSpecie N2;
fuel CH4;
foamChemistryFile "$FOAM_CASE/constant/reactions";
#include "reactions"
foamChemistryThermoFile "$FOAM_CASE/constant/thermo.compressibleGas";
#include "thermo.compressibleGas"
// ************************************************************************* //

View File

@ -1,56 +1,3 @@
elements
5
(
O
H
C
N
Ar
)
;
species
36
(
H2
H
O
O2
OH
H2O
HO2
H2O2
C
CH
CH2
CH2(S)
CH3
CH4
CO
CO2
HCO
CH2O
CH2OH
CH3O
CH3OH
C2H
C2H2
C2H3
C2H4
C2H5
C2H6
HCCO
CH2CO
HCCOH
N2
AR
C3H7
C3H8
CH2CHO
CH3CHO
)
;
reactions
{
un-named-reaction-0
@ -3611,4 +3558,3 @@ reactions
Tlow 250;
Thigh 5000;

View File

@ -1,3 +1,5 @@
species 36 ( H2 H O O2 OH H2O HO2 H2O2 C CH CH2 CH2(S) CH3 CH4 CO CO2 HCO CH2O CH2OH CH3O CH3OH C2H C2H2 C2H3 C2H4 C2H5 C2H6 HCCO CH2CO HCCOH N2 AR C3H7 C3H8 CH2CHO CH3CHO );
OH
{
specie

View File

@ -29,7 +29,7 @@ thermoType
inertSpecie N2;
foamChemistryFile "$FOAM_CASE/constant/reactionsGRI";
foamChemistryThermoFile "$FOAM_CASE/constant/thermo.compressibleGasGRI";
#include "thermo.compressibleGasGRI"
#include "reactionsGRI"
// ************************************************************************* //

View File

@ -28,7 +28,7 @@ thermoType
inertSpecie N2;
foamChemistryFile "$FOAM_CASE/constant/reactionsGRI";
foamChemistryThermoFile "$FOAM_CASE/constant/thermo.compressibleGasGRI";
#include "thermo.compressibleGasGRI"
#include "reactionsGRI"
// ************************************************************************* //

View File

@ -29,9 +29,9 @@ thermoType
inertSpecie N2;
foamChemistryFile "$FOAM_CASE/constant/reactions";
#include "reactions"
foamChemistryThermoFile "$FOAM_CASE/constant/thermo.compressibleGas";
#include "thermo.compressibleGas"
// ************************************************************************* //

View File

@ -29,9 +29,9 @@ thermoType
inertSpecie N2;
foamChemistryFile "$FOAM_CASE/constant/reactions";
#include "reactions"
foamChemistryThermoFile "$FOAM_CASE/constant/thermo.compressibleGas";
#include "thermo.compressibleGas"
// ************************************************************************* //

View File

@ -29,9 +29,9 @@ thermoType
inertSpecie N2;
foamChemistryFile "$FOAM_CASE/constant/reactions";
#include "reactions"
foamChemistryThermoFile "$FOAM_CASE/constant/thermo.compressibleGas";
#include "thermo.compressibleGas"
// ************************************************************************* //

View File

@ -28,8 +28,8 @@ thermoType
inertSpecie N2;
foamChemistryFile "$FOAM_CASE/constant/reactionsGRI";
foamChemistryThermoFile "$FOAM_CASE/constant/thermo.compressibleGasGRI";
#include "reactionsGRI"
#include "thermo.compressibleGasGRI"
// ************************************************************************* //

View File

@ -28,8 +28,8 @@ thermoType
inertSpecie N2;
foamChemistryFile "$FOAM_CASE/constant/reactionsGRI";
foamChemistryThermoFile "$FOAM_CASE/constant/thermo.compressibleGasGRI";
#include "reactionsGRI"
#include "thermo.compressibleGasGRI"
// ************************************************************************* //

View File

@ -28,8 +28,8 @@ thermoType
inertSpecie N2;
foamChemistryFile "$FOAM_CASE/constant/reactionsGRI";
foamChemistryThermoFile "$FOAM_CASE/constant/thermo.compressibleGasGRI";
#include "reactionsGRI"
#include "thermo.compressibleGasGRI"
// ************************************************************************* //

View File

@ -14,7 +14,7 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "$FOAM_CASE/constant/initialConditions";
#include "$FOAM_CASE/constant/initialConditions"
dimensions [0 0 0 1 0 0 0];

View File

@ -14,7 +14,7 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "$FOAM_CASE/constant/initialConditions";
#include "$FOAM_CASE/constant/initialConditions"
dimensions [1 -1 -2 0 0 0 0];

View File

@ -14,7 +14,7 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "$FOAM_CASE/constant/initialConditions";
#include "$FOAM_CASE/constant/initialConditions"
dimensions [ 1 -1 -2 0 0 0 0 ];

View File

@ -14,7 +14,7 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "$FOAM_CASE/constant/initialConditions";
#include "$FOAM_CASE/constant/initialConditions"
dimensions [ 0 0 0 1 0 0 0 ];

View File

@ -14,7 +14,7 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "$FOAM_CASE/constant/initialConditions";
#include "$FOAM_CASE/constant/initialConditions"
dimensions [1 -1 -2 0 0 0 0];

View File

@ -28,10 +28,7 @@ thermoType
inertSpecie N2;
foamChemistryFile "$FOAM_CASE/constant/gas/reactions";
foamChemistryThermoFile "$FOAM_CASE/constant/gas/thermo.compressibleGas";
#include "thermo.compressibleGas"
#include "reactions"
// ************************************************************************* //

View File

@ -63,7 +63,7 @@ controlMeshQualityCoeffs
{
// Name of the dictionary that has the mesh quality coefficients used
// by motionSmoother::checkMesh
#include "meshQualityDict";
#include "meshQualityDict"
// The amount that minimumEdgeLength will be reduced by for each
// edge if that edge's collapse generates a poor quality face

View File

@ -63,7 +63,7 @@ controlMeshQualityCoeffs
{
// Name of the dictionary that has the mesh quality coefficients used
// by motionSmoother::checkMesh
#include "meshQualityDict";
#include "meshQualityDict"
// The amount that minimumEdgeLength will be reduced by for each
// edge if that edge's collapse generates a poor quality face

View File

@ -63,7 +63,7 @@ controlMeshQualityCoeffs
{
// Name of the dictionary that has the mesh quality coefficients used
// by motionSmoother::checkMesh
#include "meshQualityDict";
#include "meshQualityDict"
// The amount that minimumEdgeLength will be reduced by for each
// edge if that edge's collapse generates a poor quality face

View File

@ -1,19 +1,12 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object foam.dat;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
species
(
N2
O2
CH4
H2
CO2
H2O
);
CO2
{

View File

@ -27,9 +27,9 @@ thermoType
}
foamChemistryThermoFile "$FOAM_CASE/constant/foam.dat";
#include "speciesThermo"
foamChemistryFile "$FOAM_CASE/constant/foam.inp";
#include "reactions"
inertSpecie N2;

View File

@ -29,9 +29,9 @@ thermoType
inertSpecie N2;
foamChemistryFile "$FOAM_CASE/constant/reactions";
#include "reactions"
foamChemistryThermoFile "$FOAM_CASE/constant/thermo.compressibleGas";
#include "thermo.compressibleGas"
// ************************************************************************* //

View File

@ -1,10 +0,0 @@
species
(
O2
H2O
N2
)
;
reactions
{}

View File

@ -0,0 +1,2 @@
reactions
{}

View File

@ -1,19 +1,9 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object foam.dat;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
species
(
O2
H2O
N2
);
O2
{

View File

@ -27,9 +27,9 @@ thermoType
}
foamChemistryFile "$FOAM_CASE/constant/foam.inp";
#include "reactions"
foamChemistryThermoFile "$FOAM_CASE/constant/foam.dat";
#include "speciesThermo"
inertSpecie N2;

View File

@ -27,9 +27,9 @@ thermoType
}
foamChemistryFile "$FOAM_CASE/constant/reactions";
#include "reactions"
foamChemistryThermoFile "$FOAM_CASE/constant/thermo.incompressiblePoly";
#include "thermo.incompressiblePoly"
liquids
{

View File

@ -1,10 +0,0 @@
species
(
O2
H2O
N2
)
;
reactions
{}

View File

@ -0,0 +1,2 @@
reactions
{}

View File

@ -1,19 +1,9 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object foam.dat;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
species
(
O2
H2O
N2
);
O2
{

View File

@ -27,9 +27,9 @@ thermoType
}
foamChemistryFile "$FOAM_CASE/constant/foam.inp";
#include "reactions"
foamChemistryThermoFile "$FOAM_CASE/constant/foam.dat";
#include "speciesThermo"
inertSpecie N2;

View File

@ -27,9 +27,9 @@ thermoType
}
foamChemistryFile "$FOAM_CASE/constant/reactions";
#include "reactions"
foamChemistryThermoFile "$FOAM_CASE/constant/thermo.incompressiblePoly";
#include "thermo.incompressiblePoly"
inertSpecie air;

View File

@ -1,10 +0,0 @@
species
(
O2
H2O
N2
)
;
reactions
{}

View File

@ -0,0 +1,2 @@
reactions
{}

View File

@ -1,19 +1,9 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object foam.dat;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
species
(
O2
H2O
N2
);
O2
{

View File

@ -27,9 +27,9 @@ thermoType
}
foamChemistryFile "$FOAM_CASE/constant/foam.inp";
#include "reactions"
foamChemistryThermoFile "$FOAM_CASE/constant/foam.dat";
#include "speciesThermo"
inertSpecie N2;

View File

@ -1,10 +0,0 @@
species
(
O2
H2O
N2
)
;
reactions
{}

View File

@ -0,0 +1,2 @@
reactions
{}

View File

@ -1,19 +1,9 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object foam.dat;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
species
(
O2
H2O
N2
);
O2
{

View File

@ -27,9 +27,9 @@ thermoType
}
foamChemistryFile "$FOAM_CASE/constant/foam.inp";
#include "reactions"
foamChemistryThermoFile "$FOAM_CASE/constant/foam.dat";
#include "speciesThermo"
inertSpecie N2;

View File

@ -27,9 +27,9 @@ thermoType
}
foamChemistryFile "$FOAM_CASE/constant/reactions";
#include "reactions"
foamChemistryThermoFile "$FOAM_CASE/constant/thermo.incompressiblePoly";
#include "thermo.incompressiblePoly"
inertSpecie air;

View File

@ -27,9 +27,9 @@ thermoType
}
foamChemistryFile "$FOAM_CASE/constant/reactions";
#include "reactions"
foamChemistryThermoFile "$FOAM_CASE/constant/thermo.incompressiblePoly";
#include "thermo.incompressiblePoly"
inertSpecie air;

View File

@ -27,9 +27,9 @@ thermoType
}
foamChemistryFile "$FOAM_CASE/constant/reactions";
#include "reactions"
foamChemistryThermoFile "$FOAM_CASE/constant/thermo.incompressiblePoly";
#include "thermo.incompressiblePoly"
inertSpecie air;

View File

@ -6,6 +6,6 @@ cd ${0%/*} || exit 1 # Run from this directory
cleanCase
rm -rf constant/reactions constant/thermo
rm -rf constant/reactions constant/speciesThermo
#------------------------------------------------------------------------------

View File

@ -9,7 +9,7 @@ application=$(getApplication)
runApplication chemkinToFoam \
chemkin/chem.inp chemkin/therm.dat chemkin/transportProperties \
constant/reactions constant/thermo
constant/reactions constant/speciesThermo
runApplication blockMesh
runApplication $application

View File

@ -26,8 +26,7 @@ thermoType
specie specie;
}
foamChemistryFile "$FOAM_CASE/constant/reactions";
foamChemistryThermoFile "$FOAM_CASE/constant/thermo";
#include "speciesThermo"
newFormat yes;
@ -41,5 +40,6 @@ liquids
solids
{}
#include "reactions"
// ************************************************************************* //

View File

@ -59,7 +59,7 @@ controlMeshQualityCoeffs
{
// Name of the dictionary that has the mesh quality coefficients used
// by motionSmoother::checkMesh
#include "meshQualityDict";
#include "meshQualityDict"
// The amount that minimumEdgeLength will be reduced by for each
// edge if that edge's collapse generates a poor quality face

View File

@ -59,7 +59,7 @@ controlMeshQualityCoeffs
{
// Name of the dictionary that has the mesh quality coefficients used
// by motionSmoother::checkMesh
#include "meshQualityDict";
#include "meshQualityDict"
// The amount that minimumEdgeLength will be reduced by for each
// edge if that edge's collapse generates a poor quality face

View File

@ -63,7 +63,7 @@ controlMeshQualityCoeffs
{
// Name of the dictionary that has the mesh quality coefficients used
// by motionSmoother::checkMesh
#include "meshQualityDict";
#include "meshQualityDict"
// The amount that minimumEdgeLength will be reduced by for each
// edge if that edge's collapse generates a poor quality face

View File

@ -63,7 +63,7 @@ controlMeshQualityCoeffs
{
// Name of the dictionary that has the mesh quality coefficients used
// by motionSmoother::checkMesh
#include "meshQualityDict";
#include "meshQualityDict"
// The amount that minimumEdgeLength will be reduced by for each
// edge if that edge's collapse generates a poor quality face

View File

@ -60,7 +60,7 @@ controlMeshQualityCoeffs
{
// Name of the dictionary that has the mesh quality coefficients used
// by motionSmoother::checkMesh
#include "meshQualityDict";
#include "meshQualityDict"
// The amount that minimumEdgeLength will be reduced by for each
// edge if that edge's collapse generates a poor quality face

View File

@ -141,7 +141,7 @@ shortEdgeFilter
extrusion
{
extrude off;
#include "extrude2DMeshDict";
#include "extrude2DMeshDict"
}

View File

@ -159,7 +159,7 @@ extrusion
{
extrude off;
#include "extrude2DMeshDict";
#include "extrude2DMeshDict"
}

View File

@ -15,7 +15,7 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "$FOAM_CASE/constant/waveProperties";
#include "$FOAM_CASE/constant/waveProperties"
dimensions [0 1 -1 0 0 0 0];

View File

@ -28,10 +28,7 @@ thermoType
inertSpecie AIR;
foamChemistryFile "$FOAM_CASE/constant/reactions.gas";
foamChemistryThermoFile "$FOAM_CASE/constant/thermo.gas";
#include "thermo.gas"
#include "reactions.gas"
// ************************************************************************* //