Merge branch 'master' of /home/noisy3/OpenFOAM/OpenFOAM-dev

This commit is contained in:
mattijs
2009-02-02 12:24:44 +00:00
38 changed files with 287 additions and 78 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(rho()*nuTilda_/mu());
@ -223,6 +230,8 @@ SpalartAllmaras::SpalartAllmaras
)
{
updateSubGridScaleFields();
printCoeffs();
}
@ -286,10 +295,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&);

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
@ -265,7 +274,10 @@ SpalartAllmaras::SpalartAllmaras
),
mesh_
)
{}
{
updateSubGridScaleFields();
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
@ -305,8 +317,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&);