mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
corrected initialisation of sub-grid scale fields - compressible
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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&);
|
||||
|
||||
@ -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());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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&);
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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&);
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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&);
|
||||
|
||||
Reference in New Issue
Block a user