mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
INT: Additional integration updates/clean-up
This commit is contained in:
@ -35,15 +35,12 @@ Foam::autoPtr<CombustionModel> Foam::combustionModel::New
|
||||
{
|
||||
IOobject combIO
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
thermo.phasePropertyName(combustionProperties),
|
||||
thermo.db().time().constant(),
|
||||
thermo.db(),
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
)
|
||||
thermo.phasePropertyName(combustionProperties),
|
||||
thermo.db().time().constant(),
|
||||
thermo.db(),
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
);
|
||||
|
||||
word combModelName("none");
|
||||
@ -83,13 +80,11 @@ Foam::autoPtr<CombustionModel> Foam::combustionModel::New
|
||||
combModelName + '<' + CombustionModel::reactionThermo::typeName + ','
|
||||
+ thermo.thermoName() + '>';
|
||||
|
||||
typename cstrTableType::iterator compCstrIter =
|
||||
cstrTable->find(compCombModelName);
|
||||
auto compCstrIter = cstrTable->cfind(compCombModelName);
|
||||
|
||||
typename cstrTableType::iterator thermoCstrIter =
|
||||
cstrTable->find(thermoCombModelName);
|
||||
auto thermoCstrIter = cstrTable->cfind(thermoCombModelName);
|
||||
|
||||
if (compCstrIter == cstrTable->end() && thermoCstrIter == cstrTable->end())
|
||||
if (!compCstrIter.found() && !thermoCstrIter.found())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown " << combustionModel::typeName << " type "
|
||||
@ -170,7 +165,7 @@ Foam::autoPtr<CombustionModel> Foam::combustionModel::New
|
||||
|
||||
return autoPtr<CombustionModel>
|
||||
(
|
||||
thermoCstrIter != cstrTable->end()
|
||||
thermoCstrIter.found()
|
||||
? thermoCstrIter()(combModelName, thermo, turb, combustionProperties)
|
||||
: compCstrIter()(combModelName, thermo, turb, combustionProperties)
|
||||
);
|
||||
|
||||
@ -31,9 +31,9 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * //
|
||||
|
||||
template<class CombThermoType, class ThermoType>
|
||||
template<class ReactionThermo, class ThermoType>
|
||||
void Foam::combustionModels::
|
||||
diffusionMulticomponent<CombThermoType, ThermoType>::init()
|
||||
diffusionMulticomponent<ReactionThermo, ThermoType>::init()
|
||||
{
|
||||
// Load default values
|
||||
this->coeffs().readIfPresent("Ci", Ci_);
|
||||
@ -121,25 +121,31 @@ diffusionMulticomponent<CombThermoType, ThermoType>::init()
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CombThermoType, class ThermoType>
|
||||
Foam::combustionModels::diffusionMulticomponent<CombThermoType, ThermoType>::
|
||||
template<class ReactionThermo, class ThermoType>
|
||||
Foam::combustionModels::diffusionMulticomponent<ReactionThermo, ThermoType>::
|
||||
diffusionMulticomponent
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh,
|
||||
const word& combustionProperties,
|
||||
const word& phaseName
|
||||
ReactionThermo& thermo,
|
||||
const compressibleTurbulenceModel& turb,
|
||||
const word& combustionProperties
|
||||
)
|
||||
:
|
||||
CombThermoType(modelType, mesh, combustionProperties, phaseName),
|
||||
ChemistryCombustion<ReactionThermo>
|
||||
(
|
||||
modelType,
|
||||
thermo,
|
||||
turb,
|
||||
combustionProperties
|
||||
),
|
||||
reactions_
|
||||
(
|
||||
dynamic_cast<const reactingMixture<ThermoType>&>(this->thermo())
|
||||
dynamic_cast<const reactingMixture<ThermoType>&>(thermo)
|
||||
),
|
||||
specieThermo_
|
||||
(
|
||||
dynamic_cast<const reactingMixture<ThermoType>&>
|
||||
(this->thermo()).speciesData()
|
||||
dynamic_cast<const reactingMixture<ThermoType>&>(thermo).
|
||||
speciesData()
|
||||
),
|
||||
RijPtr_(reactions_.size()),
|
||||
Ci_(reactions_.size(), 1.0),
|
||||
@ -162,17 +168,17 @@ diffusionMulticomponent
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CombThermoType, class ThermoType>
|
||||
template<class ReactionThermo, class ThermoType>
|
||||
Foam::tmp<Foam::volScalarField> Foam::combustionModels::
|
||||
diffusionMulticomponent<CombThermoType, ThermoType>::tc() const
|
||||
diffusionMulticomponent<ReactionThermo, ThermoType>::tc() const
|
||||
{
|
||||
return this->chemistryPtr_->tc();
|
||||
}
|
||||
|
||||
|
||||
template<class CombThermoType, class ThermoType>
|
||||
template<class ReactionThermo, class ThermoType>
|
||||
void Foam::combustionModels::
|
||||
diffusionMulticomponent<CombThermoType, ThermoType>::correct()
|
||||
diffusionMulticomponent<ReactionThermo, ThermoType>::correct()
|
||||
{
|
||||
if (this->active())
|
||||
{
|
||||
@ -359,9 +365,9 @@ diffusionMulticomponent<CombThermoType, ThermoType>::correct()
|
||||
}
|
||||
|
||||
|
||||
template<class CombThermoType, class ThermoType>
|
||||
template<class ReactionThermo, class ThermoType>
|
||||
Foam::tmp<Foam::fvScalarMatrix>
|
||||
Foam::combustionModels::diffusionMulticomponent<CombThermoType, ThermoType>::R
|
||||
Foam::combustionModels::diffusionMulticomponent<ReactionThermo, ThermoType>::R
|
||||
(
|
||||
volScalarField& Y
|
||||
) const
|
||||
@ -382,10 +388,10 @@ Foam::combustionModels::diffusionMulticomponent<CombThermoType, ThermoType>::R
|
||||
}
|
||||
|
||||
|
||||
template<class CombThermoType, class ThermoType>
|
||||
template<class ReactionThermo, class ThermoType>
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::combustionModels::diffusionMulticomponent<CombThermoType, ThermoType>::
|
||||
Qdot() const
|
||||
Foam::combustionModels::
|
||||
diffusionMulticomponent<ReactionThermo, ThermoType>::Qdot() const
|
||||
{
|
||||
tmp<volScalarField> tQdot
|
||||
(
|
||||
@ -416,11 +422,11 @@ Qdot() const
|
||||
}
|
||||
|
||||
|
||||
template<class CombThermoType, class ThermoType>
|
||||
template<class ReactionThermo, class ThermoType>
|
||||
bool Foam::combustionModels::
|
||||
diffusionMulticomponent<CombThermoType, ThermoType>::read()
|
||||
diffusionMulticomponent<ReactionThermo, ThermoType>::read()
|
||||
{
|
||||
if (CombThermoType::read())
|
||||
if (ChemistryCombustion<ReactionThermo>::read())
|
||||
{
|
||||
this->coeffs().readIfPresent("Ci", Ci_);
|
||||
this->coeffs().readIfPresent("sigma", sigma_);
|
||||
|
||||
@ -72,6 +72,7 @@ SourceFiles
|
||||
#ifndef diffusionMulticomponent_H
|
||||
#define diffusionMulticomponent_H
|
||||
|
||||
#include "ChemistryCombustion.H"
|
||||
#include "scalarList.H"
|
||||
#include "tmp.H"
|
||||
#include "Reaction.H"
|
||||
@ -87,10 +88,10 @@ namespace combustionModels
|
||||
Class diffusionMulticomponent Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class CombThermoType, class ThermoType>
|
||||
template<class ReactionThermo, class ThermoType>
|
||||
class diffusionMulticomponent
|
||||
:
|
||||
public CombThermoType
|
||||
public ChemistryCombustion<ReactionThermo>
|
||||
{
|
||||
// Private data
|
||||
|
||||
@ -170,9 +171,9 @@ public:
|
||||
diffusionMulticomponent
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh,
|
||||
const word& combustionProperties,
|
||||
const word& phaseName
|
||||
ReactionThermo& thermo,
|
||||
const compressibleTurbulenceModel& turb,
|
||||
const word& combustionProperties
|
||||
);
|
||||
|
||||
|
||||
|
||||
@ -25,37 +25,45 @@ License
|
||||
|
||||
#include "makeCombustionTypes.H"
|
||||
|
||||
#include "psiReactionThermo.H"
|
||||
#include "rhoReactionThermo.H"
|
||||
#include "thermoPhysicsTypes.H"
|
||||
#include "psiChemistryCombustion.H"
|
||||
#include "rhoChemistryCombustion.H"
|
||||
|
||||
#include "diffusionMulticomponent.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// Combustion models based on sensibleEnthalpy
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
makeCombustionTypesThermo
|
||||
(
|
||||
diffusionMulticomponent,
|
||||
psiChemistryCombustion,
|
||||
gasHThermoPhysics,
|
||||
psiCombustionModel
|
||||
psiReactionThermo,
|
||||
gasHThermoPhysics
|
||||
);
|
||||
|
||||
makeCombustionTypesThermo
|
||||
(
|
||||
diffusionMulticomponent,
|
||||
rhoChemistryCombustion,
|
||||
gasHThermoPhysics,
|
||||
rhoCombustionModel
|
||||
psiReactionThermo,
|
||||
constGasHThermoPhysics
|
||||
);
|
||||
|
||||
makeCombustionTypesThermo
|
||||
(
|
||||
diffusionMulticomponent,
|
||||
rhoChemistryCombustion,
|
||||
incompressibleGasHThermoPhysics,
|
||||
rhoCombustionModel
|
||||
rhoReactionThermo,
|
||||
gasHThermoPhysics
|
||||
);
|
||||
|
||||
makeCombustionTypesThermo
|
||||
(
|
||||
diffusionMulticomponent,
|
||||
rhoReactionThermo,
|
||||
constGasHThermoPhysics
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -31,22 +31,22 @@ namespace combustionModels
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CombThermoType, class ThermoType>
|
||||
eddyDissipationDiffusionModel<CombThermoType, ThermoType>::
|
||||
template<class ReactionThermo, class ThermoType>
|
||||
eddyDissipationDiffusionModel<ReactionThermo, ThermoType>::
|
||||
eddyDissipationDiffusionModel
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh,
|
||||
const word& combustionProperties,
|
||||
const word& phaseName
|
||||
ReactionThermo& thermo,
|
||||
const compressibleTurbulenceModel& turb,
|
||||
const word& combustionProperties
|
||||
)
|
||||
:
|
||||
eddyDissipationModelBase<CombThermoType, ThermoType>
|
||||
eddyDissipationModelBase<ReactionThermo, ThermoType>
|
||||
(
|
||||
modelType,
|
||||
mesh,
|
||||
combustionProperties,
|
||||
phaseName
|
||||
thermo,
|
||||
turb,
|
||||
combustionProperties
|
||||
),
|
||||
Cd_(readScalar(this->coeffs().lookup("Cd")))
|
||||
{}
|
||||
@ -54,8 +54,8 @@ eddyDissipationDiffusionModel
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CombThermoType, class ThermoType>
|
||||
eddyDissipationDiffusionModel<CombThermoType, ThermoType>::
|
||||
template<class ReactionThermo, class ThermoType>
|
||||
eddyDissipationDiffusionModel<ReactionThermo, ThermoType>::
|
||||
~eddyDissipationDiffusionModel()
|
||||
{}
|
||||
|
||||
@ -63,17 +63,17 @@ eddyDissipationDiffusionModel<CombThermoType, ThermoType>::
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
template<class CombThermoType, class ThermoType>
|
||||
template<class ReactionThermo, class ThermoType>
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
eddyDissipationDiffusionModel<CombThermoType, ThermoType>::timeScale()
|
||||
eddyDissipationDiffusionModel<ReactionThermo, ThermoType>::timeScale()
|
||||
{
|
||||
return (max(this->rtTurb(), this->rtDiff()));
|
||||
}
|
||||
|
||||
|
||||
template<class CombThermoType, class ThermoType>
|
||||
template<class ReactionThermo, class ThermoType>
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
eddyDissipationDiffusionModel<CombThermoType, ThermoType>::rtDiff() const
|
||||
eddyDissipationDiffusionModel<ReactionThermo, ThermoType>::rtDiff() const
|
||||
{
|
||||
tmp<volScalarField> tdelta
|
||||
(
|
||||
@ -102,10 +102,10 @@ eddyDissipationDiffusionModel<CombThermoType, ThermoType>::rtDiff() const
|
||||
}
|
||||
|
||||
|
||||
template<class CombThermoType, class ThermoType>
|
||||
bool eddyDissipationDiffusionModel<CombThermoType, ThermoType>::read()
|
||||
template<class ReactionThermo, class ThermoType>
|
||||
bool eddyDissipationDiffusionModel<ReactionThermo, ThermoType>::read()
|
||||
{
|
||||
if (eddyDissipationModelBase<CombThermoType, ThermoType>::read())
|
||||
if (eddyDissipationModelBase<ReactionThermo, ThermoType>::read())
|
||||
{
|
||||
this->coeffs().lookup("Cd") >> Cd_;
|
||||
return true;
|
||||
|
||||
@ -55,10 +55,10 @@ namespace combustionModels
|
||||
Class eddyDissipationDiffusionModel Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class CombThermoType, class ThermoType>
|
||||
template<class ReactionThermo, class ThermoType>
|
||||
class eddyDissipationDiffusionModel
|
||||
:
|
||||
public eddyDissipationModelBase<CombThermoType, ThermoType>
|
||||
public eddyDissipationModelBase<ReactionThermo, ThermoType>
|
||||
{
|
||||
// Private data
|
||||
|
||||
@ -87,9 +87,9 @@ public:
|
||||
eddyDissipationDiffusionModel
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh,
|
||||
const word& combustionProperties,
|
||||
const word& phaseName
|
||||
ReactionThermo& thermo,
|
||||
const compressibleTurbulenceModel& turb,
|
||||
const word& combustionProperties
|
||||
);
|
||||
|
||||
|
||||
|
||||
@ -26,8 +26,8 @@ License
|
||||
#include "makeCombustionTypes.H"
|
||||
|
||||
#include "thermoPhysicsTypes.H"
|
||||
#include "psiThermoCombustion.H"
|
||||
#include "rhoThermoCombustion.H"
|
||||
#include "psiReactionThermo.H"
|
||||
#include "rhoReactionThermo.H"
|
||||
|
||||
#include "eddyDissipationDiffusionModel.H"
|
||||
#include "eddyDissipationModelBase.H"
|
||||
@ -35,37 +35,37 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
makeCombustionTypesThermo
|
||||
(
|
||||
eddyDissipationDiffusionModel,
|
||||
psiThermoCombustion,
|
||||
gasHThermoPhysics,
|
||||
psiCombustionModel
|
||||
psiReactionThermo,
|
||||
gasHThermoPhysics
|
||||
);
|
||||
|
||||
makeCombustionTypesThermo
|
||||
(
|
||||
eddyDissipationDiffusionModel,
|
||||
psiThermoCombustion,
|
||||
constGasHThermoPhysics,
|
||||
psiCombustionModel
|
||||
psiReactionThermo,
|
||||
constGasHThermoPhysics
|
||||
);
|
||||
|
||||
makeCombustionTypesThermo
|
||||
(
|
||||
eddyDissipationDiffusionModel,
|
||||
rhoThermoCombustion,
|
||||
gasHThermoPhysics,
|
||||
rhoCombustionModel
|
||||
rhoReactionThermo,
|
||||
gasHThermoPhysics
|
||||
);
|
||||
|
||||
makeCombustionTypesThermo
|
||||
(
|
||||
eddyDissipationDiffusionModel,
|
||||
rhoThermoCombustion,
|
||||
constGasHThermoPhysics,
|
||||
rhoCombustionModel
|
||||
rhoReactionThermo,
|
||||
constGasHThermoPhysics
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -32,21 +32,21 @@ namespace combustionModels
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CombThermoType, class ThermoType>
|
||||
eddyDissipationModelBase<CombThermoType, ThermoType>::eddyDissipationModelBase
|
||||
template<class ReactionThermo, class ThermoType>
|
||||
eddyDissipationModelBase<ReactionThermo, ThermoType>::eddyDissipationModelBase
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh,
|
||||
const word& combustionProperties,
|
||||
const word& phaseName
|
||||
ReactionThermo& thermo,
|
||||
const compressibleTurbulenceModel& turb,
|
||||
const word& combustionProperties
|
||||
)
|
||||
:
|
||||
singleStepCombustion<CombThermoType, ThermoType>
|
||||
singleStepCombustion<ReactionThermo, ThermoType>
|
||||
(
|
||||
modelType,
|
||||
mesh,
|
||||
combustionProperties,
|
||||
phaseName
|
||||
thermo,
|
||||
turb,
|
||||
combustionProperties
|
||||
),
|
||||
CEDC_(readScalar(this->coeffs().lookup("CEDC")))
|
||||
{}
|
||||
@ -54,17 +54,17 @@ eddyDissipationModelBase<CombThermoType, ThermoType>::eddyDissipationModelBase
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CombThermoType, class ThermoType>
|
||||
eddyDissipationModelBase<CombThermoType, ThermoType>::
|
||||
template<class ReactionThermo, class ThermoType>
|
||||
eddyDissipationModelBase<ReactionThermo, ThermoType>::
|
||||
~eddyDissipationModelBase()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CombThermoType, class ThermoType>
|
||||
template<class ReactionThermo, class ThermoType>
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
eddyDissipationModelBase<CombThermoType, ThermoType>::rtTurb() const
|
||||
eddyDissipationModelBase<ReactionThermo, ThermoType>::rtTurb() const
|
||||
{
|
||||
return
|
||||
CEDC_*this->turbulence().epsilon()
|
||||
@ -76,8 +76,8 @@ eddyDissipationModelBase<CombThermoType, ThermoType>::rtTurb() const
|
||||
}
|
||||
|
||||
|
||||
template<class CombThermoType, class ThermoType>
|
||||
void eddyDissipationModelBase<CombThermoType, ThermoType>::correct()
|
||||
template<class ReactionThermo, class ThermoType>
|
||||
void eddyDissipationModelBase<ReactionThermo, ThermoType>::correct()
|
||||
{
|
||||
this->wFuel_ == dimensionedScalar(dimMass/dimVolume/dimTime, Zero);
|
||||
|
||||
@ -87,15 +87,13 @@ void eddyDissipationModelBase<CombThermoType, ThermoType>::correct()
|
||||
|
||||
const label fuelI = this->singleMixturePtr_->fuelIndex();
|
||||
|
||||
const volScalarField& YFuel =
|
||||
this->thermoPtr_->composition().Y()[fuelI];
|
||||
const volScalarField& YFuel = this->thermo_.composition().Y()[fuelI];
|
||||
|
||||
const dimensionedScalar s = this->singleMixturePtr_->s();
|
||||
|
||||
if (this->thermoPtr_->composition().contains("O2"))
|
||||
if (this->thermo_.composition().contains("O2"))
|
||||
{
|
||||
const volScalarField& YO2 =
|
||||
this->thermoPtr_->composition().Y("O2");
|
||||
const volScalarField& YO2 = this->thermo_.composition().Y("O2");
|
||||
|
||||
this->wFuel_ ==
|
||||
this->rho()
|
||||
@ -113,10 +111,10 @@ void eddyDissipationModelBase<CombThermoType, ThermoType>::correct()
|
||||
}
|
||||
|
||||
|
||||
template<class CombThermoType, class ThermoType>
|
||||
bool eddyDissipationModelBase<CombThermoType, ThermoType>::read()
|
||||
template<class ReactionThermo, class ThermoType>
|
||||
bool eddyDissipationModelBase<ReactionThermo, ThermoType>::read()
|
||||
{
|
||||
if (singleStepCombustion<CombThermoType, ThermoType>::read())
|
||||
if (singleStepCombustion<ReactionThermo, ThermoType>::read())
|
||||
{
|
||||
this->coeffs().lookup("CEDC") >> CEDC_;
|
||||
return true;
|
||||
|
||||
@ -51,10 +51,10 @@ namespace combustionModels
|
||||
Class eddyDissipationModelBase Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class CombThermoType, class ThermoType>
|
||||
template<class ReactionThermo, class ThermoType>
|
||||
class eddyDissipationModelBase
|
||||
:
|
||||
public singleStepCombustion<CombThermoType, ThermoType>
|
||||
public singleStepCombustion<ReactionThermo, ThermoType>
|
||||
{
|
||||
// Private data
|
||||
|
||||
@ -79,9 +79,9 @@ public:
|
||||
eddyDissipationModelBase
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh,
|
||||
const word& combustionProperties,
|
||||
const word& phaseName
|
||||
ReactionThermo& thermo,
|
||||
const compressibleTurbulenceModel& turb,
|
||||
const word& combustionProperties
|
||||
);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user