Skip to content
Snippets Groups Projects
Commit 9ed8a6bd authored by Henry Weller's avatar Henry Weller
Browse files

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
parent 8bfff274
Branches
Tags
No related merge requests found
......@@ -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
(
......
......@@ -73,8 +73,6 @@ protected:
public:
typedef psiCombustionModel CombustionModel;
// Constructors
//- Construct from components and thermo
......
......@@ -68,6 +68,9 @@ class psiCombustionModel
public:
typedef psiReactionThermo ReactionThermo;
//- Runtime type information
TypeName("psiCombustionModel");
......
......@@ -73,8 +73,6 @@ protected:
public:
typedef rhoCombustionModel CombustionModel;
// Constructors
//- Construct from components and thermo
......
......@@ -69,6 +69,9 @@ class rhoCombustionModel
public:
typedef rhoReactionThermo ReactionThermo;
//- Runtime type information
TypeName("rhoCombustionModel");
......
......@@ -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()
{
......
......@@ -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();
......
......@@ -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);
// ************************************************************************* //
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment