corrected initialisation of sub-grid scale fields

This commit is contained in:
andy
2009-01-30 16:18:38 +00:00
parent 9b9bef99e7
commit 6c278d6fea
22 changed files with 174 additions and 43 deletions

View File

@ -41,6 +41,15 @@ namespace LESModels
defineTypeNameAndDebug(DeardorffDiffStress, 0);
addToRunTimeSelectionTable(LESModel, DeardorffDiffStress, dictionary);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void DeardorffDiffStress::updateSubGridScaleFields(const volScalarField& K)
{
nuSgs_ = ck_*sqrt(K)*delta();
nuSgs_.correctBoundaryConditions();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
DeardorffDiffStress::DeardorffDiffStress
@ -72,6 +81,8 @@ DeardorffDiffStress::DeardorffDiffStress
)
)
{
updateSubGridScaleFields(0.5*tr(B_));
printCoeffs();
}
@ -121,8 +132,7 @@ void DeardorffDiffStress::correct(const tmp<volTensorField>& tgradU)
K = 0.5*tr(B_);
bound(K, k0());
nuSgs_ = ck_*sqrt(K)*delta();
nuSgs_.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,15 @@ namespace LESModels
defineTypeNameAndDebug(LRRDiffStress, 0);
addToRunTimeSelectionTable(LESModel, LRRDiffStress, dictionary);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void LRRDiffStress::updateSubGridScaleFields(const volScalarField& K)
{
nuSgs_ = ck_*sqrt(K)*delta();
nuSgs_.correctBoundaryConditions();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
LRRDiffStress::LRRDiffStress
@ -81,6 +90,8 @@ LRRDiffStress::LRRDiffStress
)
)
{
updateSubGridScaleFields(0.5*tr(B_));
printCoeffs();
}
@ -131,8 +142,7 @@ void LRRDiffStress::correct(const tmp<volTensorField>& tgradU)
K = 0.5*tr(B_);
bound(K, k0());
nuSgs_ = ck_*sqrt(K)*delta();
nuSgs_.correctBoundaryConditions();
updateSubGridScaleFields(K);
}

View File

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

View File

@ -41,6 +41,15 @@ namespace LESModels
defineTypeNameAndDebug(Smagorinsky, 0);
addToRunTimeSelectionTable(LESModel, Smagorinsky, dictionary);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Smagorinsky::updateSubGridScaleFields(const volTensorField& gradU)
{
nuSgs_ = ck_*delta()*sqrt(k(gradU));
nuSgs_.correctBoundaryConditions();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Smagorinsky::Smagorinsky
@ -62,7 +71,9 @@ Smagorinsky::Smagorinsky
0.094
)
)
{}
{
updateSubGridScaleFields(fvc::grad(U));
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
@ -70,9 +81,7 @@ Smagorinsky::Smagorinsky
void Smagorinsky::correct(const tmp<volTensorField>& gradU)
{
GenEddyVisc::correct(gradU);
nuSgs_ = ck_*delta()*sqrt(k(gradU));
nuSgs_.correctBoundaryConditions();
updateSubGridScaleFields(gradU());
}

View File

@ -77,6 +77,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

@ -41,6 +41,15 @@ namespace LESModels
defineTypeNameAndDebug(SpalartAllmaras, 0);
addToRunTimeSelectionTable(LESModel, SpalartAllmaras, dictionary);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void SpalartAllmaras::updateSubGridScaleFields()
{
nuSgs_.internalField() = fv1()*nuTilda_.internalField();
nuSgs_.correctBoundaryConditions();
}
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
tmp<volScalarField> SpalartAllmaras::fv1() const
@ -266,7 +275,10 @@ SpalartAllmaras::SpalartAllmaras
),
mesh_
)
{}
{
updateSubGridScaleFields();
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
@ -306,8 +318,7 @@ void SpalartAllmaras::correct(const tmp<volTensorField>& gradU)
bound(nuTilda_, dimensionedScalar("zero", nuTilda_.dimensions(), 0.0));
nuTilda_.correctBoundaryConditions();
nuSgs_.internalField() = fv1()*nuTilda_.internalField();
nuSgs_.correctBoundaryConditions();
updateSubGridScaleFields();
}

View File

@ -59,6 +59,9 @@ class SpalartAllmaras
{
// Private member functions
//- Update sub-grid scale fields
void updateSubGridScaleFields();
// Disallow default bitwise copy construct and assignment
SpalartAllmaras(const SpalartAllmaras&);
SpalartAllmaras& operator=(const SpalartAllmaras&);

View File

@ -44,7 +44,7 @@ void Foam::IDDESDelta::calcDelta()
const Vector<label>& directions = mesh().directions();
label nD = (directions.nComponents + cmptSum(directions))/2;
// - Init hwn as wall distant.
// initialise hwn as wall distance
volScalarField hwn = wallDist(mesh()).y();
scalar deltamaxTmp = 0.;

View File

@ -113,7 +113,7 @@ tmp<fvVectorMatrix> dynMixedSmagorinsky::divDevBeff(volVectorField& U) const
void dynMixedSmagorinsky::correct(const tmp<volTensorField>& gradU)
{
scaleSimilarity::correct(gradU);
dynSmagorinsky::correct(gradU);
dynSmagorinsky::correct(gradU());
}

View File

@ -43,6 +43,13 @@ addToRunTimeSelectionTable(LESModel, dynOneEqEddy, dictionary);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void dynOneEqEddy::updateSubGridScaleFields(const volSymmTensorField& D)
{
nuSgs_ = ck(D)*sqrt(k_)*delta();
nuSgs_.correctBoundaryConditions();
}
dimensionedScalar dynOneEqEddy::ck(const volSymmTensorField& D) const
{
volScalarField KK = 0.5*(filter_(magSqr(U())) - magSqr(filter_(U())));
@ -120,6 +127,8 @@ dynOneEqEddy::dynOneEqEddy
filterPtr_(LESfilter::New(U.mesh(), coeffDict())),
filter_(filterPtr_())
{
updateSubGridScaleFields(symm(fvc::grad(U)));
printCoeffs();
}
@ -155,8 +164,7 @@ void dynOneEqEddy::correct(const tmp<volTensorField>& gradU)
bound(k_, k0());
nuSgs_ = ck(D)*sqrt(k_)*delta();
nuSgs_.correctBoundaryConditions();
updateSubGridScaleFields(D);
}

View File

@ -87,6 +87,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

@ -43,6 +43,13 @@ addToRunTimeSelectionTable(LESModel, dynSmagorinsky, dictionary);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void dynSmagorinsky::updateSubGridScaleFields(const volSymmTensorField& D)
{
nuSgs_ = cD(D)*sqr(delta())*sqrt(magSqr(D));
nuSgs_.correctBoundaryConditions();
}
dimensionedScalar dynSmagorinsky::cD(const volSymmTensorField& D) const
{
volSymmTensorField LL = dev(filter_(sqr(U())) - (sqr(filter_(U()))));
@ -111,6 +118,8 @@ dynSmagorinsky::dynSmagorinsky
filterPtr_(LESfilter::New(U.mesh(), coeffDict())),
filter_(filterPtr_())
{
updateSubGridScaleFields(dev(symm(fvc::grad(U))));
printCoeffs();
}
@ -128,12 +137,10 @@ void dynSmagorinsky::correct(const tmp<volTensorField>& gradU)
LESModel::correct(gradU);
volSymmTensorField D = dev(symm(gradU));
volScalarField magSqrD = magSqr(D);
k_ = cI(D)*sqr(delta())*magSqrD;
k_ = cI(D)*sqr(delta())*magSqr(D);
nuSgs_ = cD(D)*sqr(delta())*sqrt(magSqrD);
nuSgs_.correctBoundaryConditions();
updateSubGridScaleFields(D);
}

View File

@ -96,6 +96,9 @@ class dynSmagorinsky
// Private Member Functions
//- Update sub-grid scale fields
void updateSubGridScaleFields(const volSymmTensorField& D);
//- Calculate coefficients cD, cI from filtering velocity field
dimensionedScalar cD(const volSymmTensorField& D) const;
dimensionedScalar cI(const volSymmTensorField& D) const;

View File

@ -44,6 +44,13 @@ addToRunTimeSelectionTable(LESModel, kOmegaSSTSAS, dictionary);
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
void kOmegaSSTSAS::updateSubGridScaleFields(const volScalarField& S2)
{
nuSgs_ == a1_*k_/max(a1_*omega_, F2()*sqrt(S2));
nuSgs_.correctBoundaryConditions();
}
tmp<volScalarField> kOmegaSSTSAS::F1(const volScalarField& CDkOmega) const
{
volScalarField CDkOmegaPlus = max
@ -304,6 +311,8 @@ kOmegaSSTSAS::kOmegaSSTSAS
mesh_
)
{
updateSubGridScaleFields(magSqr(symm(fvc::grad(U))));
printCoeffs();
}
@ -325,7 +334,8 @@ void kOmegaSSTSAS::correct(const tmp<volTensorField>& gradU)
volVectorField gradK = fvc::grad(k_);
volVectorField gradOmega = fvc::grad(omega_);
volScalarField L = sqrt(k_)/(pow(Cmu_, 0.25)*(omega_ + omegaSmall_));
volScalarField CDkOmega = (2.0*alphaOmega2_)*(gradK & gradOmega)/(omega_ + omegaSmall_);
volScalarField CDkOmega =
(2.0*alphaOmega2_)*(gradK & gradOmega)/(omega_ + omegaSmall_);
volScalarField F1 = this->F1(CDkOmega);
volScalarField G = nuSgs_*2.0*S2;
@ -375,7 +385,8 @@ void kOmegaSSTSAS::correct(const tmp<volTensorField>& gradU)
*max
(
dimensionedScalar("zero",dimensionSet(0, 0 , -2, 0, 0),0. ),
zetaTilda2_*kappa_*S2*(L/Lvk2(S2))- 2.0/alphaPhi_*k_*grad_omega_k
zetaTilda2_*kappa_*S2*(L/Lvk2(S2))
- 2.0/alphaPhi_*k_*grad_omega_k
)
);
@ -384,9 +395,7 @@ void kOmegaSSTSAS::correct(const tmp<volTensorField>& gradU)
}
bound(omega_, omega0_);
// Re-calculate viscosity
nuSgs_ == a1_*k_/max(a1_*omega_, F2()*sqrt(S2));
nuSgs_.correctBoundaryConditions();
updateSubGridScaleFields(S2);
}

View File

@ -62,6 +62,9 @@ class kOmegaSSTSAS
{
// Private member functions
//- Update sub-grid scale fields
void updateSubGridScaleFields(const volScalarField& D);
// Disallow default bitwise copy construct and assignment
kOmegaSSTSAS(const kOmegaSSTSAS&);
kOmegaSSTSAS& operator=(const kOmegaSSTSAS&);
@ -237,7 +240,8 @@ public:
// i.e. the additional term in the filtered NSE.
virtual tmp<fvVectorMatrix> divDevBeff(volVectorField& U) const;
//- Solve the turbulence equations (k-w) and correct the turbulence viscosity
//- Solve the turbulence equations (k-w) and correct the turbulence
// viscosity
virtual void correct(const tmp<volTensorField>& gradU);
//- Read turbulenceProperties dictionary

View File

@ -43,6 +43,17 @@ addToRunTimeSelectionTable(LESModel, locDynOneEqEddy, dictionary);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void locDynOneEqEddy::updateSubGridScaleFields
(
const volSymmTensorField& D,
const volScalarField& KK
)
{
nuSgs_ = ck(D, KK)*sqrt(k_)*delta();
nuSgs_.correctBoundaryConditions();
}
volScalarField locDynOneEqEddy::ck
(
const volSymmTensorField& D,
@ -108,6 +119,9 @@ locDynOneEqEddy::locDynOneEqEddy
filterPtr_(LESfilter::New(U.mesh(), coeffDict())),
filter_(filterPtr_())
{
volScalarField KK = 0.5*(filter_(magSqr(U)) - magSqr(filter_(U)));
updateSubGridScaleFields(symm(fvc::grad(U)), KK);
printCoeffs();
}
@ -146,8 +160,7 @@ void locDynOneEqEddy::correct(const tmp<volTensorField>& gradU)
bound(k_, k0());
nuSgs_ = ck(D, KK)*sqrt(k_)*delta();
nuSgs_.correctBoundaryConditions();
updateSubGridScaleFields(D, KK);
}

View File

@ -96,6 +96,13 @@ class locDynOneEqEddy
// Private Member Functions
//- Update sub-grid scale fields
void updateSubGridScaleFields
(
const volSymmTensorField& D,
const volScalarField& KK
);
//- Calculate ck, ce by filtering the velocity field U.
volScalarField ck
(

View File

@ -41,6 +41,16 @@ namespace LESModels
defineTypeNameAndDebug(oneEqEddy, 0);
addToRunTimeSelectionTable(LESModel, oneEqEddy, dictionary);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void oneEqEddy::updateSubGridScaleFields()
{
nuSgs_ = ck_*sqrt(k_)*delta();
nuSgs_.correctBoundaryConditions();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
oneEqEddy::oneEqEddy
@ -76,6 +86,8 @@ oneEqEddy::oneEqEddy
)
)
{
updateSubGridScaleFields();
printCoeffs();
}
@ -103,8 +115,7 @@ void oneEqEddy::correct(const tmp<volTensorField>& gradU)
bound(k_, k0());
nuSgs_ = ck_*sqrt(k_)*delta();
nuSgs_.correctBoundaryConditions();
updateSubGridScaleFields();
}

View File

@ -83,6 +83,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&);

View File

@ -41,6 +41,25 @@ namespace LESModels
defineTypeNameAndDebug(spectEddyVisc, 0);
addToRunTimeSelectionTable(LESModel, spectEddyVisc, dictionary);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void spectEddyVisc::updateSubGridScaleFields(const volTensorField& gradU)
{
volScalarField Re = sqr(delta())*mag(symm(gradU))/nu();
for (label i=0; i<5; i++)
{
nuSgs_ =
nu()
/(
scalar(1)
- exp(-cB_*pow(nu()/(nuSgs_ + nu()), 1.0/3.0)*pow(Re, -2.0/3.0))
);
}
nuSgs_.correctBoundaryConditions();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
spectEddyVisc::spectEddyVisc
@ -101,6 +120,8 @@ spectEddyVisc::spectEddyVisc
)
{
printCoeffs();
updateSubGridScaleFields(fvc::grad(U));
}
@ -121,20 +142,7 @@ tmp<volScalarField> spectEddyVisc::k() const
void spectEddyVisc::correct(const tmp<volTensorField>& gradU)
{
GenEddyVisc::correct(gradU);
volScalarField Re = sqr(delta())*mag(symm(gradU))/nu();
for (label i=0; i<5; i++)
{
nuSgs_ =
nu()
/(
scalar(1)
- exp(-cB_*pow(nu()/(nuSgs_ + nu()), 1.0/3.0)*pow(Re, -2.0/3.0))
);
}
nuSgs_.correctBoundaryConditions();
updateSubGridScaleFields(gradU());
}

View File

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