Skip to content
Snippets Groups Projects
Commit 08c51ae0 authored by henry's avatar henry
Browse files

Added support for DDES and IDDES SGS models for incompressible LES in to the SA base class.

parent 7544110b
No related merge requests found
...@@ -8,6 +8,9 @@ GenSGSStress/GenSGSStress.C ...@@ -8,6 +8,9 @@ GenSGSStress/GenSGSStress.C
laminar/laminar.C laminar/laminar.C
SpalartAllmaras/SpalartAllmaras.C SpalartAllmaras/SpalartAllmaras.C
SpalartAllmarasDDES/SpalartAllmarasDDES.C
SpalartAllmarasIDDES/SpalartAllmarasIDDES.C
SpalartAllmarasIDDES/IDDESDelta/IDDESDelta.C
oneEqEddy/oneEqEddy.C oneEqEddy/oneEqEddy.C
dynOneEqEddy/dynOneEqEddy.C dynOneEqEddy/dynOneEqEddy.C
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
...@@ -42,8 +42,7 @@ namespace LESModels ...@@ -42,8 +42,7 @@ namespace LESModels
defineTypeNameAndDebug(SpalartAllmaras, 0); defineTypeNameAndDebug(SpalartAllmaras, 0);
addToRunTimeSelectionTable(LESModel, SpalartAllmaras, dictionary); addToRunTimeSelectionTable(LESModel, SpalartAllmaras, dictionary);
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
tmp<volScalarField> SpalartAllmaras::fv1() const tmp<volScalarField> SpalartAllmaras::fv1() const
{ {
...@@ -55,7 +54,6 @@ tmp<volScalarField> SpalartAllmaras::fv1() const ...@@ -55,7 +54,6 @@ tmp<volScalarField> SpalartAllmaras::fv1() const
tmp<volScalarField> SpalartAllmaras::fv2() const tmp<volScalarField> SpalartAllmaras::fv2() const
{ {
volScalarField chi = nuTilda_/nu(); volScalarField chi = nuTilda_/nu();
//return scalar(1) - chi/(scalar(1) + chi*fv1());
return 1.0/pow3(scalar(1) + chi/Cv2_); return 1.0/pow3(scalar(1) + chi/Cv2_);
} }
...@@ -73,18 +71,57 @@ tmp<volScalarField> SpalartAllmaras::fv3() const ...@@ -73,18 +71,57 @@ tmp<volScalarField> SpalartAllmaras::fv3() const
} }
tmp<volScalarField> SpalartAllmaras::fw(const volScalarField& Stilda) const tmp<volScalarField> SpalartAllmaras::calcS(const volTensorField& gradU)
{
return ::sqrt(2.0)*mag(skew(gradU));
}
tmp<volScalarField> SpalartAllmaras::calcSTilda(const volTensorField& gradU)
{
return fv3()*calcS(gradU) + fv2()*nuTilda_/sqr(kappa_*dTilda_);
}
tmp<volScalarField> SpalartAllmaras::r
(
const volScalarField& visc,
const volScalarField& S
) const
{ {
volScalarField r = min tmp<volScalarField> tr
( (
nuTilda_ new volScalarField
/( (
max(Stilda, dimensionedScalar("SMALL", Stilda.dimensions(), SMALL)) min
*sqr(kappa_*dTilda_) (
), visc
scalar(10.0) /(
max
(
S,
dimensionedScalar("SMALL", S.dimensions(), SMALL)
)
*sqr(kappa_*dTilda_)
+ dimensionedScalar
(
"ROOTVSMALL",
dimensionSet(0, 2 , -1, 0, 0),
ROOTVSMALL
)
),
scalar(10.0)
)
)
); );
r.boundaryField() == 0.0;
return tr;
}
tmp<volScalarField> SpalartAllmaras::fw(const volScalarField& S) const
{
volScalarField r = this->r(nuTilda_, S);
volScalarField g = r + Cw2_*(pow6(r) - r); volScalarField g = r + Cw2_*(pow6(r) - r);
...@@ -92,17 +129,26 @@ tmp<volScalarField> SpalartAllmaras::fw(const volScalarField& Stilda) const ...@@ -92,17 +129,26 @@ tmp<volScalarField> SpalartAllmaras::fw(const volScalarField& Stilda) const
} }
void SpalartAllmaras::dTildaUpdate(const volScalarField&)
{
if (mesh_.changing())
{
dTilda_ = min(CDES_*delta(), wallDist(mesh_).y());
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
SpalartAllmaras::SpalartAllmaras SpalartAllmaras::SpalartAllmaras
( (
const volVectorField& U, const volVectorField& U,
const surfaceScalarField& phi, const surfaceScalarField& phi,
transportModel& transport transportModel& transport,
const word& modelName
) )
: :
LESModel(typeName, U, phi, transport), LESModel(modelName, U, phi, transport),
alphaNut_ alphaNut_
( (
...@@ -113,6 +159,15 @@ SpalartAllmaras::SpalartAllmaras ...@@ -113,6 +159,15 @@ SpalartAllmaras::SpalartAllmaras
1.5 1.5
) )
), ),
kappa_
(
dimensioned<scalar>::lookupOrAddToDict
(
"kappa",
*this,
0.4187
)
),
Cb1_ Cb1_
( (
dimensioned<scalar>::lookupOrAddToDict dimensioned<scalar>::lookupOrAddToDict
...@@ -167,15 +222,6 @@ SpalartAllmaras::SpalartAllmaras ...@@ -167,15 +222,6 @@ SpalartAllmaras::SpalartAllmaras
0.07 0.07
) )
), ),
kappa_
(
dimensioned<scalar>::lookupOrAddToDict
(
"kappa",
*this,
0.4187
)
),
Cw1_(Cb1_/sqr(kappa_) + alphaNut_*(1.0 + Cb2_)), Cw1_(Cb1_/sqr(kappa_) + alphaNut_*(1.0 + Cb2_)),
Cw2_ Cw2_
( (
...@@ -223,10 +269,7 @@ SpalartAllmaras::SpalartAllmaras ...@@ -223,10 +269,7 @@ SpalartAllmaras::SpalartAllmaras
), ),
mesh_ mesh_
) )
{ {}
printCoeffs();
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
...@@ -234,13 +277,11 @@ void SpalartAllmaras::correct(const tmp<volTensorField>& gradU) ...@@ -234,13 +277,11 @@ void SpalartAllmaras::correct(const tmp<volTensorField>& gradU)
{ {
LESModel::correct(gradU); LESModel::correct(gradU);
if (mesh_.changing()) const volScalarField STilda = calcSTilda(gradU);
{
dTilda_ = min(CDES_*delta(), wallDist(mesh_).y());
}
volScalarField Stilda = const volScalarField S = calcS(gradU);
fv3()*::sqrt(2.0)*mag(skew(gradU)) + fv2()*nuTilda_/sqr(kappa_*dTilda_);
dTildaUpdate(S);
solve solve
( (
...@@ -254,8 +295,8 @@ void SpalartAllmaras::correct(const tmp<volTensorField>& gradU) ...@@ -254,8 +295,8 @@ void SpalartAllmaras::correct(const tmp<volTensorField>& gradU)
) )
- alphaNut_*Cb2_*magSqr(fvc::grad(nuTilda_)) - alphaNut_*Cb2_*magSqr(fvc::grad(nuTilda_))
== ==
Cb1_*Stilda*nuTilda_ Cb1_*STilda*nuTilda_
- fvm::Sp(Cw1_*fw(Stilda)*nuTilda_/sqr(dTilda_), nuTilda_) - fvm::Sp(Cw1_*fw(STilda)*nuTilda_/sqr(dTilda_), nuTilda_)
); );
bound(nuTilda_, dimensionedScalar("zero", nuTilda_.dimensions(), 0.0)); bound(nuTilda_, dimensionedScalar("zero", nuTilda_.dimensions(), 0.0));
...@@ -268,7 +309,7 @@ void SpalartAllmaras::correct(const tmp<volTensorField>& gradU) ...@@ -268,7 +309,7 @@ void SpalartAllmaras::correct(const tmp<volTensorField>& gradU)
tmp<volScalarField> SpalartAllmaras::epsilon() const tmp<volScalarField> SpalartAllmaras::epsilon() const
{ {
return 2*nuEff()*magSqr(symm(fvc::grad(U()))); return 2.0*nuEff()*magSqr(symm(fvc::grad(U())));
} }
...@@ -298,16 +339,16 @@ bool SpalartAllmaras::read() ...@@ -298,16 +339,16 @@ bool SpalartAllmaras::read()
if (LESModel::read()) if (LESModel::read())
{ {
alphaNut_.readIfPresent(coeffDict()); alphaNut_.readIfPresent(coeffDict());
kappa_.readIfPresent(*this);
Cb1_.readIfPresent(coeffDict()); Cb1_.readIfPresent(coeffDict());
Cb2_.readIfPresent(coeffDict()); Cb2_.readIfPresent(coeffDict());
Cw1_ = Cb1_/sqr(kappa_) + alphaNut_*(1.0 + Cb2_);
Cw2_.readIfPresent(coeffDict());
Cw3_.readIfPresent(coeffDict());
Cv1_.readIfPresent(coeffDict()); Cv1_.readIfPresent(coeffDict());
Cv2_.readIfPresent(coeffDict()); Cv2_.readIfPresent(coeffDict());
CDES_.readIfPresent(coeffDict()); CDES_.readIfPresent(coeffDict());
ck_.readIfPresent(coeffDict()); ck_.readIfPresent(coeffDict());
kappa_.readIfPresent(*this); Cw1_ = Cb1_/sqr(kappa_) + alphaNut_*(1.0 + Cb2_);
Cw2_.readIfPresent(coeffDict());
Cw3_.readIfPresent(coeffDict());
return true; return true;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
...@@ -23,10 +23,10 @@ License ...@@ -23,10 +23,10 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class Class
Foam::incompressible::LESModels::SpalartAllmaras Foam::LESmodels::SpalartAllmaras
Description Description
SpalartAllmaras for incompressible flows SpalartAllmaras DES (SA + LES) turbulence model for incompressible flows
SourceFiles SourceFiles
SpalartAllmaras.C SpalartAllmaras.C
...@@ -49,43 +49,67 @@ namespace LESModels ...@@ -49,43 +49,67 @@ namespace LESModels
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class SpalartAllmaras Declaration Class SpalartAllmaras Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class SpalartAllmaras class SpalartAllmaras
: :
public LESModel public LESModel
{ {
// Private data // Private member functions
dimensionedScalar alphaNut_; // Disallow default bitwise copy construct and assignment
SpalartAllmaras(const SpalartAllmaras&);
SpalartAllmaras& operator=(const SpalartAllmaras&);
dimensionedScalar Cb1_;
dimensionedScalar Cb2_; protected:
dimensionedScalar Cv1_;
dimensionedScalar Cv2_; // Protected data
dimensionedScalar CDES_;
dimensionedScalar ck_; dimensionedScalar alphaNut_;
dimensionedScalar kappa_; dimensionedScalar kappa_;
dimensionedScalar Cw1_;
dimensionedScalar Cw2_;
dimensionedScalar Cw3_;
// Private member functions // Model constants
tmp<volScalarField> fv1() const; dimensionedScalar Cb1_;
tmp<volScalarField> fv2() const; dimensionedScalar Cb2_;
tmp<volScalarField> fv3() const; dimensionedScalar Cv1_;
tmp<volScalarField> fw(const volScalarField& Stilda) const; dimensionedScalar Cv2_;
dimensionedScalar CDES_;
dimensionedScalar ck_;
dimensionedScalar Cw1_;
dimensionedScalar Cw2_;
dimensionedScalar Cw3_;
// Disallow default bitwise copy construct and assignment
SpalartAllmaras(const SpalartAllmaras&);
SpalartAllmaras& operator=(const SpalartAllmaras&);
volScalarField nuTilda_; // Fields
volScalarField dTilda_;
volScalarField nuSgs_; volScalarField nuTilda_;
volScalarField dTilda_;
volScalarField nuSgs_;
// Protected member functions
// Helper functions
virtual tmp<volScalarField> fv1() const;
virtual tmp<volScalarField> fv2() const;
virtual tmp<volScalarField> fv3() const;
//-
virtual tmp<volScalarField> calcS(const volTensorField& gradU);
virtual tmp<volScalarField> calcSTilda(const volTensorField& gradU);
virtual tmp<volScalarField> r
(
const volScalarField& visc,
const volScalarField& S
) const;
virtual tmp<volScalarField> fw(const volScalarField& S) const;
//- Length scale calculation
virtual void dTildaUpdate(const volScalarField& S);
public: public:
...@@ -101,13 +125,14 @@ public: ...@@ -101,13 +125,14 @@ public:
( (
const volVectorField& U, const volVectorField& U,
const surfaceScalarField& phi, const surfaceScalarField& phi,
transportModel& transport transportModel& transport,
const word& modelName = typeName
); );
// Destructor // Destructor
~SpalartAllmaras() virtual ~SpalartAllmaras()
{} {}
...@@ -145,10 +170,10 @@ public: ...@@ -145,10 +170,10 @@ public:
tmp<fvVectorMatrix> divDevBeff(volVectorField& U) const; tmp<fvVectorMatrix> divDevBeff(volVectorField& U) const;
//- Correct nuTilda and related properties //- Correct nuTilda and related properties
void correct(const tmp<volTensorField>& gradU); virtual void correct(const tmp<volTensorField>& gradU);
//- Read turbulenceProperties dictionary //- Read turbulenceProperties dictionary
bool read(); virtual bool read();
}; };
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment