mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -36,7 +36,8 @@ namespace combustionModels
|
||||
template<class CombThermoType, class ThermoType>
|
||||
FSD<CombThermoType, ThermoType>::FSD
|
||||
(
|
||||
const word& modelType, const fvMesh& mesh
|
||||
const word& modelType,
|
||||
const fvMesh& mesh
|
||||
)
|
||||
:
|
||||
singleStepCombustion<CombThermoType, ThermoType>(modelType, mesh),
|
||||
@ -62,14 +63,8 @@ FSD<CombThermoType, ThermoType>::FSD
|
||||
this->mesh(),
|
||||
dimensionedScalar("zero", dimless, 0.0)
|
||||
),
|
||||
YFuelFuelStream_
|
||||
(
|
||||
dimensionedScalar("YFuelStream", dimless, 1.0)
|
||||
),
|
||||
YO2OxiStream_
|
||||
(
|
||||
dimensionedScalar("YOxiStream", dimless, 0.23)
|
||||
),
|
||||
YFuelFuelStream_(dimensionedScalar("YFuelStream", dimless, 1.0)),
|
||||
YO2OxiStream_(dimensionedScalar("YOxiStream", dimless, 0.23)),
|
||||
Cv_(readScalar(this->coeffs().lookup("Cv"))),
|
||||
C_(5.0),
|
||||
ftMin_(0.0),
|
||||
@ -91,15 +86,15 @@ FSD<CombThermoType, ThermoType>::~FSD()
|
||||
template<class CombThermoType, class ThermoType>
|
||||
void FSD<CombThermoType, ThermoType>::calculateSourceNorm()
|
||||
{
|
||||
this->singleMixture_.fresCorrect();
|
||||
this->singleMixturePtr_->fresCorrect();
|
||||
|
||||
const label fuelI = this->singleMixture_.fuelIndex();
|
||||
const label fuelI = this->singleMixturePtr_->fuelIndex();
|
||||
|
||||
const volScalarField& YFuel = this->thermo_->composition().Y()[fuelI];
|
||||
const volScalarField& YFuel = this->thermoPtr_->composition().Y()[fuelI];
|
||||
|
||||
const volScalarField& YO2 = this->thermo_->composition().Y("O2");
|
||||
const volScalarField& YO2 = this->thermoPtr_->composition().Y("O2");
|
||||
|
||||
const dimensionedScalar s = this->singleMixture_.s();
|
||||
const dimensionedScalar s = this->singleMixturePtr_->s();
|
||||
|
||||
ft_ =
|
||||
(s*YFuel - (YO2 - YO2OxiStream_))/(s*YFuelFuelStream_ + YO2OxiStream_);
|
||||
@ -195,7 +190,7 @@ void FSD<CombThermoType, ThermoType>::calculateSourceNorm()
|
||||
|
||||
volScalarField deltaF
|
||||
(
|
||||
lesModel.delta()/dimensionedScalar("flame",dimLength, 1.5e-3)
|
||||
lesModel.delta()/dimensionedScalar("flame", dimLength, 1.5e-3)
|
||||
);
|
||||
|
||||
// Linear correlation between delta and flame thickness
|
||||
@ -205,33 +200,33 @@ void FSD<CombThermoType, ThermoType>::calculateSourceNorm()
|
||||
|
||||
forAll(ft_, cellI)
|
||||
{
|
||||
if(ft_[cellI] > ftMin_ && ft_[cellI] < ftMax_)
|
||||
if (ft_[cellI] > ftMin_ && ft_[cellI] < ftMax_)
|
||||
{
|
||||
scalar ftCell = ft_[cellI];
|
||||
|
||||
if(ftVar[cellI] > ftVarMin_) //sub-grid beta pdf of ft_
|
||||
if (ftVar[cellI] > ftVarMin_) //sub-grid beta pdf of ft_
|
||||
{
|
||||
scalar ftVarc = ftVar[cellI];
|
||||
scalar a =
|
||||
max(ftCell*(ftCell*(1.0 - ftCell)/ftVarc - 1.0), 0.0);
|
||||
scalar b = max(a/ftCell - a, 0.0);
|
||||
|
||||
for(int i=1; i<ftDim_; i++)
|
||||
for (int i=1; i<ftDim_; i++)
|
||||
{
|
||||
scalar ft = i*deltaFt;
|
||||
pc[cellI] += pow(ft, a-1.0)*pow(1.0 - ft, b - 1.0)*deltaFt;
|
||||
}
|
||||
|
||||
for(int i=1; i<ftDim_; i++)
|
||||
for (int i=1; i<ftDim_; i++)
|
||||
{
|
||||
scalar ft = i*deltaFt;
|
||||
omegaFuelBar[cellI] +=
|
||||
omegaFuel[cellI]/omegaF[cellI]
|
||||
*exp
|
||||
(
|
||||
-sqr(ft - ftStoich)
|
||||
/(2.0*sqr(0.01*omegaF[cellI]))
|
||||
)
|
||||
(
|
||||
-sqr(ft - ftStoich)
|
||||
/(2.0*sqr(0.01*omegaF[cellI]))
|
||||
)
|
||||
*pow(ft, a - 1.0)
|
||||
*pow(1.0 - ft, b - 1.0)
|
||||
*deltaFt;
|
||||
@ -241,31 +236,25 @@ void FSD<CombThermoType, ThermoType>::calculateSourceNorm()
|
||||
else
|
||||
{
|
||||
omegaFuelBar[cellI] =
|
||||
(omegaFuel[cellI]/omegaF[cellI])
|
||||
*exp
|
||||
(
|
||||
-sqr(ftCell - ftStoich)/(2.0*sqr(0.01*omegaF[cellI]))
|
||||
);
|
||||
omegaFuel[cellI]/omegaF[cellI]
|
||||
*exp(-sqr(ftCell - ftStoich)/(2.0*sqr(0.01*omegaF[cellI])));
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
omegaFuelBar[cellI] = 0.0;
|
||||
omegaFuelBar[cellI] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// Combustion progress variable (c).
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// Combustion progress variable, c
|
||||
|
||||
List<label> productsIndex(2, label(-1));
|
||||
{
|
||||
label i = 0;
|
||||
forAll (this->singleMixture_.specieProd(), specieI)
|
||||
forAll(this->singleMixturePtr_->specieProd(), specieI)
|
||||
{
|
||||
if (this->singleMixture_.specieProd()[specieI] < 0)
|
||||
if (this->singleMixturePtr_->specieProd()[specieI] < 0)
|
||||
{
|
||||
productsIndex[i] = specieI;
|
||||
i++;
|
||||
@ -276,9 +265,9 @@ void FSD<CombThermoType, ThermoType>::calculateSourceNorm()
|
||||
|
||||
// Flamelet probability of the progress c based on IFC (reuse pc)
|
||||
scalar YprodTotal = 0;
|
||||
forAll (productsIndex, j)
|
||||
forAll(productsIndex, j)
|
||||
{
|
||||
YprodTotal += this->singleMixture_.Yprod0()[productsIndex[j]];
|
||||
YprodTotal += this->singleMixturePtr_->Yprod0()[productsIndex[j]];
|
||||
}
|
||||
|
||||
forAll(ft_, cellI)
|
||||
@ -312,10 +301,10 @@ void FSD<CombThermoType, ThermoType>::calculateSourceNorm()
|
||||
|
||||
volScalarField& products = tproducts();
|
||||
|
||||
forAll (productsIndex, j)
|
||||
forAll(productsIndex, j)
|
||||
{
|
||||
label specieI = productsIndex[j];
|
||||
const volScalarField& Yp = this->thermo_->composition().Y()[specieI];
|
||||
const volScalarField& Yp = this->thermoPtr_->composition().Y()[specieI];
|
||||
products += Yp;
|
||||
}
|
||||
|
||||
@ -326,7 +315,7 @@ void FSD<CombThermoType, ThermoType>::calculateSourceNorm()
|
||||
|
||||
pc = min(C_*c, scalar(1));
|
||||
|
||||
const volScalarField fres(this->singleMixture_.fres(fuelI));
|
||||
const volScalarField fres(this->singleMixturePtr_->fres(fuelI));
|
||||
|
||||
this->wFuel_ == mgft*pc*omegaFuelBar;
|
||||
}
|
||||
|
||||
@ -27,6 +27,9 @@ License
|
||||
|
||||
#include "thermoPhysicsTypes.H"
|
||||
#include "psiCombustionModel.H"
|
||||
#include "psiThermoCombustion.H"
|
||||
#include "rhoCombustionModel.H"
|
||||
#include "rhoThermoCombustion.H"
|
||||
#include "FSD.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -38,10 +41,34 @@ namespace combustionModels
|
||||
makeCombustionTypesThermo
|
||||
(
|
||||
FSD,
|
||||
psiCombustionModel,
|
||||
gasThermoPhysics
|
||||
psiThermoCombustion,
|
||||
gasThermoPhysics,
|
||||
psiCombustionModel
|
||||
);
|
||||
|
||||
makeCombustionTypesThermo
|
||||
(
|
||||
FSD,
|
||||
psiThermoCombustion,
|
||||
constGasThermoPhysics,
|
||||
psiCombustionModel
|
||||
);
|
||||
|
||||
makeCombustionTypesThermo
|
||||
(
|
||||
FSD,
|
||||
rhoThermoCombustion,
|
||||
gasThermoPhysics,
|
||||
rhoCombustionModel
|
||||
);
|
||||
|
||||
makeCombustionTypesThermo
|
||||
(
|
||||
FSD,
|
||||
rhoThermoCombustion,
|
||||
constGasThermoPhysics,
|
||||
rhoCombustionModel
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,19 +1,17 @@
|
||||
combustionModel/combustionModel.C
|
||||
|
||||
psiCombustionModel/psiCombustionModel.C
|
||||
psiCombustionModel/psiCombustionModelNew.C
|
||||
psiCombustionModel/psiCombustionModel/psiCombustionModel.C
|
||||
psiCombustionModel/psiCombustionModel/psiCombustionModelNew.C
|
||||
psiCombustionModel/psiThermoCombustion/psiThermoCombustion.C
|
||||
psiCombustionModel/psiChemistryCombustion/psiChemistryCombustion.C
|
||||
|
||||
rhoCombustionModel/rhoCombustionModel.C
|
||||
rhoCombustionModel/rhoCombustionModelNew.C
|
||||
rhoCombustionModel/rhoCombustionModel/rhoCombustionModel.C
|
||||
rhoCombustionModel/rhoCombustionModel/rhoCombustionModelNew.C
|
||||
rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.C
|
||||
rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.C
|
||||
|
||||
infinitelyFastChemistry/infinitelyFastChemistrys.C
|
||||
|
||||
psiChemistryCombustionModel/psiChemistryCombustionModel.C
|
||||
psiChemistryCombustionModel/psiChemistryCombustionModelNew.C
|
||||
|
||||
rhoChemistryCombustionModel/rhoChemistryCombustionModel.C
|
||||
rhoChemistryCombustionModel/rhoChemistryCombustionModelNew.C
|
||||
|
||||
PaSR/PaSRs.C
|
||||
|
||||
FSD/reactionRateFlameAreaModels/consumptionSpeed/consumptionSpeed.C
|
||||
|
||||
@ -25,29 +25,27 @@ License
|
||||
#include "PaSR.H"
|
||||
#include "fvmSup.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CombThermoType>
|
||||
Foam::combustionModels::PaSR<CombThermoType>::PaSR
|
||||
template<class Type>
|
||||
Foam::combustionModels::PaSR<Type>::PaSR
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh
|
||||
)
|
||||
:
|
||||
CombThermoType(modelType, mesh),
|
||||
Cmix_(this->coeffs().lookup("Cmix")),
|
||||
Type(modelType, mesh),
|
||||
Cmix_(readScalar(this->coeffs().lookup("Cmix"))),
|
||||
turbulentReaction_(this->coeffs().lookup("turbulentReaction")),
|
||||
kappa_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"kappa",
|
||||
"PaSR::kappa",
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE,
|
||||
false
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("kappa", dimless, 0.0)
|
||||
@ -63,24 +61,22 @@ Foam::combustionModels::PaSR<CombThermoType>::PaSR
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CombThermoType>
|
||||
Foam::combustionModels::PaSR<CombThermoType>::~PaSR()
|
||||
template<class Type>
|
||||
Foam::combustionModels::PaSR<Type>::~PaSR()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
template<class CombThermoType>
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::combustionModels::PaSR<CombThermoType>::tc() const
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::volScalarField> Foam::combustionModels::PaSR<Type>::tc() const
|
||||
{
|
||||
return this->pChemistry_->tc();
|
||||
return this->chemistryPtr_->tc();
|
||||
}
|
||||
|
||||
|
||||
template<class CombThermoType>
|
||||
void Foam::combustionModels::PaSR<CombThermoType>::correct()
|
||||
template<class Type>
|
||||
void Foam::combustionModels::PaSR<Type>::correct()
|
||||
{
|
||||
if (this->active())
|
||||
{
|
||||
@ -89,11 +85,11 @@ void Foam::combustionModels::PaSR<CombThermoType>::correct()
|
||||
|
||||
if (!useReactionRate_)
|
||||
{
|
||||
this->pChemistry_->solve(t - dt, dt);
|
||||
this->chemistryPtr_->solve(t - dt, dt);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->pChemistry_->calculate();
|
||||
this->chemistryPtr_->calculate();
|
||||
}
|
||||
|
||||
if (turbulentReaction_)
|
||||
@ -108,20 +104,12 @@ void Foam::combustionModels::PaSR<CombThermoType>::correct()
|
||||
tmp<volScalarField> ttc(tc());
|
||||
const volScalarField& tc = ttc();
|
||||
|
||||
const dimensionedScalar e0
|
||||
(
|
||||
"e0",
|
||||
sqr(dimLength)/pow3(dimTime),
|
||||
SMALL
|
||||
);
|
||||
|
||||
forAll(epsilon, i)
|
||||
{
|
||||
if (epsilon[i] > 0)
|
||||
{
|
||||
scalar tk =
|
||||
Cmix_.value()
|
||||
*Foam::sqrt(muEff[i]/rho[i]/(epsilon[i] + e0.value()));
|
||||
Cmix_*Foam::sqrt(muEff[i]/rho[i]/(epsilon[i] + SMALL));
|
||||
|
||||
// Chalmers PaSR model
|
||||
if (!useReactionRate_)
|
||||
@ -148,9 +136,9 @@ void Foam::combustionModels::PaSR<CombThermoType>::correct()
|
||||
}
|
||||
|
||||
|
||||
template<class CombThermoType>
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::fvScalarMatrix>
|
||||
Foam::combustionModels::PaSR<CombThermoType>::R(const volScalarField& Y) const
|
||||
Foam::combustionModels::PaSR<Type>::R(const volScalarField& Y) const
|
||||
{
|
||||
tmp<fvScalarMatrix> tSu(new fvScalarMatrix(Y, dimMass/dimTime));
|
||||
|
||||
@ -160,16 +148,16 @@ Foam::combustionModels::PaSR<CombThermoType>::R(const volScalarField& Y) const
|
||||
{
|
||||
const label specieI = this->thermo().composition().species()[Y.name()];
|
||||
|
||||
Su += kappa_*this->pChemistry_->RR(specieI);
|
||||
Su += kappa_*this->chemistryPtr_->RR(specieI);
|
||||
}
|
||||
|
||||
return tSu;
|
||||
}
|
||||
|
||||
|
||||
template<class CombThermoType>
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::combustionModels::PaSR<CombThermoType>::dQ() const
|
||||
Foam::combustionModels::PaSR<Type>::dQ() const
|
||||
{
|
||||
tmp<volScalarField> tdQ
|
||||
(
|
||||
@ -193,16 +181,16 @@ Foam::combustionModels::PaSR<CombThermoType>::dQ() const
|
||||
if (this->active())
|
||||
{
|
||||
volScalarField& dQ = tdQ();
|
||||
dQ = kappa_*this->pChemistry_->dQ();
|
||||
dQ = kappa_*this->chemistryPtr_->dQ();
|
||||
}
|
||||
|
||||
return tdQ;
|
||||
}
|
||||
|
||||
|
||||
template<class CombThermoType>
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::combustionModels::PaSR<CombThermoType>::Sh() const
|
||||
Foam::combustionModels::PaSR<Type>::Sh() const
|
||||
{
|
||||
tmp<volScalarField> tSh
|
||||
(
|
||||
@ -226,17 +214,17 @@ Foam::combustionModels::PaSR<CombThermoType>::Sh() const
|
||||
if (this->active())
|
||||
{
|
||||
scalarField& Sh = tSh();
|
||||
Sh = kappa_*this->pChemistry_->Sh();
|
||||
Sh = kappa_*this->chemistryPtr_->Sh();
|
||||
}
|
||||
|
||||
return tSh;
|
||||
}
|
||||
|
||||
|
||||
template<class CombThermoType>
|
||||
bool Foam::combustionModels::PaSR<CombThermoType>::read()
|
||||
template<class Type>
|
||||
bool Foam::combustionModels::PaSR<Type>::read()
|
||||
{
|
||||
if (CombThermoType::read())
|
||||
if (Type::read())
|
||||
{
|
||||
this->coeffs().lookup("Cmix") >> Cmix_;
|
||||
this->coeffs().lookup("turbulentReaction") >> turbulentReaction_;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -47,15 +47,15 @@ namespace combustionModels
|
||||
Class PaSR Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class CombThermoType>
|
||||
template<class Type>
|
||||
class PaSR
|
||||
:
|
||||
public CombThermoType
|
||||
public Type
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Mixing constant
|
||||
dimensionedScalar Cmix_;
|
||||
scalar Cmix_;
|
||||
|
||||
//- Turbulent reaction switch
|
||||
Switch turbulentReaction_;
|
||||
@ -88,11 +88,7 @@ public:
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
PaSR
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh
|
||||
);
|
||||
PaSR(const word& modelType, const fvMesh& mesh);
|
||||
|
||||
|
||||
//- Destructor
|
||||
@ -115,6 +111,7 @@ public:
|
||||
//- Return source for enthalpy equation [kg/m/s3]
|
||||
virtual tmp<volScalarField> Sh() const;
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
//- Update properties from given dictionary
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -25,8 +25,8 @@ License
|
||||
|
||||
#include "makeCombustionTypes.H"
|
||||
|
||||
#include "psiChemistryCombustionModel.H"
|
||||
#include "rhoChemistryCombustionModel.H"
|
||||
#include "psiChemistryCombustion.H"
|
||||
#include "rhoChemistryCombustion.H"
|
||||
#include "PaSR.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -35,19 +35,10 @@ namespace Foam
|
||||
{
|
||||
namespace combustionModels
|
||||
{
|
||||
makeCombustionTypes
|
||||
(
|
||||
PaSR,
|
||||
psiChemistryCombustionModel
|
||||
);
|
||||
|
||||
makeCombustionTypes
|
||||
(
|
||||
PaSR,
|
||||
rhoChemistryCombustionModel
|
||||
);
|
||||
makeCombustionTypes(PaSR, psiChemistryCombustion, psiCombustionModel);
|
||||
makeCombustionTypes(PaSR, rhoChemistryCombustion, rhoCombustionModel);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -30,45 +30,44 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define makeCombustionTypesThermo(CombModel, Comb, Thermo) \
|
||||
\
|
||||
typedef CombModel<Comb, Thermo> CombModel##Comb##Thermo; \
|
||||
#define makeCombustionTypesThermo(CombModel, CombType, Thermo, Table) \
|
||||
\
|
||||
typedef CombModel<CombType, Thermo> CombModel##CombType##Thermo; \
|
||||
\
|
||||
defineTemplateTypeNameAndDebugWithName \
|
||||
( \
|
||||
CombModel##Comb##Thermo, \
|
||||
#CombModel"<"#Comb","#Thermo">", \
|
||||
CombModel##CombType##Thermo, \
|
||||
#CombModel"<"#CombType","#Thermo">", \
|
||||
0 \
|
||||
); \
|
||||
\
|
||||
\
|
||||
addToRunTimeSelectionTable \
|
||||
( \
|
||||
Comb, \
|
||||
CombModel##Comb##Thermo, \
|
||||
Table, \
|
||||
CombModel##CombType##Thermo, \
|
||||
dictionary \
|
||||
);
|
||||
|
||||
#define makeCombustionTypes(CombModel, CombThermoType) \
|
||||
|
||||
#define makeCombustionTypes(CombModel, CombType, Table) \
|
||||
\
|
||||
typedef CombModel<CombThermoType> \
|
||||
CombModel##CombThermoType; \
|
||||
typedef CombModel<CombType> CombModel##CombType; \
|
||||
\
|
||||
defineTemplateTypeNameAndDebugWithName \
|
||||
( \
|
||||
CombModel##CombThermoType, \
|
||||
#CombModel"<"#CombThermoType">", \
|
||||
CombModel##CombType, \
|
||||
#CombModel"<"#CombType">", \
|
||||
0 \
|
||||
); \
|
||||
\
|
||||
addToRunTimeSelectionTable \
|
||||
( \
|
||||
CombThermoType, \
|
||||
CombModel##CombThermoType, \
|
||||
Table, \
|
||||
CombModel##CombType, \
|
||||
dictionary \
|
||||
);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -59,21 +59,22 @@ void infinitelyFastChemistry<CombThermoType, ThermoType>::correct()
|
||||
|
||||
if (this->active())
|
||||
{
|
||||
this->singleMixture_.fresCorrect();
|
||||
this->singleMixturePtr_->fresCorrect();
|
||||
|
||||
const label fuelI = this->singleMixture_.fuelIndex();
|
||||
const label fuelI = this->singleMixturePtr_->fuelIndex();
|
||||
|
||||
const volScalarField& YFuel = this->thermo_->composition().Y()[fuelI];
|
||||
const volScalarField& YFuel =
|
||||
this->thermoPtr_->composition().Y()[fuelI];
|
||||
|
||||
const dimensionedScalar s = this->singleMixture_.s();
|
||||
const dimensionedScalar s = this->singleMixturePtr_->s();
|
||||
|
||||
if (this->thermo_->composition().contains("O2"))
|
||||
if (this->thermoPtr_->composition().contains("O2"))
|
||||
{
|
||||
const volScalarField& YO2 = this->thermo_->composition().Y("O2");
|
||||
const volScalarField& YO2 = this->thermoPtr_->composition().Y("O2");
|
||||
|
||||
this->wFuel_ ==
|
||||
this->rho()/(this->mesh().time().deltaT()*C_)
|
||||
*min(YFuel, YO2/s.value());
|
||||
this->rho()/(this->mesh().time().deltaT()*C_)
|
||||
*min(YFuel, YO2/s.value());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -35,6 +35,7 @@ SourceFiles
|
||||
|
||||
#ifndef infinitelyFastChemistry_H
|
||||
#define infinitelyFastChemistry_H
|
||||
|
||||
#include "singleStepCombustion.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -51,7 +52,7 @@ namespace combustionModels
|
||||
template<class CombThermoType, class ThermoType>
|
||||
class infinitelyFastChemistry
|
||||
:
|
||||
public singleStepCombustion <CombThermoType, ThermoType>
|
||||
public singleStepCombustion<CombThermoType, ThermoType>
|
||||
{
|
||||
// Private data
|
||||
|
||||
@ -77,10 +78,7 @@ public:
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
infinitelyFastChemistry
|
||||
(
|
||||
const word& modelType, const fvMesh& mesh
|
||||
);
|
||||
infinitelyFastChemistry(const word& modelType, const fvMesh& mesh);
|
||||
|
||||
|
||||
//- Destructor
|
||||
@ -95,7 +93,7 @@ public:
|
||||
virtual void correct();
|
||||
|
||||
|
||||
// I-O
|
||||
// I-O
|
||||
|
||||
//- Update properties
|
||||
virtual bool read();
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -26,10 +26,9 @@ License
|
||||
#include "makeCombustionTypes.H"
|
||||
|
||||
#include "thermoPhysicsTypes.H"
|
||||
#include "psiCombustionModel.H"
|
||||
#include "rhoCombustionModel.H"
|
||||
#include "psiThermoCombustion.H"
|
||||
#include "rhoThermoCombustion.H"
|
||||
#include "infinitelyFastChemistry.H"
|
||||
#include "singleStepCombustion.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -37,26 +36,36 @@ namespace Foam
|
||||
{
|
||||
namespace combustionModels
|
||||
{
|
||||
|
||||
makeCombustionTypesThermo
|
||||
(
|
||||
infinitelyFastChemistry,
|
||||
psiCombustionModel,
|
||||
gasThermoPhysics
|
||||
psiThermoCombustion,
|
||||
gasThermoPhysics,
|
||||
psiCombustionModel
|
||||
);
|
||||
|
||||
makeCombustionTypesThermo
|
||||
(
|
||||
infinitelyFastChemistry,
|
||||
psiCombustionModel,
|
||||
constGasThermoPhysics
|
||||
psiThermoCombustion,
|
||||
constGasThermoPhysics,
|
||||
psiCombustionModel
|
||||
);
|
||||
|
||||
makeCombustionTypesThermo
|
||||
(
|
||||
infinitelyFastChemistry,
|
||||
rhoCombustionModel,
|
||||
gasThermoPhysics
|
||||
rhoThermoCombustion,
|
||||
gasThermoPhysics,
|
||||
rhoCombustionModel
|
||||
);
|
||||
|
||||
makeCombustionTypesThermo
|
||||
(
|
||||
infinitelyFastChemistry,
|
||||
rhoThermoCombustion,
|
||||
constGasThermoPhysics,
|
||||
rhoCombustionModel
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -27,6 +27,9 @@ License
|
||||
|
||||
#include "psiCombustionModel.H"
|
||||
#include "rhoCombustionModel.H"
|
||||
#include "psiThermoCombustion.H"
|
||||
#include "rhoThermoCombustion.H"
|
||||
|
||||
#include "noCombustion.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -38,12 +41,14 @@ namespace combustionModels
|
||||
makeCombustionTypes
|
||||
(
|
||||
noCombustion,
|
||||
psiThermoCombustion,
|
||||
psiCombustionModel
|
||||
);
|
||||
|
||||
makeCombustionTypes
|
||||
(
|
||||
noCombustion,
|
||||
rhoThermoCombustion,
|
||||
rhoCombustionModel
|
||||
);
|
||||
}
|
||||
|
||||
@ -1,78 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 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 "psiChemistryCombustionModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::autoPtr<Foam::combustionModels::psiChemistryCombustionModel>
|
||||
Foam::combustionModels::psiChemistryCombustionModel::New
|
||||
(
|
||||
const fvMesh& mesh
|
||||
)
|
||||
{
|
||||
const word combModelName
|
||||
(
|
||||
IOdictionary
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"combustionProperties",
|
||||
mesh.time().constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
)
|
||||
).lookup("combustionModel")
|
||||
);
|
||||
|
||||
Info<< "Selecting combustion model " << combModelName << endl;
|
||||
|
||||
dictionaryConstructorTable::iterator cstrIter =
|
||||
dictionaryConstructorTablePtr_->find(combModelName);
|
||||
|
||||
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"psiChemistryCombustionModel::New"
|
||||
) << "Unknown psiChemistryCombustionModel type "
|
||||
<< combModelName << endl << endl
|
||||
<< "Valid combustionModels are : " << endl
|
||||
<< dictionaryConstructorTablePtr_->toc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
const label tempOpen = combModelName.find('<');
|
||||
|
||||
const word className = combModelName(0, tempOpen);
|
||||
|
||||
return autoPtr<psiChemistryCombustionModel>
|
||||
(cstrIter()(className, mesh));
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -23,54 +23,48 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "psiChemistryCombustionModel.H"
|
||||
|
||||
/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace combustionModels
|
||||
{
|
||||
defineTypeNameAndDebug(psiChemistryCombustionModel, 0);
|
||||
defineRunTimeSelectionTable(psiChemistryCombustionModel, dictionary);
|
||||
|
||||
|
||||
#include "psiChemistryCombustion.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
psiChemistryCombustionModel::psiChemistryCombustionModel
|
||||
Foam::combustionModels::psiChemistryCombustion::psiChemistryCombustion
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh
|
||||
)
|
||||
:
|
||||
combustionModel(modelType, mesh),
|
||||
pChemistry_(psiChemistryModel::New(mesh))
|
||||
psiCombustionModel(modelType, mesh),
|
||||
chemistryPtr_(psiChemistryModel::New(mesh))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
psiChemistryCombustionModel::~psiChemistryCombustionModel()
|
||||
Foam::combustionModels::psiChemistryCombustion::~psiChemistryCombustion()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
bool psiChemistryCombustionModel::read()
|
||||
Foam::psiReactionThermo&
|
||||
Foam::combustionModels::psiChemistryCombustion::thermo()
|
||||
{
|
||||
if (combustionModel::read())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return chemistryPtr_->thermo();
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
} // End namespace combustionModels
|
||||
const Foam::psiReactionThermo&
|
||||
Foam::combustionModels::psiChemistryCombustion::thermo() const
|
||||
{
|
||||
return chemistryPtr_->thermo();
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::combustionModels::psiChemistryCombustion::rho() const
|
||||
{
|
||||
return chemistryPtr_->thermo().rho();
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -22,24 +22,21 @@ License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::psiChemistryCombustionModel
|
||||
Foam::psiChemistryCombustion
|
||||
|
||||
Description
|
||||
Combustion models for compressibility-based thermodynamics
|
||||
Compressibility-based chemistry model wrapper for combustion models
|
||||
|
||||
SourceFiles
|
||||
psiChemistryCombustionModelI.H
|
||||
psiChemistryCombustionModel.C
|
||||
psiChemistryCombustionModelNew.C
|
||||
psiChemistryCombustion.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef psiChemistryCombustionModel_H
|
||||
#define psiChemistryCombustionModel_H
|
||||
#ifndef psiChemistryCombustion_H
|
||||
#define psiChemistryCombustion_H
|
||||
|
||||
#include "combustionModel.H"
|
||||
#include "autoPtr.H"
|
||||
#include "runTimeSelectionTables.H"
|
||||
#include "psiCombustionModel.H"
|
||||
#include "psiChemistryModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -50,108 +47,59 @@ namespace combustionModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
class psiChemistryCombustionModel Declaration
|
||||
class psiChemistryCombustion Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class psiChemistryCombustionModel
|
||||
class psiChemistryCombustion
|
||||
:
|
||||
public combustionModel
|
||||
public psiCombustionModel
|
||||
{
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Construct as copy (not implemented)
|
||||
psiChemistryCombustionModel(const psiChemistryCombustionModel&);
|
||||
psiChemistryCombustion(const psiChemistryCombustion&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const psiChemistryCombustionModel&);
|
||||
void operator=(const psiChemistryCombustion&);
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Auto pointer to psiChemistry
|
||||
autoPtr<psiChemistryModel> pChemistry_;
|
||||
//- Pointer to chemistry model
|
||||
autoPtr<psiChemistryModel> chemistryPtr_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("psiChemistryCombustionModel");
|
||||
|
||||
|
||||
//- Declare run-time constructor selection tables
|
||||
declareRunTimeSelectionTable
|
||||
(
|
||||
autoPtr,
|
||||
psiChemistryCombustionModel,
|
||||
dictionary,
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh
|
||||
),
|
||||
(modelType, mesh)
|
||||
);
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
|
||||
//- Construct from components and thermo
|
||||
psiChemistryCombustionModel
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh
|
||||
);
|
||||
|
||||
|
||||
|
||||
//- Selector
|
||||
static autoPtr<psiChemistryCombustionModel> New
|
||||
(
|
||||
const fvMesh& mesh
|
||||
);
|
||||
psiChemistryCombustion(const word& modelType, const fvMesh& mesh);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~psiChemistryCombustionModel();
|
||||
virtual ~psiChemistryCombustion();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
|
||||
//- Return access to the thermo package
|
||||
inline psiChemistryModel& pChemistry();
|
||||
virtual psiReactionThermo& thermo();
|
||||
|
||||
//- Return const access to the thermo package
|
||||
inline const psiChemistryModel& pChemistry() const;
|
||||
virtual const psiReactionThermo& thermo() const;
|
||||
|
||||
//- Return const access to rho
|
||||
inline tmp<volScalarField> rho() const;
|
||||
|
||||
//- Return const access to rho
|
||||
inline const psiReactionThermo& thermo() const;
|
||||
|
||||
//- Return non const access to rho
|
||||
inline psiReactionThermo& thermo();
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
//- Update properties from given dictionary
|
||||
virtual bool read();
|
||||
//- Return const access to the density field
|
||||
virtual tmp<volScalarField> rho() const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
} // End namespace combustionModels
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "psiChemistryCombustionModelI.H"
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -38,24 +38,23 @@ namespace combustionModels
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
Foam::combustionModels::psiCombustionModel::psiCombustionModel
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh
|
||||
)
|
||||
:
|
||||
combustionModel(modelType, mesh),
|
||||
thermo_(psiReactionThermo::New(mesh))
|
||||
combustionModel(modelType, mesh)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::combustionModels::psiCombustionModel::~psiCombustionModel()
|
||||
{}
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::combustionModels::psiCombustionModel::read()
|
||||
{
|
||||
@ -69,10 +68,5 @@ bool Foam::combustionModels::psiCombustionModel::read()
|
||||
}
|
||||
}
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::combustionModels::psiCombustionModel::rho() const
|
||||
{
|
||||
return thermo_->rho();
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -67,17 +67,6 @@ class psiCombustionModel
|
||||
void operator=(const psiCombustionModel&);
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
|
||||
//- Thermo package
|
||||
autoPtr<psiReactionThermo> thermo_;
|
||||
|
||||
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
@ -100,21 +89,13 @@ public:
|
||||
|
||||
// Constructors
|
||||
|
||||
|
||||
//- Construct from components and thermo
|
||||
psiCombustionModel
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh
|
||||
);
|
||||
psiCombustionModel(const word& modelType, const fvMesh& mesh);
|
||||
|
||||
|
||||
|
||||
//- Selector
|
||||
static autoPtr<psiCombustionModel> New
|
||||
(
|
||||
const fvMesh& mesh
|
||||
);
|
||||
static autoPtr<psiCombustionModel> New(const fvMesh& mesh);
|
||||
|
||||
|
||||
//- Destructor
|
||||
@ -124,13 +105,14 @@ public:
|
||||
// Member Functions
|
||||
|
||||
//- Return access to the thermo package
|
||||
inline psiReactionThermo& thermo();
|
||||
virtual psiReactionThermo& thermo() = 0;
|
||||
|
||||
//- Return const access to the thermo package
|
||||
inline const psiReactionThermo& thermo() const;
|
||||
virtual const psiReactionThermo& thermo() const = 0;
|
||||
|
||||
//- Return tmp of rho
|
||||
virtual tmp<volScalarField> rho() const;
|
||||
virtual tmp<volScalarField> rho() const = 0;
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
@ -141,12 +123,8 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
} // End namespace combustionModels
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "psiCombustionModelI.H"
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -1,42 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 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/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
inline Foam::psiReactionThermo&
|
||||
Foam::combustionModels::psiCombustionModel::thermo()
|
||||
{
|
||||
return thermo_();
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::psiReactionThermo&
|
||||
Foam::combustionModels::psiCombustionModel::thermo() const
|
||||
{
|
||||
return thermo_();
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -23,54 +23,48 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "rhoChemistryCombustionModel.H"
|
||||
|
||||
/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace combustionModels
|
||||
{
|
||||
defineTypeNameAndDebug(rhoChemistryCombustionModel, 0);
|
||||
defineRunTimeSelectionTable(rhoChemistryCombustionModel, dictionary);
|
||||
|
||||
|
||||
#include "psiThermoCombustion.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
rhoChemistryCombustionModel::rhoChemistryCombustionModel
|
||||
Foam::combustionModels::psiThermoCombustion::psiThermoCombustion
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh
|
||||
)
|
||||
:
|
||||
combustionModel(modelType, mesh),
|
||||
pChemistry_(rhoChemistryModel::New(mesh))
|
||||
psiCombustionModel(modelType, mesh),
|
||||
thermoPtr_(psiReactionThermo::New(mesh))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
rhoChemistryCombustionModel::~rhoChemistryCombustionModel()
|
||||
Foam::combustionModels::psiThermoCombustion::~psiThermoCombustion()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
bool rhoChemistryCombustionModel::read()
|
||||
Foam::psiReactionThermo&
|
||||
Foam::combustionModels::psiThermoCombustion::thermo()
|
||||
{
|
||||
if (combustionModel::read())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return thermoPtr_();
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
} // End namespace combustionModels
|
||||
const Foam::psiReactionThermo&
|
||||
Foam::combustionModels::psiThermoCombustion::thermo() const
|
||||
{
|
||||
return thermoPtr_();
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::combustionModels::psiThermoCombustion::rho() const
|
||||
{
|
||||
return thermoPtr_->rho();
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,108 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012 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::psiThermoCombustion
|
||||
|
||||
Description
|
||||
Compressibility-based thermo model wrapper for combustion models
|
||||
|
||||
SourceFiles
|
||||
psiThermoCombustion.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef psiThermoCombustion_H
|
||||
#define psiThermoCombustion_H
|
||||
|
||||
#include "autoPtr.H"
|
||||
#include "psiCombustionModel.H"
|
||||
#include "psiReactionThermo.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace combustionModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
class psiThermoCombustion Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class psiThermoCombustion
|
||||
:
|
||||
public psiCombustionModel
|
||||
{
|
||||
// Private Member Functions
|
||||
|
||||
//- Construct as copy (not implemented)
|
||||
psiThermoCombustion(const psiThermoCombustion&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const psiThermoCombustion&);
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Pointer to chemistry model
|
||||
autoPtr<psiReactionThermo> thermoPtr_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components and thermo
|
||||
psiThermoCombustion(const word& modelType, const fvMesh& mesh);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~psiThermoCombustion();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return access to the thermo package
|
||||
virtual psiReactionThermo& thermo();
|
||||
|
||||
//- Return const access to the thermo package
|
||||
virtual const psiReactionThermo& thermo() const;
|
||||
|
||||
//- Return const access to the density field
|
||||
virtual tmp<volScalarField> rho() const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace combustionModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,78 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 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 "rhoChemistryCombustionModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::autoPtr<Foam::combustionModels::rhoChemistryCombustionModel>
|
||||
Foam::combustionModels::rhoChemistryCombustionModel::New
|
||||
(
|
||||
const fvMesh& mesh
|
||||
)
|
||||
{
|
||||
const word combModelName
|
||||
(
|
||||
IOdictionary
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"combustionProperties",
|
||||
mesh.time().constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
)
|
||||
).lookup("combustionModel")
|
||||
);
|
||||
|
||||
Info<< "Selecting combustion model " << combModelName << endl;
|
||||
|
||||
dictionaryConstructorTable::iterator cstrIter =
|
||||
dictionaryConstructorTablePtr_->find(combModelName);
|
||||
|
||||
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"rhoChemistryCombustionModel::New"
|
||||
) << "Unknown rhoChemistryCombustionModel type "
|
||||
<< combModelName << endl << endl
|
||||
<< "Valid combustionModels are : " << endl
|
||||
<< dictionaryConstructorTablePtr_->toc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
const label tempOpen = combModelName.find('<');
|
||||
|
||||
const word className = combModelName(0, tempOpen);
|
||||
|
||||
return autoPtr<rhoChemistryCombustionModel>
|
||||
(cstrIter()(className, mesh));
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -23,41 +23,47 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
#include "rhoChemistryCombustion.H"
|
||||
|
||||
inline Foam::rhoChemistryModel&
|
||||
Foam::combustionModels::rhoChemistryCombustionModel::pChemistry()
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::combustionModels::rhoChemistryCombustion::rhoChemistryCombustion
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh
|
||||
)
|
||||
:
|
||||
rhoCombustionModel(modelType, mesh),
|
||||
chemistryPtr_(rhoChemistryModel::New(mesh))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::combustionModels::rhoChemistryCombustion::~rhoChemistryCombustion()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::rhoReactionThermo&
|
||||
Foam::combustionModels::rhoChemistryCombustion::thermo()
|
||||
{
|
||||
return pChemistry_();
|
||||
return chemistryPtr_->thermo();
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::rhoChemistryModel&
|
||||
Foam::combustionModels::rhoChemistryCombustionModel::
|
||||
pChemistry() const
|
||||
const Foam::rhoReactionThermo&
|
||||
Foam::combustionModels::rhoChemistryCombustion::thermo() const
|
||||
{
|
||||
return pChemistry_();
|
||||
return chemistryPtr_->thermo();
|
||||
}
|
||||
|
||||
|
||||
inline Foam::tmp<Foam::volScalarField>
|
||||
Foam::combustionModels::rhoChemistryCombustionModel::rho() const
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::combustionModels::rhoChemistryCombustion::rho() const
|
||||
{
|
||||
return pChemistry_->thermo().rho();
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::rhoReactionThermo&
|
||||
Foam::combustionModels::rhoChemistryCombustionModel::thermo() const
|
||||
{
|
||||
return pChemistry_->thermo();
|
||||
}
|
||||
|
||||
|
||||
inline Foam::rhoReactionThermo&
|
||||
Foam::combustionModels::rhoChemistryCombustionModel::thermo()
|
||||
{
|
||||
return pChemistry_->thermo();
|
||||
return chemistryPtr_->thermo().rho();
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -22,24 +22,21 @@ License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::rhoChemistryCombustionModel
|
||||
Foam::rhoChemistryCombustion
|
||||
|
||||
Description
|
||||
Combustion models for compressibility-based thermodynamics
|
||||
Density-based chemistry model wrapper for combustion models
|
||||
|
||||
SourceFiles
|
||||
rhoChemistryCombustionModelI.H
|
||||
rhoChemistryCombustionModel.C
|
||||
rhoChemistryCombustionModelNew.C
|
||||
rhoChemistryCombustion.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef rhoChemistryCombustionModel_H
|
||||
#define rhoChemistryCombustionModel_H
|
||||
#ifndef rhoChemistryCombustion_H
|
||||
#define rhoChemistryCombustion_H
|
||||
|
||||
#include "combustionModel.H"
|
||||
#include "autoPtr.H"
|
||||
#include "runTimeSelectionTables.H"
|
||||
#include "rhoCombustionModel.H"
|
||||
#include "rhoChemistryModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -50,108 +47,59 @@ namespace combustionModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
class rhoChemistryCombustionModel Declaration
|
||||
class rhoChemistryCombustion Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class rhoChemistryCombustionModel
|
||||
class rhoChemistryCombustion
|
||||
:
|
||||
public combustionModel
|
||||
public rhoCombustionModel
|
||||
{
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Construct as copy (not implemented)
|
||||
rhoChemistryCombustionModel(const rhoChemistryCombustionModel&);
|
||||
rhoChemistryCombustion(const rhoChemistryCombustion&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const rhoChemistryCombustionModel&);
|
||||
void operator=(const rhoChemistryCombustion&);
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Auto pointer to psiChemistry
|
||||
autoPtr<rhoChemistryModel> pChemistry_;
|
||||
//- Pointer to chemistry model
|
||||
autoPtr<rhoChemistryModel> chemistryPtr_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("rhoChemistryCombustionModel");
|
||||
|
||||
|
||||
//- Declare run-time constructor selection tables
|
||||
declareRunTimeSelectionTable
|
||||
(
|
||||
autoPtr,
|
||||
rhoChemistryCombustionModel,
|
||||
dictionary,
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh
|
||||
),
|
||||
(modelType, mesh)
|
||||
);
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
|
||||
//- Construct from components and thermo
|
||||
rhoChemistryCombustionModel
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh
|
||||
);
|
||||
|
||||
|
||||
|
||||
//- Selector
|
||||
static autoPtr<rhoChemistryCombustionModel> New
|
||||
(
|
||||
const fvMesh& mesh
|
||||
);
|
||||
rhoChemistryCombustion(const word& modelType, const fvMesh& mesh);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~rhoChemistryCombustionModel();
|
||||
virtual ~rhoChemistryCombustion();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
|
||||
//- Return access to the thermo package
|
||||
inline rhoChemistryModel& pChemistry();
|
||||
virtual rhoReactionThermo& thermo();
|
||||
|
||||
//- Return const access to the thermo package
|
||||
inline const rhoChemistryModel& pChemistry() const;
|
||||
virtual const rhoReactionThermo& thermo() const;
|
||||
|
||||
//- Return const access to rho
|
||||
inline tmp<volScalarField> rho() const;
|
||||
|
||||
//- Return const access to rho
|
||||
inline const rhoReactionThermo& thermo() const;
|
||||
|
||||
//- Return non const access to rho
|
||||
inline rhoReactionThermo& thermo();
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
//- Update properties from given dictionary
|
||||
virtual bool read();
|
||||
//- Return const access to the density field
|
||||
virtual tmp<volScalarField> rho() const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
} // End namespace combustionModels
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "rhoChemistryCombustionModelI.H"
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -45,24 +45,18 @@ Foam::combustionModels::rhoCombustionModel::rhoCombustionModel
|
||||
const fvMesh& mesh
|
||||
)
|
||||
:
|
||||
combustionModel(modelType, mesh),
|
||||
thermo_(rhoReactionThermo::New(mesh))
|
||||
combustionModel(modelType, mesh)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::combustionModels::rhoCombustionModel::~rhoCombustionModel()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::combustionModels::rhoCombustionModel::rho() const
|
||||
{
|
||||
return thermo_->rho();
|
||||
}
|
||||
|
||||
|
||||
bool Foam::combustionModels::rhoCombustionModel::read()
|
||||
{
|
||||
if (combustionModel::read())
|
||||
@ -75,4 +69,5 @@ bool Foam::combustionModels::rhoCombustionModel::read()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -67,14 +67,6 @@ class rhoCombustionModel
|
||||
void operator=(const rhoCombustionModel&);
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Thermo package
|
||||
autoPtr<rhoReactionThermo> thermo_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
@ -99,19 +91,12 @@ public:
|
||||
|
||||
|
||||
//- Construct from components and thermo
|
||||
rhoCombustionModel
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh
|
||||
);
|
||||
rhoCombustionModel(const word& modelType, const fvMesh& mesh);
|
||||
|
||||
|
||||
|
||||
//- Selector
|
||||
static autoPtr<rhoCombustionModel> New
|
||||
(
|
||||
const fvMesh& mesh
|
||||
);
|
||||
static autoPtr<rhoCombustionModel> New(const fvMesh& mesh);
|
||||
|
||||
|
||||
//- Destructor
|
||||
@ -127,13 +112,14 @@ public:
|
||||
|
||||
|
||||
//- Return access to the thermo package
|
||||
inline rhoReactionThermo& thermo();
|
||||
virtual rhoReactionThermo& thermo() = 0;
|
||||
|
||||
//- Return const access to the thermo package
|
||||
inline const rhoReactionThermo& thermo() const;
|
||||
virtual const rhoReactionThermo& thermo() const = 0;
|
||||
|
||||
//- Return tmp of rho
|
||||
virtual tmp<volScalarField> rho() const;
|
||||
virtual tmp<volScalarField> rho() const = 0;
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
@ -144,12 +130,8 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
} // End namespace combustionModels
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "rhoCombustionModelI.H"
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -1,42 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 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/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
inline Foam::rhoReactionThermo&
|
||||
Foam::combustionModels::rhoCombustionModel::thermo()
|
||||
{
|
||||
return thermo_();
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::rhoReactionThermo&
|
||||
Foam::combustionModels::rhoCombustionModel::thermo() const
|
||||
{
|
||||
return thermo_();
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -23,41 +23,47 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
#include "rhoThermoCombustion.H"
|
||||
|
||||
inline Foam::psiChemistryModel&
|
||||
Foam::combustionModels::psiChemistryCombustionModel::pChemistry()
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::combustionModels::rhoThermoCombustion::rhoThermoCombustion
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh
|
||||
)
|
||||
:
|
||||
rhoCombustionModel(modelType, mesh),
|
||||
thermoPtr_(rhoReactionThermo::New(mesh))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::combustionModels::rhoThermoCombustion::~rhoThermoCombustion()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::rhoReactionThermo&
|
||||
Foam::combustionModels::rhoThermoCombustion::thermo()
|
||||
{
|
||||
return pChemistry_();
|
||||
return thermoPtr_();
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::psiChemistryModel&
|
||||
Foam::combustionModels::psiChemistryCombustionModel::
|
||||
pChemistry() const
|
||||
const Foam::rhoReactionThermo&
|
||||
Foam::combustionModels::rhoThermoCombustion::thermo() const
|
||||
{
|
||||
return pChemistry_();
|
||||
return thermoPtr_();
|
||||
}
|
||||
|
||||
|
||||
inline Foam::tmp<Foam::volScalarField>
|
||||
Foam::combustionModels::psiChemistryCombustionModel::rho() const
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::combustionModels::rhoThermoCombustion::rho() const
|
||||
{
|
||||
return pChemistry_->thermo().rho();
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::psiReactionThermo&
|
||||
Foam::combustionModels::psiChemistryCombustionModel::thermo() const
|
||||
{
|
||||
return pChemistry_->thermo();
|
||||
}
|
||||
|
||||
|
||||
inline Foam::psiReactionThermo&
|
||||
Foam::combustionModels::psiChemistryCombustionModel::thermo()
|
||||
{
|
||||
return pChemistry_->thermo();
|
||||
return thermoPtr_().rho();
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,108 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012 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::rhoThermoCombustion
|
||||
|
||||
Description
|
||||
Density-based thermo model wrapper for combustion models
|
||||
|
||||
SourceFiles
|
||||
rhoThermoCombustion.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef rhoThermoCombustion_H
|
||||
#define rhoThermoCombustion_H
|
||||
|
||||
#include "autoPtr.H"
|
||||
#include "rhoCombustionModel.H"
|
||||
#include "rhoChemistryModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace combustionModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
class rhoThermoCombustion Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class rhoThermoCombustion
|
||||
:
|
||||
public rhoCombustionModel
|
||||
{
|
||||
// Private Member Functions
|
||||
|
||||
//- Construct as copy (not implemented)
|
||||
rhoThermoCombustion(const rhoThermoCombustion&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const rhoThermoCombustion&);
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Pointer to thermo model
|
||||
autoPtr<rhoReactionThermo> thermoPtr_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components and thermo
|
||||
rhoThermoCombustion(const word& modelType, const fvMesh& mesh);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~rhoThermoCombustion();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return access to the thermo package
|
||||
virtual rhoReactionThermo& thermo();
|
||||
|
||||
//- Return const access to the thermo package
|
||||
virtual const rhoReactionThermo& thermo() const;
|
||||
|
||||
//- Return const access to the density field
|
||||
virtual tmp<volScalarField> rho() const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace combustionModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -33,17 +33,14 @@ namespace combustionModels
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CombThermoType, class ThermoType>
|
||||
singleStepCombustion<CombThermoType, ThermoType>
|
||||
::singleStepCombustion
|
||||
singleStepCombustion<CombThermoType, ThermoType>::singleStepCombustion
|
||||
(
|
||||
const word& modelType, const fvMesh& mesh
|
||||
const word& modelType,
|
||||
const fvMesh& mesh
|
||||
)
|
||||
:
|
||||
CombThermoType(modelType, mesh),
|
||||
singleMixture_
|
||||
(
|
||||
dynamic_cast<singleStepReactingMixture<ThermoType>&>(this->thermo())
|
||||
),
|
||||
singleMixturePtr_(NULL),
|
||||
wFuel_
|
||||
(
|
||||
IOobject
|
||||
@ -55,22 +52,45 @@ singleStepCombustion<CombThermoType, ThermoType>
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
this->mesh(),
|
||||
dimensionedScalar("zero", dimMass/pow3(dimLength)/dimTime, 0.0)
|
||||
dimensionedScalar("zero", dimMass/dimVolume/dimTime, 0.0)
|
||||
)
|
||||
{}
|
||||
{
|
||||
if (isA<singleStepReactingMixture<ThermoType> >(this->thermo()))
|
||||
{
|
||||
singleMixturePtr_ =
|
||||
&dynamic_cast<singleStepReactingMixture<ThermoType>&>
|
||||
(
|
||||
this->thermo()
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"singleStepCombustion<CombThermoType, ThermoType>::"
|
||||
"singleStepCombustion"
|
||||
"("
|
||||
"const word&, "
|
||||
"const fvMesh&"
|
||||
")"
|
||||
)
|
||||
<< "Inconsistent thermo package for " << this->type() << " model:\n"
|
||||
<< " " << this->thermo().type() << nl << nl
|
||||
<< "Please select a thermo package based on "
|
||||
<< "singleStepReactingMixture" << exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CombThermoType, class ThermoType>
|
||||
singleStepCombustion<CombThermoType, ThermoType>
|
||||
::~singleStepCombustion()
|
||||
singleStepCombustion<CombThermoType, ThermoType>::~singleStepCombustion()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
template<class CombThermoType, class ThermoType>
|
||||
Foam::tmp<Foam::fvScalarMatrix>
|
||||
singleStepCombustion<CombThermoType, ThermoType>::R
|
||||
@ -78,11 +98,11 @@ singleStepCombustion<CombThermoType, ThermoType>::R
|
||||
const volScalarField& Y
|
||||
) const
|
||||
{
|
||||
const label specieI = this->thermo_->composition().species()[Y.name()];
|
||||
const label specieI = this->thermoPtr_->composition().species()[Y.name()];
|
||||
|
||||
const volScalarField wSpecie
|
||||
(
|
||||
wFuel_*singleMixture_.specieStoichCoeffs()[specieI]
|
||||
wFuel_*singleMixturePtr_->specieStoichCoeffs()[specieI]
|
||||
);
|
||||
|
||||
return wSpecie + fvm::Sp(0.0*wSpecie, Y);
|
||||
@ -93,10 +113,10 @@ template<class CombThermoType, class ThermoType>
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
singleStepCombustion< CombThermoType, ThermoType>::Sh() const
|
||||
{
|
||||
const label fuelI = singleMixture_.fuelIndex();
|
||||
const volScalarField& YFuel = this->thermo_->composition().Y(fuelI);
|
||||
const label fuelI = singleMixturePtr_->fuelIndex();
|
||||
const volScalarField& YFuel = this->thermoPtr_->composition().Y(fuelI);
|
||||
|
||||
return -singleMixture_.qFuel()*(R(YFuel) & YFuel);
|
||||
return -singleMixturePtr_->qFuel()*(R(YFuel) & YFuel);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -44,7 +44,7 @@ namespace combustionModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class singleStepCombustion Declaration
|
||||
Class singleStepCombustion Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class CombThermoType, class ThermoType>
|
||||
@ -52,20 +52,6 @@ class singleStepCombustion
|
||||
:
|
||||
public CombThermoType
|
||||
{
|
||||
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Reference to singleStepReactingMixture mixture
|
||||
singleStepReactingMixture<ThermoType>& singleMixture_;
|
||||
|
||||
//- Fuel consumption rate
|
||||
volScalarField wFuel_;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow copy construct
|
||||
@ -75,16 +61,23 @@ private:
|
||||
void operator=(const singleStepCombustion&);
|
||||
|
||||
|
||||
public:
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Pointer to singleStepReactingMixture mixture
|
||||
singleStepReactingMixture<ThermoType>* singleMixturePtr_;
|
||||
|
||||
//- Fuel consumption rate
|
||||
volScalarField wFuel_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
singleStepCombustion
|
||||
(
|
||||
const word& modelType, const fvMesh& mesh
|
||||
);
|
||||
singleStepCombustion(const word& modelType, const fvMesh& mesh);
|
||||
|
||||
|
||||
//- Destructor
|
||||
@ -95,7 +88,6 @@ public:
|
||||
|
||||
// Evolution
|
||||
|
||||
|
||||
//- Fuel consumption rate matrix
|
||||
virtual tmp<fvScalarMatrix> R(const volScalarField& Y) const;
|
||||
|
||||
@ -106,7 +98,7 @@ public:
|
||||
virtual tmp<volScalarField> Sh() const;
|
||||
|
||||
|
||||
// I-O
|
||||
// I-O
|
||||
|
||||
//- Update properties from given dictionary
|
||||
virtual bool read();
|
||||
@ -120,7 +112,6 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "singleStepCombustion.C"
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user