combustionModels::zoneCombustion: Corrected base-class

to avoid duplicate instantiation of the thermodynamics package.

The 'zoneCombustion' model is now selected in constant/combustionProperties by
either

combustionModel zoneCombustion<psiCombustionModel>;

or

combustionModel zoneCombustion<rhoCombustionModel>;

as appropriate.

Resolves bug-report http://bugs.openfoam.org/view.php?id=2354
This commit is contained in:
Henry Weller
2016-11-28 11:59:17 +00:00
parent 8b219feda2
commit 414b128f7f
8 changed files with 37 additions and 13 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -65,7 +65,8 @@ makeCombustionTypesThermo
rhoCombustionModel
);
// Combustion models based on sensibleInternalEnergy
// Combustion models based on sensibleInternalEnergy
makeCombustionTypesThermo
(

View File

@ -73,8 +73,6 @@ protected:
public:
typedef psiCombustionModel CombustionModel;
// Constructors
//- Construct from components and thermo

View File

@ -68,6 +68,9 @@ class psiCombustionModel
public:
typedef psiReactionThermo ReactionThermo;
//- Runtime type information
TypeName("psiCombustionModel");

View File

@ -73,8 +73,6 @@ protected:
public:
typedef rhoCombustionModel CombustionModel;
// Constructors
//- Construct from components and thermo

View File

@ -69,6 +69,9 @@ class rhoCombustionModel
public:
typedef rhoReactionThermo ReactionThermo;
//- Runtime type information
TypeName("rhoCombustionModel");

View File

@ -112,7 +112,7 @@ Foam::combustionModels::zoneCombustion<Type>::zoneCombustion
Type(modelType, mesh, combustionProperties, phaseName),
combustionModelPtr_
(
Type::CombustionModel::New
Type::New
(
mesh,
"zoneCombustionProperties",
@ -132,6 +132,22 @@ Foam::combustionModels::zoneCombustion<Type>::~zoneCombustion()
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
template<class Type>
typename Type::ReactionThermo&
Foam::combustionModels::zoneCombustion<Type>::thermo()
{
return combustionModelPtr_->thermo();
}
template<class Type>
const typename Type::ReactionThermo&
Foam::combustionModels::zoneCombustion<Type>::thermo() const
{
return combustionModelPtr_->thermo();
}
template<class Type>
void Foam::combustionModels::zoneCombustion<Type>::correct()
{

View File

@ -57,7 +57,7 @@ class zoneCombustion
// Private data
//- The combustion model to be zone-filtered
autoPtr<typename Type::CombustionModel> combustionModelPtr_;
autoPtr<Type> combustionModelPtr_;
//- List of zone names in which the reactions are active
wordList zoneNames_;
@ -102,6 +102,12 @@ public:
// Member Functions
//- Return access to the thermo package
virtual typename Type::ReactionThermo& thermo();
//- Return const access to the thermo package
virtual const typename Type::ReactionThermo& thermo() const;
//- Correct combustion rate
virtual void correct();

View File

@ -25,14 +25,13 @@ License
#include "makeCombustionTypes.H"
#include "psiChemistryCombustion.H"
#include "rhoChemistryCombustion.H"
#include "psiCombustionModel.H"
#include "rhoCombustionModel.H"
#include "zoneCombustion.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makeCombustionTypes(zoneCombustion, psiChemistryCombustion, psiCombustionModel);
makeCombustionTypes(zoneCombustion, rhoChemistryCombustion, rhoCombustionModel);
makeCombustionTypes(zoneCombustion, psiCombustionModel, psiCombustionModel);
makeCombustionTypes(zoneCombustion, rhoCombustionModel, rhoCombustionModel);
// ************************************************************************* //