corrected initialisation of sub-grid scale fields - compressible

This commit is contained in:
andy
2009-01-30 16:37:03 +00:00
parent 6c278d6fea
commit 534d06054e
12 changed files with 102 additions and 28 deletions

View File

@ -41,6 +41,16 @@ namespace LESModels
defineTypeNameAndDebug(DeardorffDiffStress, 0);
addToRunTimeSelectionTable(LESModel, DeardorffDiffStress, dictionary);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void DeardorffDiffStress::updateSubGridScaleFields(const volScalarField& K)
{
muSgs_ = ck_*rho()*sqrt(K)*delta();
muSgs_.correctBoundaryConditions();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
DeardorffDiffStress::DeardorffDiffStress
@ -73,6 +83,8 @@ DeardorffDiffStress::DeardorffDiffStress
)
)
{
updateSubGridScaleFields(0.5*tr(B_));
printCoeffs();
}
@ -119,8 +131,7 @@ void DeardorffDiffStress::correct(const tmp<volTensorField>& tgradU)
K = 0.5*tr(B_);
bound(K, k0());
muSgs_ = ck_*rho()*sqrt(K)*delta();
muSgs_.correctBoundaryConditions();
updateSubGridScaleFields(K);
}

View File

@ -81,6 +81,9 @@ class DeardorffDiffStress
// Private Member Functions
//- Update sub-grid scale fields
void updateSubGridScaleFields(const volScalarField& K);
// Disallow default bitwise copy construct and assignment
DeardorffDiffStress(const DeardorffDiffStress&);
DeardorffDiffStress& operator=(const DeardorffDiffStress&);

View File

@ -41,6 +41,24 @@ namespace LESModels
defineTypeNameAndDebug(Smagorinsky, 0);
addToRunTimeSelectionTable(LESModel, Smagorinsky, dictionary);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Smagorinsky::updateSubGridScaleFields(const volTensorField& gradU)
{
volSymmTensorField D = symm(gradU);
volScalarField a = ce_/delta();
volScalarField b = (2.0/3.0)*tr(D);
volScalarField c = 2*ck_*delta()*(dev(D) && D);
k_ = sqr((-b + sqrt(sqr(b) + 4*a*c))/(2*a));
muSgs_ = ck_*rho()*delta()*sqrt(k_);
muSgs_.correctBoundaryConditions();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Smagorinsky::Smagorinsky
@ -64,6 +82,8 @@ Smagorinsky::Smagorinsky
)
)
{
updateSubGridScaleFields(fvc::grad(U));
printCoeffs();
}
@ -73,17 +93,7 @@ Smagorinsky::Smagorinsky
void Smagorinsky::correct(const tmp<volTensorField>& gradU)
{
GenEddyVisc::correct(gradU);
volSymmTensorField D = symm(gradU);
volScalarField a = ce_/delta();
volScalarField b = (2.0/3.0)*tr(D);
volScalarField c = 2*ck_*delta()*(dev(D) && D);
k_ = sqr((-b + sqrt(sqr(b) + 4*a*c))/(2*a));
muSgs_ = ck_*rho()*delta()*sqrt(k_);
muSgs_.correctBoundaryConditions();
updateSubGridScaleFields(gradU());
}

View File

@ -76,6 +76,9 @@ class Smagorinsky
// Private Member Functions
//- Update sub-grid scale fields
void updateSubGridScaleFields(const volTensorField& gradU);
// Disallow default bitwise copy construct and assignment
Smagorinsky(const Smagorinsky&);
Smagorinsky& operator=(const Smagorinsky&);

View File

@ -45,6 +45,13 @@ addToRunTimeSelectionTable(LESModel, SpalartAllmaras, dictionary);
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
void SpalartAllmaras::updateSubGridScaleFields()
{
muSgs_.internalField() = rho()*fv1()*nuTilda_.internalField();
muSgs_.correctBoundaryConditions();
}
tmp<volScalarField> SpalartAllmaras::fv1() const
{
volScalarField chi3 = pow3(nuTilda_/(mu()/rho()));
@ -225,6 +232,8 @@ SpalartAllmaras::SpalartAllmaras
)
{
updateSubGridScaleFields();
printCoeffs();
}
@ -288,10 +297,9 @@ void SpalartAllmaras::correct(const tmp<volTensorField>& tgradU)
);
bound(nuTilda_, dimensionedScalar("zero", nuTilda_.dimensions(), 0.0));
nuTilda_.correctBoundaryConditions();
muSgs_.internalField() = rho()*fv1()*nuTilda_.internalField();
muSgs_.correctBoundaryConditions();
updateSubGridScaleFields();
}

View File

@ -49,7 +49,7 @@ namespace LESModels
{
/*---------------------------------------------------------------------------*\
Class SpalartAllmaras Declaration
Class SpalartAllmaras Declaration
\*---------------------------------------------------------------------------*/
class SpalartAllmaras
@ -74,6 +74,9 @@ class SpalartAllmaras
// Private member functions
//- Update sub-grid scale fields
void updateSubGridScaleFields();
tmp<volScalarField> fv1() const;
tmp<volScalarField> fv2() const;
tmp<volScalarField> fv3() const;

View File

@ -43,6 +43,13 @@ addToRunTimeSelectionTable(LESModel, dynOneEqEddy, dictionary);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void dynOneEqEddy::updateSubGridScaleFields(const volSymmTensorField& D)
{
muSgs_ = ck_(D)*rho()*sqrt(k_)*delta();
muSgs_.correctBoundaryConditions();
}
dimensionedScalar dynOneEqEddy::ck_(const volSymmTensorField& D) const
{
volScalarField KK = 0.5*(filter_(magSqr(U())) - magSqr(filter_(U())));
@ -90,6 +97,8 @@ dynOneEqEddy::dynOneEqEddy
filterPtr_(LESfilter::New(U.mesh(), coeffDict())),
filter_(filterPtr_())
{
updateSubGridScaleFields(dev(symm(fvc::grad(U))));
printCoeffs();
}
@ -119,8 +128,7 @@ void dynOneEqEddy::correct(const tmp<volTensorField>& tgradU)
bound(k_, dimensionedScalar("0", k_.dimensions(), 1.0e-10));
muSgs_ = ck_(D)*rho()*sqrt(k_)*delta();
muSgs_.correctBoundaryConditions();
updateSubGridScaleFields(D);
}

View File

@ -82,6 +82,9 @@ class dynOneEqEddy
// Private Member Functions
//- Update sub-grid scale fields
void updateSubGridScaleFields(const volSymmTensorField& D);
//- Calculate ck, ce by filtering the velocity field U.
dimensionedScalar ck_(const volSymmTensorField& D) const;
dimensionedScalar ce_(const volSymmTensorField& D) const;

View File

@ -41,6 +41,19 @@ namespace LESModels
defineTypeNameAndDebug(lowReOneEqEddy, 0);
addToRunTimeSelectionTable(LESModel, lowReOneEqEddy, dictionary);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void lowReOneEqEddy::updateSubGridScaleFields()
{
// High Re eddy viscosity
muSgs_ = ck_*rho()*sqrt(k_)*delta();
// low Re no corrected eddy viscosity
muSgs_ -= (mu()/beta_)*(scalar(1) - exp(-beta_*muSgs_/mu()));
muSgs_.correctBoundaryConditions();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
lowReOneEqEddy::lowReOneEqEddy
@ -73,6 +86,8 @@ lowReOneEqEddy::lowReOneEqEddy
)
)
{
updateSubGridScaleFields();
printCoeffs();
}
@ -101,13 +116,7 @@ void lowReOneEqEddy::correct(const tmp<volTensorField>& tgradU)
bound(k_, k0());
// High Re eddy viscosity
muSgs_ = ck_*rho()*sqrt(k_)*delta();
// low Re no corrected eddy viscosity
muSgs_ -= (mu()/beta_)*(scalar(1) - exp(-beta_*muSgs_/mu()));
muSgs_.correctBoundaryConditions();
updateSubGridScaleFields();
}

View File

@ -77,6 +77,9 @@ class lowReOneEqEddy
// Private Member Functions
//- Update sub-grid scale fields
void updateSubGridScaleFields();
// Disallow default bitwise copy construct and assignment
lowReOneEqEddy(const lowReOneEqEddy&);
lowReOneEqEddy& operator=(const lowReOneEqEddy&);

View File

@ -41,6 +41,15 @@ namespace LESModels
defineTypeNameAndDebug(oneEqEddy, 0);
addToRunTimeSelectionTable(LESModel, oneEqEddy, dictionary);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void oneEqEddy::updateSubGridScaleFields()
{
muSgs_ = ck_*rho()*sqrt(k_)*delta();
muSgs_.correctBoundaryConditions();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
oneEqEddy::oneEqEddy
@ -64,6 +73,8 @@ oneEqEddy::oneEqEddy
)
)
{
updateSubGridScaleFields();
printCoeffs();
}
@ -95,8 +106,7 @@ void oneEqEddy::correct(const tmp<volTensorField>& tgradU)
bound(k_, k0());
muSgs_ = ck_*rho()*sqrt(k_)*delta();
muSgs_.correctBoundaryConditions();
updateSubGridScaleFields();
}

View File

@ -80,6 +80,9 @@ class oneEqEddy
// Private Member Functions
//- Update sub-grid scale fields
void updateSubGridScaleFields();
// Disallow default bitwise copy construct and assignment
oneEqEddy(const oneEqEddy&);
oneEqEddy& operator=(const oneEqEddy&);