TurbulenceModels: Reorganised, cleaned, added documentation and made more consistent

This commit is contained in:
Henry
2013-08-02 16:34:25 +01:00
parent 8751d67971
commit dcfb92801b
17 changed files with 510 additions and 355 deletions

View File

@ -129,7 +129,12 @@ Foam::kineticTheoryModel::kineticTheoryModel
U.mesh(),
dimensionedScalar("zero", dimensionSet(0, 2, -1, 0, 0), 0.0)
)
{}
{
if (type == typeName)
{
this->printCoeffs(type);
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
@ -140,6 +145,199 @@ Foam::kineticTheoryModel::~kineticTheoryModel()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::kineticTheoryModel::read()
{
if
(
eddyViscosity
<
RASModel<PhaseIncompressibleTurbulenceModel<phaseModel> >
>::read()
)
{
this->coeffDict().lookup("equilibrium") >> equilibrium_;
e_.readIfPresent(this->coeffDict());
alphaMax_.readIfPresent(this->coeffDict());
alphaMinFriction_.readIfPresent(this->coeffDict());
viscosityModel_->read();
conductivityModel_->read();
radialModel_->read();
granularPressureModel_->read();
frictionalStressModel_->read();
return true;
}
else
{
return false;
}
}
Foam::tmp<Foam::volScalarField> Foam::kineticTheoryModel::k() const
{
notImplemented("kineticTheoryModel::k()");
return nut_;
}
Foam::tmp<Foam::volScalarField> Foam::kineticTheoryModel::epsilon() const
{
notImplemented("kineticTheoryModel::epsilon()");
return nut_;
}
Foam::tmp<Foam::volSymmTensorField> Foam::kineticTheoryModel::R() const
{
return tmp<volSymmTensorField>
(
new volSymmTensorField
(
IOobject
(
IOobject::groupName("R", this->U_.group()),
this->runTime_.timeName(),
this->mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
- (this->nut_)*dev(twoSymm(fvc::grad(this->U_)))
- (lambda_*fvc::div(this->phi_))*symmTensor::I
)
);
}
/*
Foam::tmp<Foam::volScalarField> Foam::kineticTheoryModel::pp() const
{
// Particle pressure coefficient
// Coefficient in front of Theta (Eq. 3.22, p. 45)
volScalarField PsCoeff
(
granularPressureModel_->granularPressureCoeff
(
alpha,
gs0,
rho,
e_
)
);
// Frictional pressure
volScalarField pf
(
frictionalStressModel_->frictionalPressure
(
alpha,
alphaMinFriction_,
alphaMax_
)
);
// Return total particle pressure
return PsCoeff*Theta_ + pf;
}
*/
Foam::tmp<Foam::volScalarField> Foam::kineticTheoryModel::pPrime() const
{
// Local references
const volScalarField& alpha = this->alpha_;
const volScalarField& rho = phase_.rho();
return
(
Theta_
*granularPressureModel_->granularPressureCoeffPrime
(
alpha,
radialModel_->g0(alpha, alphaMinFriction_, alphaMax_),
radialModel_->g0prime(alpha, alphaMinFriction_, alphaMax_),
rho,
e_
)
+ frictionalStressModel_->frictionalPressurePrime
(
alpha,
alphaMinFriction_,
alphaMax_
)
);
}
Foam::tmp<Foam::surfaceScalarField> Foam::kineticTheoryModel::pPrimef() const
{
// Local references
const volScalarField& alpha = this->alpha_;
const volScalarField& rho = phase_.rho();
return fvc::interpolate
(
Theta_
*granularPressureModel_->granularPressureCoeffPrime
(
alpha,
radialModel_->g0(alpha, alphaMinFriction_, alphaMax_),
radialModel_->g0prime(alpha, alphaMinFriction_, alphaMax_),
rho,
e_
)
+ frictionalStressModel_->frictionalPressurePrime
(
alpha,
alphaMinFriction_,
alphaMax_
)
);
}
Foam::tmp<Foam::volSymmTensorField> Foam::kineticTheoryModel::devRhoReff() const
{
return tmp<volSymmTensorField>
(
new volSymmTensorField
(
IOobject
(
IOobject::groupName("devRhoReff", this->U_.group()),
this->runTime_.timeName(),
this->mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
- (this->rho_*this->nut_)
*dev(twoSymm(fvc::grad(this->U_)))
- ((this->rho_*lambda_)*fvc::div(this->phi_))*symmTensor::I
)
);
}
Foam::tmp<Foam::fvVectorMatrix> Foam::kineticTheoryModel::divDevRhoReff
(
volVectorField& U
) const
{
return
(
- fvm::laplacian(this->rho_*this->nut_, U)
- fvc::div
(
(this->rho_*this->nut_)*dev2(T(fvc::grad(U)))
+ ((this->rho_*lambda_)*fvc::div(this->phi_))
*dimensioned<symmTensor>("I", dimless, symmTensor::I)
)
);
}
void Foam::kineticTheoryModel::correct()
{
// Local references
@ -343,202 +541,4 @@ void Foam::kineticTheoryModel::correct()
}
}
/*
Foam::tmp<Foam::volScalarField> Foam::kineticTheoryModel::pp() const
{
// Particle pressure coefficient
// Coefficient in front of Theta (Eq. 3.22, p. 45)
volScalarField PsCoeff
(
granularPressureModel_->granularPressureCoeff
(
alpha,
gs0,
rho,
e_
)
);
// Frictional pressure
volScalarField pf
(
frictionalStressModel_->frictionalPressure
(
alpha,
alphaMinFriction_,
alphaMax_
)
);
// Return total particle pressure
return PsCoeff*Theta_ + pf;
}
*/
Foam::tmp<Foam::volScalarField> Foam::kineticTheoryModel::pPrime() const
{
// Local references
const volScalarField& alpha = this->alpha_;
const volScalarField& rho = phase_.rho();
return
(
Theta_
*granularPressureModel_->granularPressureCoeffPrime
(
alpha,
radialModel_->g0(alpha, alphaMinFriction_, alphaMax_),
radialModel_->g0prime(alpha, alphaMinFriction_, alphaMax_),
rho,
e_
)
+ frictionalStressModel_->frictionalPressurePrime
(
alpha,
alphaMinFriction_,
alphaMax_
)
);
}
Foam::tmp<Foam::surfaceScalarField> Foam::kineticTheoryModel::pPrimef() const
{
// Local references
const volScalarField& alpha = this->alpha_;
const volScalarField& rho = phase_.rho();
return fvc::interpolate
(
Theta_
*granularPressureModel_->granularPressureCoeffPrime
(
alpha,
radialModel_->g0(alpha, alphaMinFriction_, alphaMax_),
radialModel_->g0prime(alpha, alphaMinFriction_, alphaMax_),
rho,
e_
)
+ frictionalStressModel_->frictionalPressurePrime
(
alpha,
alphaMinFriction_,
alphaMax_
)
);
}
void Foam::kineticTheoryModel::correctNut()
{}
Foam::tmp<Foam::volScalarField> Foam::kineticTheoryModel::k() const
{
notImplemented("kineticTheoryModel::k()");
return nut_;
}
Foam::tmp<Foam::volScalarField> Foam::kineticTheoryModel::epsilon() const
{
notImplemented("kineticTheoryModel::epsilon()");
return nut_;
}
Foam::tmp<Foam::volSymmTensorField> Foam::kineticTheoryModel::R() const
{
return tmp<volSymmTensorField>
(
new volSymmTensorField
(
IOobject
(
IOobject::groupName("R", this->U_.group()),
this->runTime_.timeName(),
this->mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
- (this->nut_)*dev(twoSymm(fvc::grad(this->U_)))
- (lambda_*fvc::div(this->phi_))*symmTensor::I
)
);
}
Foam::tmp<Foam::volSymmTensorField> Foam::kineticTheoryModel::devRhoReff() const
{
return tmp<volSymmTensorField>
(
new volSymmTensorField
(
IOobject
(
IOobject::groupName("devRhoReff", this->U_.group()),
this->runTime_.timeName(),
this->mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
- (this->rho_*this->nut_)
*dev(twoSymm(fvc::grad(this->U_)))
- ((this->rho_*lambda_)*fvc::div(this->phi_))*symmTensor::I
)
);
}
Foam::tmp<Foam::fvVectorMatrix> Foam::kineticTheoryModel::divDevRhoReff
(
volVectorField& U
) const
{
return
(
- fvm::laplacian(this->rho_*this->nut_, U)
- fvc::div
(
(this->rho_*this->nut_)*dev2(T(fvc::grad(U)))
+ ((this->rho_*lambda_)*fvc::div(this->phi_))
*dimensioned<symmTensor>("I", dimless, symmTensor::I)
)
);
}
bool Foam::kineticTheoryModel::read()
{
if
(
eddyViscosity
<
RASModel<PhaseIncompressibleTurbulenceModel<phaseModel> >
>::read()
)
{
this->coeffDict().lookup("equilibrium") >> equilibrium_;
e_.readIfPresent(this->coeffDict());
alphaMax_.readIfPresent(this->coeffDict());
alphaMinFriction_.readIfPresent(this->coeffDict());
viscosityModel_->read();
conductivityModel_->read();
radialModel_->read();
granularPressureModel_->read();
frictionalStressModel_->read();
return true;
}
else
{
return false;
}
}
// ************************************************************************* //

View File

@ -25,6 +25,17 @@ Class
Foam::kineticTheoryModel
Description
Kinetic theory particle phase RAS model
Reference:
\verbatim
"Derivation, implementation, and validation of computer simulation
models for gas-solid fluidized beds",
B.G.M. van Wachem,
Ph.D. Thesis, Delft University of Technology, Amsterdam, 2000.
\endverbatim
There are no default model coefficients.
SourceFiles
kineticTheoryModel.C
@ -118,6 +129,9 @@ class kineticTheoryModel
// Private Member Functions
void correctNut()
{}
//- Disallow default bitwise copy construct
kineticTheoryModel(const kineticTheoryModel&);
@ -125,13 +139,6 @@ class kineticTheoryModel
void operator=(const kineticTheoryModel&);
protected:
// Protected member functions
virtual void correctNut();
public:
//- Runtime type information
@ -160,6 +167,9 @@ public:
// Member Functions
//- Re-read model coefficients if they have changed
virtual bool read();
//- Return the effective viscosity
virtual tmp<volScalarField> nuEff() const
{
@ -197,9 +207,6 @@ public:
//- Solve the kinetic theory equations and correct the viscosity
virtual void correct();
//- Re-read model coefficients if they have changed
virtual bool read();
};

View File

@ -182,7 +182,10 @@ namespace Foam
#include "LESModel.H"
#include "Smagorinsky.H"
#include "SmagorinskyZhang.H"
#include "kEqn.H"
#include "NicenoKEqn.H"
#include "continuousGasKEqn.H"
namespace Foam
{
@ -215,6 +218,21 @@ namespace Foam
);
}
namespace LESModels
{
typedef SmagorinskyZhang<incompressibleTransportTurbulenceModel>
incompressibleSmagorinskyZhang;
defineNamedTemplateTypeNameAndDebug(incompressibleSmagorinskyZhang, 0);
addToRunTimeSelectionTable
(
incompressibleLESModel,
incompressibleSmagorinskyZhang,
dictionary
);
}
namespace LESModels
{
typedef kEqn<incompressibleTransportTurbulenceModel>
@ -229,6 +247,36 @@ namespace Foam
dictionary
);
}
namespace LESModels
{
typedef NicenoKEqn<incompressibleTransportTurbulenceModel>
incompressibleNicenoKEqn;
defineNamedTemplateTypeNameAndDebug(incompressibleNicenoKEqn, 0);
addToRunTimeSelectionTable
(
incompressibleLESModel,
incompressibleNicenoKEqn,
dictionary
);
}
namespace LESModels
{
typedef continuousGasKEqn<incompressibleTransportTurbulenceModel>
incompressiblecontinuousGasKEqn;
defineNamedTemplateTypeNameAndDebug(incompressiblecontinuousGasKEqn, 0);
addToRunTimeSelectionTable
(
incompressibleLESModel,
incompressiblecontinuousGasKEqn,
dictionary
);
}
}

View File

@ -65,6 +65,11 @@ Foam::phasePressureModel::phasePressureModel
)
{
this->nut_ == dimensionedScalar("zero", this->nut_.dimensions(), 0.0);
if (type == typeName)
{
this->printCoeffs(type);
}
}
@ -76,35 +81,27 @@ Foam::phasePressureModel::~phasePressureModel()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::phasePressureModel::correct()
{}
void Foam::phasePressureModel::correctNut()
{}
Foam::tmp<Foam::volScalarField> Foam::phasePressureModel::pPrime() const
bool Foam::phasePressureModel::read()
{
return
g0_
*min
(
exp(preAlphaExp_*(this->alpha_ - alphaMax_)),
expMax_
);
}
if
(
eddyViscosity
<
RASModel<PhaseIncompressibleTurbulenceModel<phaseModel> >
>::read()
)
{
this->coeffDict().lookup("alphaMax") >> alphaMax_;
this->coeffDict().lookup("preAlphaExp") >> preAlphaExp_;
this->coeffDict().lookup("expMax") >> expMax_;
g0_.readIfPresent(this->coeffDict());
Foam::tmp<Foam::surfaceScalarField> Foam::phasePressureModel::pPrimef() const
{
return
g0_
*min
(
exp(preAlphaExp_*(fvc::interpolate(this->alpha_) - alphaMax_)),
expMax_
);
return true;
}
else
{
return false;
}
}
@ -148,6 +145,30 @@ Foam::tmp<Foam::volSymmTensorField> Foam::phasePressureModel::R() const
}
Foam::tmp<Foam::volScalarField> Foam::phasePressureModel::pPrime() const
{
return
g0_
*min
(
exp(preAlphaExp_*(this->alpha_ - alphaMax_)),
expMax_
);
}
Foam::tmp<Foam::surfaceScalarField> Foam::phasePressureModel::pPrimef() const
{
return
g0_
*min
(
exp(preAlphaExp_*(fvc::interpolate(this->alpha_) - alphaMax_)),
expMax_
);
}
Foam::tmp<Foam::volSymmTensorField> Foam::phasePressureModel::devRhoReff() const
{
return tmp<volSymmTensorField>
@ -190,28 +211,8 @@ Foam::tmp<Foam::fvVectorMatrix> Foam::phasePressureModel::divDevRhoReff
}
bool Foam::phasePressureModel::read()
{
if
(
eddyViscosity
<
RASModel<PhaseIncompressibleTurbulenceModel<phaseModel> >
>::read()
)
{
this->coeffDict().lookup("alphaMax") >> alphaMax_;
this->coeffDict().lookup("preAlphaExp") >> preAlphaExp_;
this->coeffDict().lookup("expMax") >> expMax_;
g0_.readIfPresent(this->coeffDict());
return true;
}
else
{
return false;
}
}
void Foam::phasePressureModel::correct()
{}
// ************************************************************************* //

View File

@ -25,6 +25,23 @@ Class
Foam::phasePressureModel
Description
Particle-particle phase-pressure RAS model
The derivative of the phase-pressure with respect to the phase-fraction
is evaluated as
g0*min(exp(preAlphaExp*(alpha - alphaMax)), expMax)
The default model coefficients correspond to the following:
\verbatim
phasePressureCoeffs
{
preAlphaExp 500;
expMax 1000;
alphaMax 0.62;
g0 1000;
}
\endverbatim
SourceFiles
phasePressureModel.C
@ -39,7 +56,6 @@ SourceFiles
#include "PhaseIncompressibleTurbulenceModel.H"
#include "phaseModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
@ -80,6 +96,9 @@ class phasePressureModel
// Private Member Functions
void correctNut()
{}
//- Disallow default bitwise copy construct
phasePressureModel(const phasePressureModel&);
@ -87,13 +106,6 @@ class phasePressureModel
void operator=(const phasePressureModel&);
protected:
// Protected member functions
virtual void correctNut();
public:
//- Runtime type information
@ -122,6 +134,9 @@ public:
// Member Functions
//- Re-read model coefficients if they have changed
virtual bool read();
//- Return the effective viscosity
virtual tmp<volScalarField> nuEff() const
{
@ -159,9 +174,6 @@ public:
//- Solve the kinetic theory equations and correct the viscosity
virtual void correct();
//- Re-read model coefficients if they have changed
virtual bool read();
};