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(), U.mesh(),
dimensionedScalar("zero", dimensionSet(0, 2, -1, 0, 0), 0.0) dimensionedScalar("zero", dimensionSet(0, 2, -1, 0, 0), 0.0)
) )
{} {
if (type == typeName)
{
this->printCoeffs(type);
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
@ -140,6 +145,199 @@ Foam::kineticTheoryModel::~kineticTheoryModel()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * 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() void Foam::kineticTheoryModel::correct()
{ {
// Local references // 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 Foam::kineticTheoryModel
Description 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 SourceFiles
kineticTheoryModel.C kineticTheoryModel.C
@ -118,6 +129,9 @@ class kineticTheoryModel
// Private Member Functions // Private Member Functions
void correctNut()
{}
//- Disallow default bitwise copy construct //- Disallow default bitwise copy construct
kineticTheoryModel(const kineticTheoryModel&); kineticTheoryModel(const kineticTheoryModel&);
@ -125,13 +139,6 @@ class kineticTheoryModel
void operator=(const kineticTheoryModel&); void operator=(const kineticTheoryModel&);
protected:
// Protected member functions
virtual void correctNut();
public: public:
//- Runtime type information //- Runtime type information
@ -160,6 +167,9 @@ public:
// Member Functions // Member Functions
//- Re-read model coefficients if they have changed
virtual bool read();
//- Return the effective viscosity //- Return the effective viscosity
virtual tmp<volScalarField> nuEff() const virtual tmp<volScalarField> nuEff() const
{ {
@ -197,9 +207,6 @@ public:
//- Solve the kinetic theory equations and correct the viscosity //- Solve the kinetic theory equations and correct the viscosity
virtual void correct(); 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 "LESModel.H"
#include "Smagorinsky.H" #include "Smagorinsky.H"
#include "SmagorinskyZhang.H"
#include "kEqn.H" #include "kEqn.H"
#include "NicenoKEqn.H"
#include "continuousGasKEqn.H"
namespace Foam namespace Foam
{ {
@ -215,6 +218,21 @@ namespace Foam
); );
} }
namespace LESModels
{
typedef SmagorinskyZhang<incompressibleTransportTurbulenceModel>
incompressibleSmagorinskyZhang;
defineNamedTemplateTypeNameAndDebug(incompressibleSmagorinskyZhang, 0);
addToRunTimeSelectionTable
(
incompressibleLESModel,
incompressibleSmagorinskyZhang,
dictionary
);
}
namespace LESModels namespace LESModels
{ {
typedef kEqn<incompressibleTransportTurbulenceModel> typedef kEqn<incompressibleTransportTurbulenceModel>
@ -229,6 +247,36 @@ namespace Foam
dictionary 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); this->nut_ == dimensionedScalar("zero", this->nut_.dimensions(), 0.0);
if (type == typeName)
{
this->printCoeffs(type);
}
} }
@ -76,35 +81,27 @@ Foam::phasePressureModel::~phasePressureModel()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::phasePressureModel::correct() bool Foam::phasePressureModel::read()
{}
void Foam::phasePressureModel::correctNut()
{}
Foam::tmp<Foam::volScalarField> Foam::phasePressureModel::pPrime() const
{ {
return if
g0_ (
*min eddyViscosity
( <
exp(preAlphaExp_*(this->alpha_ - alphaMax_)), RASModel<PhaseIncompressibleTurbulenceModel<phaseModel> >
expMax_ >::read()
); )
} {
this->coeffDict().lookup("alphaMax") >> alphaMax_;
this->coeffDict().lookup("preAlphaExp") >> preAlphaExp_;
this->coeffDict().lookup("expMax") >> expMax_;
g0_.readIfPresent(this->coeffDict());
return true;
Foam::tmp<Foam::surfaceScalarField> Foam::phasePressureModel::pPrimef() const }
{ else
return {
g0_ return false;
*min }
(
exp(preAlphaExp_*(fvc::interpolate(this->alpha_) - alphaMax_)),
expMax_
);
} }
@ -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 Foam::tmp<Foam::volSymmTensorField> Foam::phasePressureModel::devRhoReff() const
{ {
return tmp<volSymmTensorField> return tmp<volSymmTensorField>
@ -190,28 +211,8 @@ Foam::tmp<Foam::fvVectorMatrix> Foam::phasePressureModel::divDevRhoReff
} }
bool Foam::phasePressureModel::read() void Foam::phasePressureModel::correct()
{ {}
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;
}
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -25,6 +25,23 @@ Class
Foam::phasePressureModel Foam::phasePressureModel
Description 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 SourceFiles
phasePressureModel.C phasePressureModel.C
@ -39,7 +56,6 @@ SourceFiles
#include "PhaseIncompressibleTurbulenceModel.H" #include "PhaseIncompressibleTurbulenceModel.H"
#include "phaseModel.H" #include "phaseModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam namespace Foam
@ -80,6 +96,9 @@ class phasePressureModel
// Private Member Functions // Private Member Functions
void correctNut()
{}
//- Disallow default bitwise copy construct //- Disallow default bitwise copy construct
phasePressureModel(const phasePressureModel&); phasePressureModel(const phasePressureModel&);
@ -87,13 +106,6 @@ class phasePressureModel
void operator=(const phasePressureModel&); void operator=(const phasePressureModel&);
protected:
// Protected member functions
virtual void correctNut();
public: public:
//- Runtime type information //- Runtime type information
@ -122,6 +134,9 @@ public:
// Member Functions // Member Functions
//- Re-read model coefficients if they have changed
virtual bool read();
//- Return the effective viscosity //- Return the effective viscosity
virtual tmp<volScalarField> nuEff() const virtual tmp<volScalarField> nuEff() const
{ {
@ -159,9 +174,6 @@ public:
//- Solve the kinetic theory equations and correct the viscosity //- Solve the kinetic theory equations and correct the viscosity
virtual void correct(); virtual void correct();
//- Re-read model coefficients if they have changed
virtual bool read();
}; };

View File

@ -96,7 +96,7 @@ public:
{} {}
// Member Functions // Member functions
//- Return the effective stress tensor including the laminar stress //- Return the effective stress tensor including the laminar stress
virtual tmp<volSymmTensorField> devRhoReff() const = 0; virtual tmp<volSymmTensorField> devRhoReff() const = 0;

View File

@ -28,6 +28,31 @@ Group
grpRASTurbulence grpRASTurbulence
Description Description
Continuous-phase k-epsilon model including bubble-generated turbulence.
Reference:
\verbatim
"The simulation of multidimensional multiphase flows",
Lahey R.T.,
Nucl. Eng. & Design
2005 (235) pp.1043-1060.
\endverbatim
The default model coefficients correspond to the following:
\verbatim
LaheyKEpsilonCoeffs
{
Cmu 0.09;
C1 1.44;
C2 1.92;
C3 -0.33;
sigmak 1.0;
sigmaEps 1.3;
Cp 0.25;
Cmub 0.6;
alphaInversion 0.3;
}
\endverbatim
SourceFiles SourceFiles
LaheyKEpsilon.C LaheyKEpsilon.C
@ -63,6 +88,20 @@ class LaheyKEpsilon
> *gasTurbulencePtr_; > *gasTurbulencePtr_;
// Private Member Functions
//- Return the turbulence model for the gas phase
const PhaseIncompressibleTurbulenceModel
<
typename BasicTurbulenceModel::transportModel
>&
gasTurbulence() const;
// Disallow default bitwise copy construct and assignment
LaheyKEpsilon(const LaheyKEpsilon&);
LaheyKEpsilon& operator=(const LaheyKEpsilon&);
protected: protected:
// Protected data // Protected data
@ -74,7 +113,7 @@ protected:
dimensionedScalar Cmub_; dimensionedScalar Cmub_;
// Protected member functions // Protected Member Functions
virtual void correctNut(); virtual void correctNut();
tmp<volScalarField> bubbleG() const; tmp<volScalarField> bubbleG() const;
@ -82,6 +121,7 @@ protected:
virtual tmp<fvScalarMatrix> kSource() const; virtual tmp<fvScalarMatrix> kSource() const;
virtual tmp<fvScalarMatrix> epsilonSource() const; virtual tmp<fvScalarMatrix> epsilonSource() const;
public: public:
typedef typename BasicTurbulenceModel::alphaField alphaField; typedef typename BasicTurbulenceModel::alphaField alphaField;
@ -116,15 +156,11 @@ public:
// Member Functions // Member Functions
//- Return the turbulence model for the gas phase //- Read model coefficients if they have changed
const PhaseIncompressibleTurbulenceModel<transportModel>& virtual bool read();
gasTurbulence() const;
//- Solve the turbulence equations and correct the turbulence viscosity //- Solve the turbulence equations and correct the turbulence viscosity
virtual void correct(); virtual void correct();
//- Read RASProperties dictionary
virtual bool read();
}; };

View File

@ -28,6 +28,31 @@ Group
grpRASTurbulence grpRASTurbulence
Description Description
k-epsilon model for the gas-phase in a two-phase system
supporting phase-inversion.
In the limit that the gas-phase fraction approaches zero a contribution from
the other phase is blended into the k and epsilon equations up to the
phase-fraction of alphaInversion at which point phase-inversion is
considered to have occurred and the model reverts to the pure single-phase
form.
This model is unpublished and is provided as a stable numerical framework
on which a more physical model may be built.
The default model coefficients correspond to the following:
\verbatim
continuousGasKEpsilonCoeffs
{
Cmu 0.09;
C1 1.44;
C2 1.92;
C3 -0.33;
sigmak 1.0;
sigmaEps 1.3;
alphaInversion 0.7;
}
\endverbatim
SourceFiles SourceFiles
continuousGasKEpsilon.C continuousGasKEpsilon.C
@ -62,6 +87,13 @@ class continuousGasKEpsilon
volScalarField nutEff_; volScalarField nutEff_;
// Private Member Functions
// Disallow default bitwise copy construct and assignment
continuousGasKEpsilon(const continuousGasKEpsilon&);
continuousGasKEpsilon& operator=(const continuousGasKEpsilon&);
protected: protected:
// Protected data // Protected data
@ -71,7 +103,7 @@ protected:
dimensionedScalar alphaInversion_; dimensionedScalar alphaInversion_;
// Protected member functions // Protected Member Functions
virtual void correctNut(); virtual void correctNut();
tmp<volScalarField> phaseTransferCoeff() const; tmp<volScalarField> phaseTransferCoeff() const;
@ -113,6 +145,9 @@ public:
// Member Functions // Member Functions
//- Re-read model coefficients if they have changed
virtual bool read();
//- Return the turbulence model for the liquid phase //- Return the turbulence model for the liquid phase
const turbulenceModel& liquidTurbulence() const; const turbulenceModel& liquidTurbulence() const;
@ -124,9 +159,6 @@ public:
//- Return the Reynolds stress tensor //- Return the Reynolds stress tensor
virtual tmp<volSymmTensorField> R() const; virtual tmp<volSymmTensorField> R() const;
//- Read RASProperties dictionary
virtual bool read();
}; };

View File

@ -168,6 +168,10 @@ public:
// Member Functions // Member Functions
//- Read model coefficients if they have changed
virtual bool read();
// Access // Access
//- Const access to the coefficients dictionary //- Const access to the coefficients dictionary
@ -216,9 +220,6 @@ public:
//- Solve the turbulence equations and correct the turbulence viscosity //- Solve the turbulence equations and correct the turbulence viscosity
virtual void correct(); virtual void correct();
//- Read LESProperties dictionary
virtual bool read();
}; };

View File

@ -59,21 +59,21 @@ Smagorinsky<BasicTurbulenceModel>::Smagorinsky
propertiesName propertiesName
), ),
ck_ Ck_
( (
dimensioned<scalar>::lookupOrAddToDict dimensioned<scalar>::lookupOrAddToDict
( (
"ck", "Ck",
this->coeffDict_, this->coeffDict_,
0.02 0.094
) )
), ),
ce_ Ce_
( (
dimensioned<scalar>::lookupOrAddToDict dimensioned<scalar>::lookupOrAddToDict
( (
"ce", "Ce",
this->coeffDict_, this->coeffDict_,
1.048 1.048
) )
@ -94,8 +94,8 @@ bool Smagorinsky<BasicTurbulenceModel>::read()
{ {
if (eddyViscosity<LESModel<BasicTurbulenceModel> >::read()) if (eddyViscosity<LESModel<BasicTurbulenceModel> >::read())
{ {
ck_.readIfPresent(this->coeffDict()); Ck_.readIfPresent(this->coeffDict());
ce_.readIfPresent(this->coeffDict()); Ce_.readIfPresent(this->coeffDict());
return true; return true;
} }
@ -105,6 +105,7 @@ bool Smagorinsky<BasicTurbulenceModel>::read()
} }
} }
template<class BasicTurbulenceModel> template<class BasicTurbulenceModel>
tmp<volScalarField> Smagorinsky<BasicTurbulenceModel>::k tmp<volScalarField> Smagorinsky<BasicTurbulenceModel>::k
( (
@ -113,9 +114,9 @@ tmp<volScalarField> Smagorinsky<BasicTurbulenceModel>::k
{ {
volSymmTensorField D(symm(gradU)); volSymmTensorField D(symm(gradU));
volScalarField a(ce_/this->delta()); volScalarField a(Ce_/this->delta());
volScalarField b((2.0/3.0)*tr(D)); volScalarField b((2.0/3.0)*tr(D));
volScalarField c(2*ck_*this->delta()*(dev(D) && D)); volScalarField c(2*Ck_*this->delta()*(dev(D) && D));
return sqr((-b + sqrt(sqr(b) + 4*a*c))/(2*a)); return sqr((-b + sqrt(sqr(b) + 4*a*c))/(2*a));
} }
@ -136,7 +137,7 @@ tmp<volScalarField> Smagorinsky<BasicTurbulenceModel>::epsilon() const
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
ce_*k()*sqrt(k())/this->delta() Ce_*k()*sqrt(k())/this->delta()
) )
); );
} }
@ -147,7 +148,7 @@ void Smagorinsky<BasicTurbulenceModel>::correctNut()
{ {
volScalarField k(this->k(fvc::grad(this->U_))); volScalarField k(this->k(fvc::grad(this->U_)));
this->nut_ = ck_*this->delta()*sqrt(k); this->nut_ = Ck_*this->delta()*sqrt(k);
this->nut_.correctBoundaryConditions(); this->nut_.correctBoundaryConditions();
} }

View File

@ -28,7 +28,7 @@ Group
grpLESTurbulence grpLESTurbulence
Description Description
The Smagorinsky Model. The Smagorinsky SGS model.
Algebraic eddy viscosity SGS model founded on the assumption that Algebraic eddy viscosity SGS model founded on the assumption that
local equilibrium prevails. local equilibrium prevails.
@ -40,8 +40,17 @@ Description
where where
D = symm(grad(U)); D = symm(grad(U));
k from D:B + ce*k^3/2/delta = 0 k from D:B + Ce*k^3/2/delta = 0
nuSgs = ck*sqrt(k)*delta nuSgs = Ck*sqrt(k)*delta
\endverbatim
The default model coefficients correspond to the following:
\verbatim
SmagorinskyCoeffs
{
Ck 0.094;
Ce 1.048;
}
\endverbatim \endverbatim
SourceFiles SourceFiles
@ -71,26 +80,22 @@ class Smagorinsky
: :
public eddyViscosity<LESModel<BasicTurbulenceModel> > public eddyViscosity<LESModel<BasicTurbulenceModel> >
{ {
protected:
// Protected data
dimensionedScalar ck_;
dimensionedScalar ce_;
// Private Member Functions // Private Member Functions
//- Update sub-grid scale fields
void updateSubGridScaleFields(const volTensorField& gradU);
// Disallow default bitwise copy construct and assignment // Disallow default bitwise copy construct and assignment
Smagorinsky(const Smagorinsky&); Smagorinsky(const Smagorinsky&);
Smagorinsky& operator=(const Smagorinsky&); Smagorinsky& operator=(const Smagorinsky&);
// Protected member functions protected:
// Protected data
dimensionedScalar Ck_;
dimensionedScalar Ce_;
// Protected Member Functions
//- Return SGS kinetic energy //- Return SGS kinetic energy
// calculated from the given velocity gradient // calculated from the given velocity gradient
@ -133,6 +138,9 @@ public:
// Member Functions // Member Functions
//- Read model coefficients if they have changed
virtual bool read();
//- Return SGS kinetic energy //- Return SGS kinetic energy
virtual tmp<volScalarField> k() const virtual tmp<volScalarField> k() const
{ {
@ -144,9 +152,6 @@ public:
//- Correct Eddy-Viscosity and related properties //- Correct Eddy-Viscosity and related properties
virtual void correct(); virtual void correct();
//- Read model coefficients if they have changed
virtual bool read();
}; };

View File

@ -72,21 +72,21 @@ kEqn<BasicTurbulenceModel>::kEqn
this->mesh_ this->mesh_
), ),
ck_ Ck_
( (
dimensioned<scalar>::lookupOrAddToDict dimensioned<scalar>::lookupOrAddToDict
( (
"ck", "Ck",
this->coeffDict_, this->coeffDict_,
0.094 0.094
) )
), ),
ce_ Ce_
( (
dimensioned<scalar>::lookupOrAddToDict dimensioned<scalar>::lookupOrAddToDict
( (
"ce", "Ce",
this->coeffDict_, this->coeffDict_,
1.048 1.048
) )
@ -107,8 +107,8 @@ bool kEqn<BasicTurbulenceModel>::read()
{ {
if (eddyViscosity<LESModel<BasicTurbulenceModel> >::read()) if (eddyViscosity<LESModel<BasicTurbulenceModel> >::read())
{ {
ck_.readIfPresent(this->coeffDict()); Ck_.readIfPresent(this->coeffDict());
ce_.readIfPresent(this->coeffDict()); Ce_.readIfPresent(this->coeffDict());
return true; return true;
} }
@ -134,7 +134,7 @@ tmp<volScalarField> kEqn<BasicTurbulenceModel>::epsilon() const
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
ce_*k()*sqrt(k())/this->delta() Ce_*k()*sqrt(k())/this->delta()
) )
); );
} }
@ -143,7 +143,7 @@ tmp<volScalarField> kEqn<BasicTurbulenceModel>::epsilon() const
template<class BasicTurbulenceModel> template<class BasicTurbulenceModel>
void kEqn<BasicTurbulenceModel>::correctNut() void kEqn<BasicTurbulenceModel>::correctNut()
{ {
this->nut_ = ck_*sqrt(k_)*this->delta(); this->nut_ = Ck_*sqrt(k_)*this->delta();
this->nut_.correctBoundaryConditions(); this->nut_.correctBoundaryConditions();
} }
@ -196,7 +196,7 @@ void kEqn<BasicTurbulenceModel>::correct()
== ==
alpha*rho*G alpha*rho*G
- fvm::SuSp((2.0/3.0)*alpha*rho*divU, k_) - fvm::SuSp((2.0/3.0)*alpha*rho*divU, k_)
- fvm::Sp(ce_*alpha*rho*sqrt(k_)/this->delta(), k_) - fvm::Sp(Ce_*alpha*rho*sqrt(k_)/this->delta(), k_)
+ kSource() + kSource()
); );

View File

@ -35,7 +35,7 @@ Description
\verbatim \verbatim
d/dt(rho*k) + div(rho*U*k) - div(rho*nuEff*grad(k)) d/dt(rho*k) + div(rho*U*k) - div(rho*nuEff*grad(k))
= =
-rho*D:B - ce*rho*k^(3/2)/delta -rho*D:B - Ce*rho*k^(3/2)/delta
and and
@ -44,10 +44,19 @@ Description
where where
D = symm(grad(U)); D = symm(grad(U));
nuSgs = ck*sqrt(k)*delta nuSgs = Ck*sqrt(k)*delta
nuEff = nuSgs + nu nuEff = nuSgs + nu
\endverbatim \endverbatim
The default model coefficients correspond to the following:
\verbatim
NicenoKEqnCoeffs
{
Ck 0.094;
Ce 1.048;
}
\endverbatim
SourceFiles SourceFiles
kEqn.C kEqn.C
@ -75,6 +84,12 @@ class kEqn
: :
public eddyViscosity<LESModel<BasicTurbulenceModel> > public eddyViscosity<LESModel<BasicTurbulenceModel> >
{ {
// Private Member Functions
// Disallow default bitwise copy construct and assignment
kEqn(const kEqn&);
kEqn& operator=(const kEqn&);
protected: protected:
@ -82,21 +97,11 @@ protected:
volScalarField k_; volScalarField k_;
dimensionedScalar ck_; dimensionedScalar Ck_;
dimensionedScalar ce_; dimensionedScalar Ce_;
// Private Member Functions // Protected Member Functions
//- Update sub-grid scale fields
void updateSubGridScaleFields();
// Disallow default bitwise copy construct and assignment
kEqn(const kEqn&);
kEqn& operator=(const kEqn&);
// Protected member functions
virtual void correctNut(); virtual void correctNut();
virtual tmp<fvScalarMatrix> kSource() const; virtual tmp<fvScalarMatrix> kSource() const;
@ -136,6 +141,9 @@ public:
// Member Functions // Member Functions
//- Read model coefficients if they have changed
virtual bool read();
//- Return SGS kinetic energy //- Return SGS kinetic energy
virtual tmp<volScalarField> k() const virtual tmp<volScalarField> k() const
{ {
@ -156,9 +164,6 @@ public:
//- Correct Eddy-Viscosity and related properties //- Correct Eddy-Viscosity and related properties
virtual void correct(); virtual void correct();
//- Read model coefficients if they have changed
virtual bool read();
}; };

View File

@ -170,6 +170,10 @@ public:
// Member Functions // Member Functions
//- Read model coefficients if they have changed
virtual bool read();
// Access // Access
//- Return the lower allowable limit for k (default: SMALL) //- Return the lower allowable limit for k (default: SMALL)
@ -236,9 +240,6 @@ public:
//- Solve the turbulence equations and correct the turbulence viscosity //- Solve the turbulence equations and correct the turbulence viscosity
virtual void correct(); virtual void correct();
//- Read RASProperties dictionary
virtual bool read();
}; };

View File

@ -70,6 +70,12 @@ class kEpsilon
: :
public eddyViscosity<RASModel<BasicTurbulenceModel> > public eddyViscosity<RASModel<BasicTurbulenceModel> >
{ {
// Private Member Functions
// Disallow default bitwise copy construct and assignment
kEpsilon(const kEpsilon&);
kEpsilon& operator=(const kEpsilon&);
protected: protected:
@ -90,7 +96,7 @@ protected:
volScalarField epsilon_; volScalarField epsilon_;
// Protected member functions // Protected Member Functions
virtual void correctNut(); virtual void correctNut();
virtual tmp<fvScalarMatrix> kSource() const; virtual tmp<fvScalarMatrix> kSource() const;
@ -131,6 +137,9 @@ public:
// Member Functions // Member Functions
//- Re-read model coefficients if they have changed
virtual bool read();
//- Return the effective diffusivity for k //- Return the effective diffusivity for k
tmp<volScalarField> DkEff() const tmp<volScalarField> DkEff() const
{ {
@ -171,9 +180,6 @@ public:
//- Solve the turbulence equations and correct the turbulence viscosity //- Solve the turbulence equations and correct the turbulence viscosity
virtual void correct(); virtual void correct();
//- Re-read model coefficients if they have changed
virtual bool read();
}; };

View File

@ -62,7 +62,7 @@ protected:
volScalarField nut_; volScalarField nut_;
// Protected member functions // Protected Member Functions
virtual void correctNut() = 0; virtual void correctNut() = 0;
@ -97,6 +97,9 @@ public:
// Member Functions // Member Functions
//- Re-read model coefficients if they have changed
virtual bool read() = 0;
//- Return the turbulence viscosity //- Return the turbulence viscosity
virtual tmp<volScalarField> nut() const virtual tmp<volScalarField> nut() const
{ {
@ -123,9 +126,6 @@ public:
//- Solve the turbulence equations and correct the turbulence viscosity //- Solve the turbulence equations and correct the turbulence viscosity
virtual void correct() = 0; virtual void correct() = 0;
//- Re-read model coefficients if they have changed
virtual bool read() = 0;
}; };

View File

@ -114,6 +114,9 @@ public:
// Member Functions // Member Functions
//- Read model coefficients if they have changed
virtual bool read() = 0;
const Time& time() const const Time& time() const
{ {
return runTime_; return runTime_;
@ -205,9 +208,6 @@ public:
//- Solve the turbulence equations and correct the turbulence viscosity //- Solve the turbulence equations and correct the turbulence viscosity
virtual void correct() = 0; virtual void correct() = 0;
//- Read LESProperties or RASProperties dictionary
virtual bool read() = 0;
//- Default dummy write function //- Default dummy write function
virtual bool writeData(Ostream&) const virtual bool writeData(Ostream&) const
{ {