STYLE: various simplifications and changes

BUG: DEShybrid: reintroduce e28bed59
This commit is contained in:
Kutalmis Bercin
2022-09-07 14:51:42 +01:00
committed by Andrew Heather
parent 493bfdbdc4
commit 3a4537abc9
25 changed files with 389 additions and 307 deletions

View File

@ -30,7 +30,7 @@ Class
Description Description
Improved hybrid convection scheme of Travin et al. for hybrid RAS/LES Improved hybrid convection scheme of Travin et al. for hybrid RAS/LES
calculations with enhanced GAM behaviour. calculations with enhanced Grey Area Mitigation (GAM) behaviour.
The scheme provides a blend between two convection schemes, based on local The scheme provides a blend between two convection schemes, based on local
properties including the wall distance, velocity gradient and eddy properties including the wall distance, velocity gradient and eddy
@ -55,25 +55,26 @@ Description
First published in: First published in:
\verbatim \verbatim
A. Travin, M. Shur, M. Strelets, P. Spalart (2000). Travin, A., Shur, M., Strelets, M., & Spalart, P. R. (2000).
Physical and numerical upgrades in the detached-eddy simulation of Physical and numerical upgrades in the detached-eddy
complex turbulent flows. simulation of complex turbulent flows.
In Proceedings of the 412th Euromech Colloquium on LES and Complex In LES of Complex Transitional and Turbulent Flows.
Transition and Turbulent Flows, Munich, Germany Proceedings of the Euromech Colloquium 412. Munich, Germany
\endverbatim \endverbatim
Original publication contained a typo for C_H3 constant. Corrected version Original publication contained a typo for \c C_H3 constant.
with minor changes for 2 lower limiters published in: Corrected version with minor changes for 2 lower limiters published in:
\verbatim \verbatim
P. Spalart, M. Shur, M. Strelets, A. Travin (2012). Spalart, P., Shur, M., Strelets, M., & Travin, A. (2012).
Sensitivity of Landing-Gear Noise Predictions by Large-Eddy Sensitivity of landing-gear noise predictions by large-eddy
Simulation to Numerics and Resolution. simulation to numerics and resolution.
AIAA Paper 2012-1174, 50th AIAA Aerospace Sciences Meeting, In 50th AIAA Aerospace Sciences Meeting Including the
Nashville / TN, Jan. 2012 New Horizons Forum and Aerospace Exposition. Nashville, US.
DOI:10.2514/6.2012-1174
\endverbatim \endverbatim
Example of the DEShybrid scheme specification using linear within the LES Example of the \c DEShybrid scheme specification using \c linear
region and linearUpwind within the RAS region: within the LES region and \c linearUpwind within the RAS region:
\verbatim \verbatim
divSchemes divSchemes
{ {
@ -100,12 +101,12 @@ Notes
be used in the detached/vortex shedding regions. be used in the detached/vortex shedding regions.
- Scheme 2 should be an upwind/deferred correction/TVD scheme which will - Scheme 2 should be an upwind/deferred correction/TVD scheme which will
be used in the free-stream/Euler/boundary layer regions. be used in the free-stream/Euler/boundary layer regions.
- the scheme is compiled into a separate library, and not available to - The scheme is compiled into a separate library, and not available to
solvers by default. In order to use the scheme, add the library as a solvers by default. In order to use the scheme, add the library as a
run-time loaded library in the \$FOAM\_CASE/system/controlDict run-time loaded library in the \$FOAM\_CASE/system/controlDict
dictionary, e.g.: dictionary, e.g.:
\verbatim \verbatim
libs ("libturbulenceModelSchemes.so"); libs (turbulenceModelSchemes);
\endverbatim \endverbatim
SourceFiles SourceFiles
@ -187,6 +188,7 @@ class DEShybrid
// Private Member Functions // Private Member Functions
//- Check the scheme coefficients
void checkValues() void checkValues()
{ {
if (U0_.value() <= 0) if (U0_.value() <= 0)
@ -231,8 +233,8 @@ class DEShybrid
Info<< type() << "coefficients:" << nl Info<< type() << "coefficients:" << nl
<< " delta : " << deltaName_ << nl << " delta : " << deltaName_ << nl
<< " CDES : " << CDES_ << nl << " CDES : " << CDES_ << nl
<< " U0 : " << U0_ << nl << " U0 : " << U0_.value() << nl
<< " LO : " << L0_ << nl << " L0 : " << L0_.value() << nl
<< " sigmaMin : " << sigmaMin_ << nl << " sigmaMin : " << sigmaMin_ << nl
<< " sigmaMax : " << sigmaMax_ << nl << " sigmaMax : " << sigmaMax_ << nl
<< " OmegaLim : " << OmegaLim_ << nl << " OmegaLim : " << OmegaLim_ << nl
@ -256,63 +258,95 @@ class DEShybrid
const volScalarField& delta const volScalarField& delta
) const ) const
{ {
tmp<volTensorField> gradU(fvc::grad(U)); tmp<volTensorField> tgradU = fvc::grad(U);
const volScalarField S(sqrt(2.0)*mag(symm(gradU()))); const volTensorField& gradU = tgradU.cref();
const volScalarField Omega(sqrt(2.0)*mag(skew(gradU()))); const volScalarField S(sqrt(2.0)*mag(symm(gradU)));
const volScalarField Omega(sqrt(2.0)*mag(skew(tgradU)));
const dimensionedScalar tau0_ = L0_/U0_; const dimensionedScalar tau0_ = L0_/U0_;
gradU.clear();
const volScalarField B tmp<volScalarField> tB =
(
CH3_*Omega*max(S, Omega) CH3_*Omega*max(S, Omega)
/max(0.5*(sqr(S) + sqr(Omega)), sqr(OmegaLim_/tau0_)) /max(0.5*(sqr(S) + sqr(Omega)), sqr(OmegaLim_/tau0_));
);
const volScalarField K tmp<volScalarField> tg = tanh(pow4(tB));
(
max(Foam::sqrt(0.5*(sqr(S) + sqr(Omega))), 0.1/tau0_)
);
const volScalarField lTurb tmp<volScalarField> tK =
( max(Foam::sqrt(0.5*(sqr(S) + sqr(Omega))), 0.1/tau0_);
tmp<volScalarField> tlTurb =
Foam::sqrt Foam::sqrt
( (
max max
( (
(max(nut, min(sqr(Cs_*delta)*S, nutLim_*nut)) + nu) (max(nut, min(sqr(Cs_*delta)*S, nutLim_*nut)) + nu)
/(pow(0.09, 1.5)*K), /(pow(0.09, 1.5)*tK),
dimensionedScalar(sqr(dimLength), Zero) dimensionedScalar(sqr(dimLength), Zero)
) )
) );
);
const volScalarField g(tanh(pow4(B)));
const volScalarField A const volScalarField A
( (
CH2_*max CH2_*max
( (
scalar(0), scalar(0),
CDES_*delta/max(lTurb*g, SMALL*L0_) - 0.5 CDES_*delta/max(tlTurb*tg, SMALL*L0_) - 0.5
) )
); );
const volScalarField factor
const word factorName(IOobject::scopedName(typeName, "Factor"));
const fvMesh& mesh = this->mesh();
const IOobject factorIO
( (
IOobject::scopedName(typeName, "Factor"), factorName,
max(sigmaMax_*tanh(pow(A, CH1_)), sigmaMin_) mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
); );
if (blendedSchemeBaseName::debug) if (blendedSchemeBaseName::debug)
{ {
factor.write(); auto* factorPtr = mesh.getObjectPtr<volScalarField>(factorName);
}
return tmp<surfaceScalarField>::New if (!factorPtr)
( {
vf.name() + "BlendingFactor", factorPtr =
fvc::interpolate(factor) new volScalarField
); (
factorIO,
mesh,
dimensionedScalar(dimless, Zero)
);
const_cast<fvMesh&>(mesh).objectRegistry::store(factorPtr);
}
auto& factor = *factorPtr;
factor = max(sigmaMax_*tanh(pow(A, CH1_)), sigmaMin_);
return tmp<surfaceScalarField>::New
(
vf.name() + "BlendingFactor",
fvc::interpolate(factor)
);
}
else
{
const volScalarField factor
(
factorIO,
max(sigmaMax_*tanh(pow(A, CH1_)), sigmaMin_)
);
return tmp<surfaceScalarField>::New
(
vf.name() + "BlendingFactor",
fvc::interpolate(factor)
);
}
} }
@ -434,10 +468,10 @@ public:
//- Return the face-interpolate of the given cell field //- Return the face-interpolate of the given cell field
// with explicit correction //- with explicit correction
tmp<SurfaceFieldType> interpolate(const VolFieldType& vf) const tmp<SurfaceFieldType> interpolate(const VolFieldType& vf) const
{ {
surfaceScalarField bf(blendingFactor(vf)); const surfaceScalarField bf(blendingFactor(vf));
return return
(scalar(1) - bf)*tScheme1_().interpolate(vf) (scalar(1) - bf)*tScheme1_().interpolate(vf)
@ -498,4 +532,3 @@ public:
#endif #endif
// ************************************************************************* // // ************************************************************************* //

View File

@ -85,7 +85,8 @@ tmp<volScalarField> SpalartAllmarasBase<BasicEddyViscosityModel>::ft2
"ft2", "ft2",
this->runTime_.timeName(), this->runTime_.timeName(),
this->mesh_, this->mesh_,
IOobject::NO_READ IOobject::NO_READ,
IOobject::NO_WRITE
), ),
this->mesh_, this->mesh_,
dimensionedScalar(dimless, Zero) dimensionedScalar(dimless, Zero)
@ -111,7 +112,7 @@ tmp<volScalarField> SpalartAllmarasBase<BasicEddyViscosityModel>::r
const volScalarField& dTilda const volScalarField& dTilda
) const ) const
{ {
const dimensionedScalar eps("SMALL", Stilda.dimensions(), SMALL); const dimensionedScalar eps(Stilda.dimensions(), SMALL);
tmp<volScalarField> tr = tmp<volScalarField> tr =
min(nur/(max(Stilda, eps)*sqr(kappa_*dTilda)), scalar(10)); min(nur/(max(Stilda, eps)*sqr(kappa_*dTilda)), scalar(10));
@ -346,7 +347,7 @@ bool SpalartAllmarasBase<BasicEddyViscosityModel>::read()
if (BasicEddyViscosityModel::read()) if (BasicEddyViscosityModel::read())
{ {
sigmaNut_.readIfPresent(this->coeffDict()); sigmaNut_.readIfPresent(this->coeffDict());
kappa_.readIfPresent(*this); kappa_.readIfPresent(this->coeffDict());
Cb1_.readIfPresent(this->coeffDict()); Cb1_.readIfPresent(this->coeffDict());
Cb2_.readIfPresent(this->coeffDict()); Cb2_.readIfPresent(this->coeffDict());
@ -355,14 +356,13 @@ bool SpalartAllmarasBase<BasicEddyViscosityModel>::read()
Cw3_.readIfPresent(this->coeffDict()); Cw3_.readIfPresent(this->coeffDict());
Cv1_.readIfPresent(this->coeffDict()); Cv1_.readIfPresent(this->coeffDict());
Cs_.readIfPresent(this->coeffDict()); Cs_.readIfPresent(this->coeffDict());
ck_.readIfPresent(this->coeffDict()); ck_.readIfPresent(this->coeffDict());
ft2_.readIfPresent("ft2", this->coeffDict()); ft2_.readIfPresent("ft2", this->coeffDict());
Ct3_.readIfPresent(this->coeffDict()); Ct3_.readIfPresent(this->coeffDict());
Ct4_.readIfPresent(this->coeffDict()); Ct4_.readIfPresent(this->coeffDict());
if (mag(Ct3_.value()) > SMALL) if (ft2_)
{ {
Info<< " ft2 term: active" << nl; Info<< " ft2 term: active" << nl;
} }
@ -444,47 +444,49 @@ void SpalartAllmarasBase<BasicEddyViscosityModel>::correct()
return; return;
} }
// Local references {
const alphaField& alpha = this->alpha_; // Local references
const rhoField& rho = this->rho_; const alphaField& alpha = this->alpha_;
const surfaceScalarField& alphaRhoPhi = this->alphaRhoPhi_; const rhoField& rho = this->rho_;
const volVectorField& U = this->U_; const surfaceScalarField& alphaRhoPhi = this->alphaRhoPhi_;
fv::options& fvOptions(fv::options::New(this->mesh_)); const volVectorField& U = this->U_;
fv::options& fvOptions(fv::options::New(this->mesh_));
BasicEddyViscosityModel::correct(); BasicEddyViscosityModel::correct();
const volScalarField chi(this->chi()); const volScalarField chi(this->chi());
const volScalarField fv1(this->fv1(chi)); const volScalarField fv1(this->fv1(chi));
const volScalarField ft2(this->ft2(chi)); const volScalarField ft2(this->ft2(chi));
tmp<volTensorField> tgradU = fvc::grad(U); tmp<volTensorField> tgradU = fvc::grad(U);
volScalarField dTilda(this->dTilda(chi, fv1, tgradU())); volScalarField dTilda(this->dTilda(chi, fv1, tgradU()));
volScalarField Stilda(this->Stilda(chi, fv1, tgradU(), dTilda)); volScalarField Stilda(this->Stilda(chi, fv1, tgradU(), dTilda));
tgradU.clear(); tgradU.clear();
tmp<fvScalarMatrix> nuTildaEqn tmp<fvScalarMatrix> nuTildaEqn
(
fvm::ddt(alpha, rho, nuTilda_)
+ fvm::div(alphaRhoPhi, nuTilda_)
- fvm::laplacian(alpha*rho*DnuTildaEff(), nuTilda_)
- Cb2_/sigmaNut_*alpha()*rho()*magSqr(fvc::grad(nuTilda_)()())
==
Cb1_*alpha()*rho()*Stilda()*nuTilda_()*(scalar(1) - ft2())
- fvm::Sp
( (
(Cw1_*fw(Stilda, dTilda) - Cb1_/sqr(kappa_)*ft2()) fvm::ddt(alpha, rho, nuTilda_)
*alpha()*rho()*nuTilda_()/sqr(dTilda()), + fvm::div(alphaRhoPhi, nuTilda_)
nuTilda_ - fvm::laplacian(alpha*rho*DnuTildaEff(), nuTilda_)
) - Cb2_/sigmaNut_*alpha()*rho()*magSqr(fvc::grad(nuTilda_)()())
+ fvOptions(alpha, rho, nuTilda_) ==
); Cb1_*alpha()*rho()*Stilda()*nuTilda_()*(scalar(1) - ft2())
- fvm::Sp
(
(Cw1_*fw(Stilda, dTilda) - Cb1_/sqr(kappa_)*ft2())
*alpha()*rho()*nuTilda_()/sqr(dTilda()),
nuTilda_
)
+ fvOptions(alpha, rho, nuTilda_)
);
nuTildaEqn.ref().relax(); nuTildaEqn.ref().relax();
fvOptions.constrain(nuTildaEqn.ref()); fvOptions.constrain(nuTildaEqn.ref());
solve(nuTildaEqn); solve(nuTildaEqn);
fvOptions.correct(nuTilda_); fvOptions.correct(nuTilda_);
bound(nuTilda_, dimensionedScalar(nuTilda_.dimensions(), Zero)); bound(nuTilda_, dimensionedScalar(nuTilda_.dimensions(), Zero));
nuTilda_.correctBoundaryConditions(); nuTilda_.correctBoundaryConditions();
}
correctNut(); correctNut();
} }

View File

@ -31,15 +31,33 @@ Group
grpDESTurbulence grpDESTurbulence
Description Description
SpalartAllmarasBase DES turbulence model for incompressible and Base class to handle various characteristics for \c SpalartAllmaras based
compressible flows LES/DES turbulence models for incompressible and compressible flows.
Reference: References:
\verbatim \verbatim
Spalart, P. R., Jou, W. H., Strelets, M., & Allmaras, S. R. (1997). Standard model:
Comments on the feasibility of LES for wings, and on a hybrid Spalart, P.R., & Allmaras, S.R. (1994).
RANS/LES approach. A one-equation turbulence model for aerodynamic flows.
Advances in DNS/LES, 1, 4-8. La Recherche Aerospatiale, 1, 5-21.
Standard model:
Spalart, P. R., Jou, W. H., Strelets, M., & Allmaras, S. R. (1997).
Comments on the feasibility of LES for wings, and on a hybrid
RANS/LES approach.
Advances in DNS/LES, 1, 4-8.
Estimation expression for k and epsilon (tag:B), Eq. 4.50:
Bourgoin, A. (2019).
Bathymetry induced turbulence modelling the
Alderney Race site: regional approach with TELEMAC-LES.
Normandie Université.
Estimation expressions for omega (tag:P):
Pope, S. B. (2000).
Turbulent flows.
Cambridge, UK: Cambridge Univ. Press
DOI:10.1017/CBO9780511840531
\endverbatim \endverbatim
SourceFiles SourceFiles
@ -56,7 +74,7 @@ namespace Foam
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class SpalartAllmarasBase Declaration Class SpalartAllmarasBase Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
template<class BasicEddyViscosityModel> template<class BasicEddyViscosityModel>
@ -75,7 +93,7 @@ class SpalartAllmarasBase
protected: protected:
// Protected data // Protected Data
// Model constants // Model constants
@ -98,6 +116,7 @@ protected:
// Fields // Fields
//- Modified kinematic viscosity [m^2/s]
volScalarField nuTilda_; volScalarField nuTilda_;
//- Wall distance //- Wall distance
@ -199,6 +218,7 @@ public:
//- Return the (estimated) specific dissipation rate //- Return the (estimated) specific dissipation rate
virtual tmp<volScalarField> omega() const; virtual tmp<volScalarField> omega() const;
//- Return the modified kinematic viscosity
tmp<volScalarField> nuTilda() const tmp<volScalarField> nuTilda() const
{ {
return nuTilda_; return nuTilda_;

View File

@ -6,8 +6,8 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2016-2022 OpenCFD Ltd.
Copyright (C) 2022 Upstream CFD GmbH Copyright (C) 2022 Upstream CFD GmbH
Copyright (C) 2016-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -48,7 +48,7 @@ tmp<volScalarField> kOmegaSSTBase<BasicEddyViscosityModel>::F1
tmp<volScalarField> CDkOmegaPlus = max tmp<volScalarField> CDkOmegaPlus = max
( (
CDkOmega, CDkOmega,
dimensionedScalar("1.0e-10", dimless/sqr(dimTime), 1.0e-10) dimensionedScalar(dimless/sqr(dimTime), 1.0e-10)
); );
tmp<volScalarField> arg1 = min tmp<volScalarField> arg1 = min
@ -406,6 +406,7 @@ kOmegaSSTBase<BasicEddyViscosityModel>::kOmegaSSTBase
), ),
this->mesh_ this->mesh_
), ),
decayControl_ decayControl_
( (
Switch::getOrAddToDict Switch::getOrAddToDict
@ -515,18 +516,21 @@ void kOmegaSSTBase<BasicEddyViscosityModel>::correct()
BasicEddyViscosityModel::correct(); BasicEddyViscosityModel::correct();
volScalarField::Internal divU(fvc::div(fvc::absolute(this->phi(), U))); const volScalarField::Internal divU
(
fvc::div(fvc::absolute(this->phi(), U))
);
volScalarField CDkOmega const volScalarField CDkOmega
( (
(2*alphaOmega2_)*(fvc::grad(k_) & fvc::grad(omega_))/omega_ (2*alphaOmega2_)*(fvc::grad(k_) & fvc::grad(omega_))/omega_
); );
volScalarField F1(this->F1(CDkOmega)); const volScalarField F1(this->F1(CDkOmega));
volScalarField F23(this->F23()); const volScalarField F23(this->F23());
tmp<volTensorField> tgradU = fvc::grad(U); tmp<volTensorField> tgradU = fvc::grad(U);
volScalarField S2(this->S2(F1, tgradU())); const volScalarField S2(this->S2(F1, tgradU()));
volScalarField::Internal GbyNu0(this->GbyNu0(tgradU(), F1, S2)); volScalarField::Internal GbyNu0(this->GbyNu0(tgradU(), F1, S2));
volScalarField::Internal G(this->GName(), nut*GbyNu0); volScalarField::Internal G(this->GName(), nut*GbyNu0);
@ -534,8 +538,8 @@ void kOmegaSSTBase<BasicEddyViscosityModel>::correct()
omega_.boundaryFieldRef().updateCoeffs(); omega_.boundaryFieldRef().updateCoeffs();
{ {
volScalarField::Internal gamma(this->gamma(F1)); const volScalarField::Internal gamma(this->gamma(F1));
volScalarField::Internal beta(this->beta(F1)); const volScalarField::Internal beta(this->beta(F1));
GbyNu0 = GbyNu(GbyNu0, F23(), S2()); GbyNu0 = GbyNu(GbyNu0, F23(), S2());
@ -568,28 +572,30 @@ void kOmegaSSTBase<BasicEddyViscosityModel>::correct()
bound(omega_, this->omegaMin_); bound(omega_, this->omegaMin_);
} }
// Turbulent kinetic energy equation {
tmp<fvScalarMatrix> kEqn // Turbulent kinetic energy equation
( tmp<fvScalarMatrix> kEqn
fvm::ddt(alpha, rho, k_) (
+ fvm::div(alphaRhoPhi, k_) fvm::ddt(alpha, rho, k_)
- fvm::laplacian(alpha*rho*DkEff(F1), k_) + fvm::div(alphaRhoPhi, k_)
== - fvm::laplacian(alpha*rho*DkEff(F1), k_)
alpha()*rho()*Pk(G) ==
- fvm::SuSp((2.0/3.0)*alpha()*rho()*divU, k_) alpha()*rho()*Pk(G)
- fvm::Sp(alpha()*rho()*epsilonByk(F1, tgradU()), k_) - fvm::SuSp((2.0/3.0)*alpha()*rho()*divU, k_)
+ alpha()*rho()*betaStar_*omegaInf_*kInf_ - fvm::Sp(alpha()*rho()*epsilonByk(F1, tgradU()), k_)
+ kSource() + alpha()*rho()*betaStar_*omegaInf_*kInf_
+ fvOptions(alpha, rho, k_) + kSource()
); + fvOptions(alpha, rho, k_)
);
tgradU.clear(); tgradU.clear();
kEqn.ref().relax(); kEqn.ref().relax();
fvOptions.constrain(kEqn.ref()); fvOptions.constrain(kEqn.ref());
solve(kEqn); solve(kEqn);
fvOptions.correct(k_); fvOptions.correct(k_);
bound(k_, this->kMin_); bound(k_, this->kMin_);
}
correctNut(S2); correctNut(S2);
} }

View File

@ -6,8 +6,8 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2017-2022 OpenCFD Ltd.
Copyright (C) 2022 Upstream CFD GmbH Copyright (C) 2022 Upstream CFD GmbH
Copyright (C) 2017-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -142,7 +142,7 @@ class kOmegaSSTBase
protected: protected:
// Protected data // Protected Data
// Model coefficients // Model coefficients
@ -175,7 +175,10 @@ protected:
// which is for near-wall cells only // which is for near-wall cells only
const volScalarField& y_; const volScalarField& y_;
//- Turbulent kinetic energy field [m^2/s^2]
volScalarField k_; volScalarField k_;
//- Specific dissipation rate field [1/s]
volScalarField omega_; volScalarField omega_;
@ -189,6 +192,7 @@ protected:
// Protected Member Functions // Protected Member Functions
//- Set decay control with kInf and omegaInf
void setDecayControl(const dictionary& dict); void setDecayControl(const dictionary& dict);
virtual tmp<volScalarField> F1(const volScalarField& CDkOmega) const; virtual tmp<volScalarField> F1(const volScalarField& CDkOmega) const;
@ -196,6 +200,7 @@ protected:
virtual tmp<volScalarField> F3() const; virtual tmp<volScalarField> F3() const;
virtual tmp<volScalarField> F23() const; virtual tmp<volScalarField> F23() const;
//- Return the blended field
tmp<volScalarField> blend tmp<volScalarField> blend
( (
const volScalarField& F1, const volScalarField& F1,
@ -206,6 +211,7 @@ protected:
return F1*(psi1 - psi2) + psi2; return F1*(psi1 - psi2) + psi2;
} }
//- Return the internal blended field
tmp<volScalarField::Internal> blend tmp<volScalarField::Internal> blend
( (
const volScalarField::Internal& F1, const volScalarField::Internal& F1,

View File

@ -6,8 +6,8 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2012-2015 OpenFOAM Foundation Copyright (C) 2012-2015 OpenFOAM Foundation
Copyright (C) 2022 OpenCFD Ltd.
Copyright (C) 2022 Upstream CFD GmbH Copyright (C) 2022 Upstream CFD GmbH
Copyright (C) 2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -92,19 +92,17 @@ tmp<volScalarField> DESModel<BasicTurbulenceModel>::Ssigma
) )
{ {
// Limiter // Limiter
const dimensionedScalar eps0("eps0", dimless, SMALL); const dimensionedScalar eps0(dimless, SMALL);
const dimensionedScalar eps2("eps2", dimless/sqr(dimTime), SMALL); const dimensionedScalar eps2(dimless/sqr(dimTime), SMALL);
const dimensionedScalar eps4("eps4", dimless/pow4(dimTime), SMALL); const dimensionedScalar eps4(dimless/pow4(dimTime), SMALL);
const dimensionedScalar max2("max2", dimless/sqr(dimTime), GREAT); const dimensionedScalar max2(dimless/sqr(dimTime), GREAT);
const dimensionedTensor maxTen2 const dimensionedTensor maxTen2
( (
"maxTen2",
dimless/sqr(dimTime), dimless/sqr(dimTime),
tensor::max tensor::max
); );
const dimensionedTensor minTen2 const dimensionedTensor minTen2
( (
"minTen2",
dimless/sqr(dimTime), dimless/sqr(dimTime),
tensor::min tensor::min
); );
@ -114,11 +112,12 @@ tmp<volScalarField> DESModel<BasicTurbulenceModel>::Ssigma
// Tensor invariants // Tensor invariants
const volScalarField I1(tr(G)); const volScalarField I1(tr(G));
const volScalarField I2(0.5*(sqr(I1) - tr(G & G))); const volScalarField I2(0.5*(sqr(I1) - tr(G & G)));
const volScalarField I3(det(G)); tmp<volScalarField> tI3 = det(G);
const volScalarField alpha1(max(sqr(I1)/9.0 - I2/3.0, eps4)); const volScalarField alpha1(max(sqr(I1)/9.0 - I2/3.0, eps4));
const volScalarField alpha2(pow3(min(I1, max2))/27.0 - I1*I2/6.0 + I3/2.0); tmp<volScalarField> talpha2 =
pow3(min(I1, max2))/27.0 - I1*I2/6.0 + 0.5*tI3;
const volScalarField alpha3 const volScalarField alpha3
( (
@ -128,7 +127,7 @@ tmp<volScalarField> DESModel<BasicTurbulenceModel>::Ssigma
max max
( (
scalar(-1) + eps0, scalar(-1) + eps0,
min(scalar(1) - eps0, alpha2/pow(alpha1, 3.0/2.0)) min(scalar(1) - eps0, talpha2/pow(alpha1, 3.0/2.0))
) )
) )
); );

View File

@ -6,8 +6,8 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2012-2015 OpenFOAM Foundation Copyright (C) 2012-2015 OpenFOAM Foundation
Copyright (C) 2016, 2022 OpenCFD Ltd.
Copyright (C) 2022 Upstream CFD GmbH Copyright (C) 2022 Upstream CFD GmbH
Copyright (C) 2016, 2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -58,9 +58,6 @@ class DESModel
public DESModelBase, public DESModelBase,
public LESeddyViscosity<BasicTurbulenceModel> public LESeddyViscosity<BasicTurbulenceModel>
{ {
private:
// Private Member Functions // Private Member Functions
//- No copy construct //- No copy construct
@ -74,6 +71,7 @@ protected:
// Protected Data // Protected Data
//- Model-specific transition constant
dimensionedScalar Ctrans_; dimensionedScalar Ctrans_;

View File

@ -6,8 +6,8 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2015-2022 OpenCFD Ltd.
Copyright (C) 2022 Upstream CFD GmbH Copyright (C) 2022 Upstream CFD GmbH
Copyright (C) 2015-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -141,8 +141,8 @@ SpalartAllmarasDDES<BasicTurbulenceModel>::SpalartAllmarasDDES
Cd1_ Cd1_
( (
this->useSigma_ ? this->useSigma_
dimensioned<scalar>::getOrAddToDict ? dimensioned<scalar>::getOrAddToDict
( (
"Cd1Sigma", "Cd1Sigma",
this->coeffDict_, this->coeffDict_,

View File

@ -6,8 +6,8 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019-2022 OpenCFD Ltd.
Copyright (C) 2022 Upstream CFD GmbH Copyright (C) 2022 Upstream CFD GmbH
Copyright (C) 2019-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -33,15 +33,16 @@ Group
Description Description
SpalartAllmaras DDES turbulence model for incompressible and compressible SpalartAllmaras DDES turbulence model for incompressible and compressible
flows flows.
Reference: Reference:
\verbatim \verbatim
Spalart, P. R., Deck, S., Shur, M. L., Squires, K. D., Strelets, M. K., Spalart, P. R., Deck, S., Shur, M. L., Squires,
& Travin, A. (2006). K. D., Strelets, M. K., & Travin, A. (2006).
A new version of detached-eddy simulation, resistant to ambiguous grid A new version of detached-eddy simulation,
densities. resistant to ambiguous grid densities.
Theoretical and computational fluid dynamics, 20(3), 181-195. Theoretical and computational fluid dynamics, 20(3), 181-195.
DOI:10.1007/s00162-006-0015-0
\endverbatim \endverbatim
SourceFiles SourceFiles
@ -72,7 +73,7 @@ class SpalartAllmarasDDES
{ {
// Private Member Functions // Private Member Functions
//- Shielding function //- Return the shielding function
tmp<volScalarField> fd(const volScalarField& magGradU) const; tmp<volScalarField> fd(const volScalarField& magGradU) const;
//- No copy construct //- No copy construct
@ -84,7 +85,7 @@ class SpalartAllmarasDDES
protected: protected:
// Protected data // Protected Data
// Model coefficients // Model coefficients
@ -94,7 +95,7 @@ protected:
// Protected Member Functions // Protected Member Functions
//- Production term //- Return the production term
virtual tmp<volScalarField> Stilda virtual tmp<volScalarField> Stilda
( (
const volScalarField& chi, const volScalarField& chi,
@ -103,7 +104,7 @@ protected:
const volScalarField& dTilda const volScalarField& dTilda
) const; ) const;
//- Length scale //- Return the length scale
virtual tmp<volScalarField> dTilda virtual tmp<volScalarField> dTilda
( (
const volScalarField& chi, const volScalarField& chi,

View File

@ -6,8 +6,8 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2016-2022 OpenCFD Ltd.
Copyright (C) 2022 Upstream CFD GmbH Copyright (C) 2022 Upstream CFD GmbH
Copyright (C) 2016-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -32,7 +32,7 @@ Group
Description Description
SpalartAllmarasDES DES turbulence model for incompressible and SpalartAllmarasDES DES turbulence model for incompressible and
compressible flows compressible flows.
Reference: Reference:
\verbatim \verbatim
@ -44,11 +44,12 @@ Description
Including the low Reynolds number correction documented in Including the low Reynolds number correction documented in
\verbatim \verbatim
Spalart, P. R., Deck, S., Shur, M.L., Squires, K.D., Strelets, M.Kh, Spalart, P. R., Deck, S., Shur, M. L., Squires,
Travin, A. (2006). K. D., Strelets, M. K., & Travin, A. (2006).
A new version of detached-eddy simulation, resistant to ambiguous grid A new version of detached-eddy simulation,
densities. resistant to ambiguous grid densities.
Theor. Comput. Fluid Dyn., 20, 181-195. Theoretical and computational fluid dynamics, 20(3), 181-195.
DOI:10.1007/s00162-006-0015-0
\endverbatim \endverbatim
Note Note
@ -94,38 +95,38 @@ class SpalartAllmarasDES
protected: protected:
// Protected data // Protected Data
//- Switch to activate grey-area enhanced sigma-(D)DES //- Switch to activate grey-area enhanced sigma-(D)DES
Switch useSigma_; Switch useSigma_;
// Model constants // Model constants
// DES coefficient //- DES coefficient
dimensionedScalar CDES_; dimensionedScalar CDES_;
// Low Reynolds number correction //- Flag for low Reynolds number correction
Switch lowReCorrection_; Switch lowReCorrection_;
dimensionedScalar fwStar_; dimensionedScalar fwStar_;
// Protected Member Functions // Protected Member Functions
//- Low Reynolds number correction function //- Return the low Reynolds number correction function
virtual tmp<volScalarField> psi virtual tmp<volScalarField> psi
( (
const volScalarField& chi, const volScalarField& chi,
const volScalarField& fv1 const volScalarField& fv1
) const; ) const;
//- LES length scale //- Return the LES length scale
virtual tmp<volScalarField> lengthScaleLES virtual tmp<volScalarField> lengthScaleLES
( (
const volScalarField& chi, const volScalarField& chi,
const volScalarField& fv1 const volScalarField& fv1
) const; ) const;
//- Production term //- Return the production term
virtual tmp<volScalarField> Stilda virtual tmp<volScalarField> Stilda
( (
const volScalarField& chi, const volScalarField& chi,
@ -134,7 +135,7 @@ protected:
const volScalarField& dTilda const volScalarField& dTilda
) const; ) const;
//- Length scale //- Return the length scale
virtual tmp<volScalarField> dTilda virtual tmp<volScalarField> dTilda
( (
const volScalarField& chi, const volScalarField& chi,

View File

@ -31,15 +31,16 @@ Group
grpDESTurbulence grpDESTurbulence
Description Description
SpalartAllmaras IDDES turbulence model for incompressible and compressible SpalartAllmaras IDDES turbulence model
flows for incompressible and compressible flows.
Reference: Reference:
\verbatim \verbatim
Shur, M. L., Spalart, P. R., Strelets, M. K., & Travin, A. K. (2008). Shur, M. L., Spalart, P. R., Strelets, M. K., & Travin, A. K. (2008).
A hybrid RANS-LES approach with delayed-DES and wall-modelled LES A hybrid RANS-LES approach with delayed-DES
capabilities. and wall-modelled LES capabilities.
International Journal of Heat and Fluid Flow, 29(6), 1638-1649. International journal of heat and fluid flow, 29(6), 1638-1649.
DOI:10.1016/j.ijheatfluidflow.2008.07.001
\endverbatim \endverbatim
SourceFiles SourceFiles
@ -92,7 +93,7 @@ class SpalartAllmarasIDDES
protected: protected:
// Protected data // Protected Data
// Model coefficients // Model coefficients
@ -109,7 +110,7 @@ protected:
// Protected Member Functions // Protected Member Functions
//- Length scale //- Return the length scale
virtual tmp<volScalarField> dTilda virtual tmp<volScalarField> dTilda
( (
const volScalarField& chi, const volScalarField& chi,

View File

@ -6,8 +6,8 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2015 OpenFOAM Foundation Copyright (C) 2015 OpenFOAM Foundation
Copyright (C) 2016-2022 OpenCFD Ltd.
Copyright (C) 2022 Upstream CFD GmbH Copyright (C) 2022 Upstream CFD GmbH
Copyright (C) 2016-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -153,8 +153,8 @@ kOmegaSSTDDES<BasicTurbulenceModel>::kOmegaSSTDDES
Cd1_ Cd1_
( (
this->useSigma_ ? this->useSigma_
dimensioned<scalar>::getOrAddToDict ? dimensioned<scalar>::getOrAddToDict
( (
"Cd1Sigma", "Cd1Sigma",
this->coeffDict_, this->coeffDict_,

View File

@ -6,8 +6,8 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2015 OpenFOAM Foundation Copyright (C) 2015 OpenFOAM Foundation
Copyright (C) 2019, 2022 OpenCFD Ltd.
Copyright (C) 2022 Upstream CFD GmbH Copyright (C) 2022 Upstream CFD GmbH
Copyright (C) 2019, 2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -32,14 +32,16 @@ Group
grpDESTurbulence grpDESTurbulence
Description Description
k-omega-SST DDES turbulence model for incompressible and compressible flows k-omega-SST DDES turbulence model for incompressible and compressible flows.
Reference: Reference:
\verbatim \verbatim
Gritskevich, M.S., Garbaruk, A.V., Schuetze, J., Menter, F.R. (2011) Gritskevich, M. S., Garbaruk, A. V.,
Development of DDES and IDDES Formulations for the k-omega Schütze, J., & Menter, F. R. (2012).
Shear Stress Transport Model, Flow, Turbulence and Combustion, Development of DDES and IDDES formulations for
pp. 1-19 the k-ω shear stress transport model.
Flow, turbulence and combustion, 88(3), 431-449.
DOI:10.1007/s10494-011-9378-4
\endverbatim \endverbatim
SourceFiles SourceFiles
@ -70,7 +72,7 @@ class kOmegaSSTDDES
{ {
// Private Member Functions // Private Member Functions
//- Shielding function //- Return the shielding function field
tmp<volScalarField> fd(const volScalarField& magGradU) const; tmp<volScalarField> fd(const volScalarField& magGradU) const;
//- No copy construct //- No copy construct
@ -82,7 +84,7 @@ class kOmegaSSTDDES
protected: protected:
// Protected data // Protected Data
// Model coefficients // Model coefficients

View File

@ -6,8 +6,8 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2015 OpenFOAM Foundation Copyright (C) 2015 OpenFOAM Foundation
Copyright (C) 2016-2022 OpenCFD Ltd.
Copyright (C) 2022 Upstream CFD GmbH Copyright (C) 2022 Upstream CFD GmbH
Copyright (C) 2016-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -63,7 +63,7 @@ tmp<volScalarField> kOmegaSSTDES<BasicTurbulenceModel>::r
const volScalarField& magGradU const volScalarField& magGradU
) const ) const
{ {
const dimensionedScalar eps("SMALL", magGradU.dimensions(), SMALL); const dimensionedScalar eps(magGradU.dimensions(), SMALL);
tmp<volScalarField> tr = tmp<volScalarField> tr =
min(nur/(max(magGradU, eps)*sqr(this->kappa_*this->y_)), scalar(10)); min(nur/(max(magGradU, eps)*sqr(this->kappa_*this->y_)), scalar(10));
@ -71,7 +71,6 @@ tmp<volScalarField> kOmegaSSTDES<BasicTurbulenceModel>::r
tr.ref().boundaryFieldRef() == 0; tr.ref().boundaryFieldRef() == 0;
return tr; return tr;
} }

View File

@ -31,13 +31,13 @@ Group
grpDESTurbulence grpDESTurbulence
Description Description
k-omega-SST DES turbulence model for incompressible and compressible flows k-omega-SST DES turbulence model for incompressible and compressible flows.
Reference: Reference:
\verbatim \verbatim
Strelets, M. (2001) Strelets, M. (2001).
Detached Eddy Simulation of Massively Separated Flows, Detached Eddy Simulation of Massively Separated Flows.
39th AIAA Aerospace Sciences Meeting and Exhibit, Reno, NV 39th AIAA Aerospace Sciences Meeting and Exhibit, Reno, NV.
\endverbatim \endverbatim
Note Note
@ -51,8 +51,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef kOmegaSSTDES_H #ifndef Foam_kOmegaSSTDES_H
#define kOmegaSSTDES_H #define Foam_kOmegaSSTDES_H
#include "DESModel.H" #include "DESModel.H"
#include "kOmegaSSTBase.H" #include "kOmegaSSTBase.H"
@ -65,7 +65,7 @@ namespace LESModels
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
class kOmegaSSTDES Declaration Class kOmegaSSTDES Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
template<class BasicTurbulenceModel> template<class BasicTurbulenceModel>
@ -84,7 +84,7 @@ class kOmegaSSTDES
protected: protected:
// Protected data // Protected Data
//- Switch to activate grey-area enhanced sigma-(D)DES //- Switch to activate grey-area enhanced sigma-(D)DES
Switch useSigma_; Switch useSigma_;
@ -122,7 +122,7 @@ protected:
const volTensorField& gradU const volTensorField& gradU
) const; ) const;
//- Length scale //- Return length scale
virtual tmp<volScalarField> dTilda virtual tmp<volScalarField> dTilda
( (
const volScalarField& magGradU, const volScalarField& magGradU,

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2015 OpenFOAM Foundation Copyright (C) 2015 OpenFOAM Foundation
Copyright (C) 2015-2020 OpenCFD Ltd. Copyright (C) 2015-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -117,7 +117,7 @@ tmp<volScalarField> kOmegaSSTIDDES<BasicTurbulenceModel>::dTilda
return max return max
( (
fdTilda*(1 + fe)*lRAS + (1 - fdTilda)*lLES, fdTilda*(1 + fe)*lRAS + (1 - fdTilda)*lLES,
dimensionedScalar("SMALL", dimLength, SMALL) dimensionedScalar(dimLength, SMALL)
); );
} }
@ -125,7 +125,7 @@ tmp<volScalarField> kOmegaSSTIDDES<BasicTurbulenceModel>::dTilda
return max return max
( (
fdTilda*lRAS + (1 - fdTilda)*lLES, fdTilda*lRAS + (1 - fdTilda)*lLES,
dimensionedScalar("SMALL", dimLength, SMALL) dimensionedScalar(dimLength, SMALL)
); );
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2015 OpenFOAM Foundation Copyright (C) 2015 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -31,15 +31,17 @@ Group
grpDESTurbulence grpDESTurbulence
Description Description
k-omega-SST IDDES turbulence model for incompressible and compressible k-omega-SST IDDES turbulence model for
flows incompressible and compressible flows.
Reference: Reference:
\verbatim \verbatim
Gritskevich, M.S., Garbaruk, A.V., Schuetze, J., Menter, F.R. (2011) Gritskevich, M. S., Garbaruk, A. V.,
Development of DDES and IDDES Formulations for the k-omega Schütze, J., & Menter, F. R. (2012).
Shear Stress Transport Model, Flow, Turbulence and Combustion, Development of DDES and IDDES formulations for
pp. 1-19 the k-ω shear stress transport model.
Flow, turbulence and combustion, 88(3), 431-449.
DOI:10.1007/s10494-011-9378-4
\endverbatim \endverbatim
SourceFiles SourceFiles
@ -47,8 +49,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef kOmegaSSTIDDES_H #ifndef Foam_kOmegaSSTIDDES_H
#define kOmegaSSTIDDES_H #define Foam_kOmegaSSTIDDES_H
#include "kOmegaSSTDES.H" #include "kOmegaSSTDES.H"
@ -89,7 +91,7 @@ class kOmegaSSTIDDES
protected: protected:
// Protected data // Protected Data
// Model coefficients // Model coefficients
@ -106,7 +108,7 @@ protected:
// Protected Member Functions // Protected Member Functions
//- Length scale //- Return the length scale
virtual tmp<volScalarField> dTilda virtual tmp<volScalarField> dTilda
( (
const volScalarField& magGradU, const volScalarField& magGradU,

View File

@ -50,7 +50,8 @@ void Foam::LESModels::DeltaOmegaTildeDelta::calcDelta()
const fvMesh& mesh = turbulenceModel_.mesh(); const fvMesh& mesh = turbulenceModel_.mesh();
const volVectorField& U0 = turbulenceModel_.U(); const volVectorField& U0 = turbulenceModel_.U();
const volVectorField vorticity(fvc::curl(U0)); tmp<volVectorField> tvorticity = fvc::curl(U0);
const volVectorField& vorticity = tvorticity.cref();
const volVectorField nvecvort const volVectorField nvecvort
( (
vorticity vorticity
@ -58,10 +59,11 @@ void Foam::LESModels::DeltaOmegaTildeDelta::calcDelta()
max max
( (
mag(vorticity), mag(vorticity),
dimensionedScalar("SMALL", dimless/dimTime, SMALL) dimensionedScalar(dimless/dimTime, SMALL)
) )
) )
); );
tvorticity.clear();
const cellList& cells = mesh.cells(); const cellList& cells = mesh.cells();
const vectorField& cellCentres = mesh.cellCentres(); const vectorField& cellCentres = mesh.cellCentres();
@ -73,12 +75,12 @@ void Foam::LESModels::DeltaOmegaTildeDelta::calcDelta()
const point& cc = cellCentres[celli]; const point& cc = cellCentres[celli];
const vector& nv = nvecvort[celli]; const vector& nv = nvecvort[celli];
scalar deltaMaxTmp = 0.0; scalar deltaMaxTmp = 0;
for (const label facei : cFaces) for (const label facei : cFaces)
{ {
const point& fc = faceCentres[facei]; const point& fc = faceCentres[facei];
scalar tmp = 2.0*mag(nv ^ (fc - cc)); const scalar tmp = 2.0*mag(nv ^ (fc - cc));
if (tmp > deltaMaxTmp) if (tmp > deltaMaxTmp)
{ {
@ -171,7 +173,7 @@ Foam::LESModels::DeltaOmegaTildeDelta::DeltaOmegaTildeDelta
void Foam::LESModels::DeltaOmegaTildeDelta::read(const dictionary& dict) void Foam::LESModels::DeltaOmegaTildeDelta::read(const dictionary& dict)
{ {
const dictionary& coeffsDict(dict.optionalSubDict(type() + "Coeffs")); const dictionary& coeffsDict = dict.optionalSubDict(type() + "Coeffs");
coeffsDict.readIfPresent<scalar>("deltaCoeff", deltaCoeff_); coeffsDict.readIfPresent<scalar>("deltaCoeff", deltaCoeff_);
coeffsDict.readIfPresent<bool>("requireUpdate", requireUpdate_); coeffsDict.readIfPresent<bool>("requireUpdate", requireUpdate_);

View File

@ -25,7 +25,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class Class
Foam::DeltaOmegaTildeDelta Foam::LESModels::DeltaOmegaTildeDelta
Description Description
Delta formulation that accounts for the orientation of the vorticity Delta formulation that accounts for the orientation of the vorticity
@ -37,9 +37,10 @@ Description
Reference: Reference:
\verbatim \verbatim
Shur, M. L., Spalart, P. R., Strelets, M. K., & Travin, A. K. (2015). Shur, M. L., Spalart, P. R., Strelets, M. K., & Travin, A. K. (2015).
An enhanced version of DES with rapid transition from RANS to LES in An enhanced version of DES with rapid transition
separated flows. from RANS to LES in separated flows.
Flow, Turbulence and Combustion, 95, 709-737, 2015. Flow, turbulence and combustion, 95(4), 709-737.
DOI:10.1007/s10494-015-9618-0
\endverbatim \endverbatim
SourceFiles SourceFiles
@ -67,7 +68,7 @@ class DeltaOmegaTildeDelta
: :
public LESdelta public LESdelta
{ {
// Private data // Private Data
//- Run-time selectable delta for hmax //- Run-time selectable delta for hmax
// Defaults to the maxDeltaxyz model if not supplied // Defaults to the maxDeltaxyz model if not supplied
@ -82,15 +83,15 @@ class DeltaOmegaTildeDelta
// Private Member Functions // Private Member Functions
//- Calculate the delta values
void calcDelta();
//- No copy construct //- No copy construct
DeltaOmegaTildeDelta(const DeltaOmegaTildeDelta&) = delete; DeltaOmegaTildeDelta(const DeltaOmegaTildeDelta&) = delete;
//- No copy assignment //- No copy assignment
void operator=(const DeltaOmegaTildeDelta&) = delete; void operator=(const DeltaOmegaTildeDelta&) = delete;
//- Calculate the delta values
void calcDelta();
public: public:

View File

@ -93,7 +93,8 @@ tmp<scalarField> sumNeighbours
return tscaling; return tscaling;
} }
} } // End namespace Foam
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -101,31 +102,36 @@ namespace Foam
{ {
namespace LESModels namespace LESModels
{ {
defineTypeNameAndDebug(DeltaSLA, 0); defineTypeNameAndDebug(SLADelta, 0);
addToRunTimeSelectionTable(LESdelta, DeltaSLA, dictionary); addToRunTimeSelectionTable(LESdelta, SLADelta, dictionary);
} }
} }
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::LESModels::DeltaSLA::calcDelta() void Foam::LESModels::SLADelta::calcDelta()
{ {
const fvMesh& mesh = turbulenceModel_.mesh(); const fvMesh& mesh = turbulenceModel_.mesh();
const volVectorField& U0 = turbulenceModel_.U();
const volVectorField vorticity(fvc::curl(U0));
const volSymmTensorField S(symm(fvc::grad(U0)));
const volScalarField magGradU(mag(fvc::grad(U0)));
tmp<volScalarField> tnut = turbulenceModel_.nut(); tmp<volScalarField> tnut = turbulenceModel_.nut();
const auto& nut = tnut(); const volScalarField& nut = tnut.cref();
tmp<volScalarField> tnu = turbulenceModel_.nu();
const auto& nu = tnu(); tmp<volScalarField> tnu = turbulenceModel_.nu();
const volScalarField& nu = tnu.cref();
// Calculate vortex tilting measure, VTM
const volVectorField& U0 = turbulenceModel_.U();
tmp<volVectorField> tvorticity = fvc::curl(U0);
const volVectorField& vorticity = tvorticity.cref();
tmp<volSymmTensorField> tS = symm(fvc::grad(U0));
const volSymmTensorField& S = tS.cref();
const dimensionedScalar nuMin(nu.dimensions(), SMALL);
const dimensionedScalar eps(dimless/pow3(dimTime), SMALL);
// Vortex tilting measure, VTM
const dimensionedScalar nuMin("SMALL", nu.dimensions(), SMALL);
const dimensionedScalar eps("SMALL", dimless/pow3(dimTime), SMALL);
volScalarField vtm volScalarField vtm
( (
max(scalar(1), 0.2*nu/max(nut, nuMin)) max(scalar(1), 0.2*nu/max(nut, nuMin))
@ -133,38 +139,45 @@ void Foam::LESModels::DeltaSLA::calcDelta()
/max(magSqr(vorticity)*sqrt(3*magSqr(S) - sqr(tr(S))), eps) /max(magSqr(vorticity)*sqrt(3*magSqr(S) - sqr(tr(S))), eps)
); );
vtm.correctBoundaryConditions(); vtm.correctBoundaryConditions();
tS.clear();
const dimensionedScalar vortMin(dimless/dimTime, SMALL);
const volVectorField nVecVort(vorticity/(max(mag(vorticity), vortMin)));
tvorticity.clear();
// Averaged VTM // Calculate averaged VTM
volScalarField vtmAve("vtmAve", vtm); volScalarField vtmAve("vtmAve", vtm);
tmp<scalarField> weights = sumNeighbours(vtm, vtmAve); tmp<scalarField> tweights = sumNeighbours(vtm, vtmAve);
// Add cell centre values // Add cell centre values
vtmAve += vtm; vtmAve += vtm;
// Weights normalisation (add 1 for cell centres) // Weights normalisation (add 1 for cell centres)
vtmAve.primitiveFieldRef() /= weights + 1; vtmAve.primitiveFieldRef() /= tweights + 1;
// Compute DDES shielding function // Calculate DDES shielding function, fd
const volScalarField& y = wallDist::New(mesh).y(); const volScalarField& y = wallDist::New(mesh).y();
const dimensionedScalar Ueps("eps", magGradU.dimensions(), SMALL);
const dimensionedScalar nuEps("eps", nu.dimensions(), ROOTSMALL); const dimensionedScalar magGradUeps(dimless/dimTime, SMALL);
const volScalarField rd const dimensionedScalar nuEps(nu.dimensions(), ROOTSMALL);
(
tmp<volScalarField> tmagGradU = mag(fvc::grad(U0));
tmp<volScalarField> trd =
min min
( (
(nut + nu)/(max(magGradU, Ueps)*sqr(kappa_*y) + nuEps), (nut + nu)/(max(tmagGradU, magGradUeps)*sqr(kappa_*y) + nuEps),
scalar(10) scalar(10)
) );
); tnut.clear();
const volScalarField fd(1.0 - tanh(pow(Cd1_*rd, Cd2_))); tnu.clear();
const volScalarField fd(1.0 - tanh(pow(Cd1_*trd, Cd2_)));
// Assemble delta // Assemble delta
const dimensionedScalar vortMin("SMALL", dimless/dimTime, SMALL);
const volVectorField nVecVort(vorticity/(max(mag(vorticity), vortMin)));
const cellList& cells = mesh.cells(); const cellList& cells = mesh.cells();
const vectorField& cellCentres = mesh.cellCentres(); const vectorField& cellCentres = mesh.cellCentres();
const vectorField& faceCentres = mesh.faceCentres(); const vectorField& faceCentres = mesh.faceCentres();
@ -175,12 +188,12 @@ void Foam::LESModels::DeltaSLA::calcDelta()
const point& cc = cellCentres[celli]; const point& cc = cellCentres[celli];
const vector& nv = nVecVort[celli]; const vector& nv = nVecVort[celli];
scalar deltaMaxTmp = 0.0; scalar deltaMaxTmp = 0;
for (const label facei : cFaces) for (const label facei : cFaces)
{ {
const point& fc = faceCentres[facei]; const point& fc = faceCentres[facei];
scalar tmp = 2.0*mag(nv ^ (fc - cc)); const scalar tmp = 2.0*mag(nv ^ (fc - cc));
if (tmp > deltaMaxTmp) if (tmp > deltaMaxTmp)
{ {
@ -208,7 +221,7 @@ void Foam::LESModels::DeltaSLA::calcDelta()
delta_[celli] = deltaCoeff_*deltaMaxTmp*FKH; delta_[celli] = deltaCoeff_*deltaMaxTmp*FKH;
} }
label nD = mesh.nGeometricD(); const label nD = mesh.nGeometricD();
if (nD == 2) if (nD == 2)
{ {
@ -229,7 +242,7 @@ void Foam::LESModels::DeltaSLA::calcDelta()
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::LESModels::DeltaSLA::DeltaSLA Foam::LESModels::SLADelta::SLADelta
( (
const word& name, const word& name,
const turbulenceModel& turbulence, const turbulenceModel& turbulence,
@ -240,7 +253,7 @@ Foam::LESModels::DeltaSLA::DeltaSLA
hmaxPtr_(nullptr), hmaxPtr_(nullptr),
deltaCoeff_ deltaCoeff_
( (
dict.optionalSubDict(type() + "Coeffs").lookupOrDefault<scalar> dict.optionalSubDict(type() + "Coeffs").getOrDefault<scalar>
( (
"deltaCoeff", "deltaCoeff",
1.035 1.035
@ -353,12 +366,20 @@ Foam::LESModels::DeltaSLA::DeltaSLA
) )
); );
} }
if (mag(a2_ - a1_) < SMALL)
{
FatalIOErrorInFunction(dict)
<< "Model coefficients a1 = " << a1_
<< ", and a2 = " << a2_ << " cannot be equal."
<< abort(FatalIOError);
}
} }
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::LESModels::DeltaSLA::read(const dictionary& dict) void Foam::LESModels::SLADelta::read(const dictionary& dict)
{ {
const dictionary& coeffsDict(dict.optionalSubDict(type() + "Coeffs")); const dictionary& coeffsDict(dict.optionalSubDict(type() + "Coeffs"));
@ -377,7 +398,7 @@ void Foam::LESModels::DeltaSLA::read(const dictionary& dict)
} }
void Foam::LESModels::DeltaSLA::correct() void Foam::LESModels::SLADelta::correct()
{ {
if (turbulenceModel_.mesh().changing() && requireUpdate_) if (turbulenceModel_.mesh().changing() && requireUpdate_)
{ {

View File

@ -25,7 +25,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class Class
Foam::LESModels::DeltaSLA Foam::LESModels::SLADelta
Description Description
Delta formulation that accounts for the orientation of the vorticity vector Delta formulation that accounts for the orientation of the vorticity vector
@ -36,9 +36,10 @@ Description
Reference: Reference:
\verbatim \verbatim
Shur, M. L., Spalart, P. R., Strelets, M. K., & Travin, A. K. (2015). Shur, M. L., Spalart, P. R., Strelets, M. K., & Travin, A. K. (2015).
An enhanced version of DES with rapid transition from RANS to LES in An enhanced version of DES with rapid transition
separated flows. from RANS to LES in separated flows.
Flow, Turbulence and Combustion, 95, 709737, 2015. Flow, turbulence and combustion, 95(4), 709-737.
DOI:10.1007/s10494-015-9618-0
\endverbatim \endverbatim
SourceFiles SourceFiles
@ -46,8 +47,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef LESModels_DeltaSLADelta_H #ifndef LESModels_SLADelta_H
#define LESModels_DeltaSLADelta_H #define LESModels_SLADelta_H
#include "LESdelta.H" #include "LESdelta.H"
@ -59,14 +60,14 @@ namespace LESModels
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class DeltaSLA Declaration Class SLADelta Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class DeltaSLA class SLADelta
: :
public LESdelta public LESdelta
{ {
// Private data // Private Data
//- Run-time selectable delta for hmax //- Run-time selectable delta for hmax
// Defaults to the maxDeltaxyz model if not supplied // Defaults to the maxDeltaxyz model if not supplied
@ -89,15 +90,15 @@ class DeltaSLA
// Private Member Functions // Private Member Functions
//- No copy construct
DeltaSLA(const DeltaSLA&) = delete;
//- No copy assignment
void operator=(const DeltaSLA&) = delete;
// Calculate the delta values // Calculate the delta values
void calcDelta(); void calcDelta();
//- No copy construct
SLADelta(const SLADelta&) = delete;
//- No copy assignment
void operator=(const SLADelta&) = delete;
public: public:
@ -108,7 +109,7 @@ public:
// Constructors // Constructors
//- Construct from name, turbulenceModel and IOdictionary //- Construct from name, turbulenceModel and IOdictionary
DeltaSLA SLADelta
( (
const word& name, const word& name,
const turbulenceModel& turbulence, const turbulenceModel& turbulence,
@ -117,7 +118,7 @@ public:
//- Destructor //- Destructor
virtual ~DeltaSLA() = default; virtual ~SLADelta() = default;
// Member Functions // Member Functions

View File

@ -128,10 +128,8 @@ bool sigma<BasicTurbulenceModel>::read()
return true; return true;
} }
else
{ return false;
return false;
}
} }

View File

@ -35,10 +35,11 @@ Description
Reference: Reference:
\verbatim \verbatim
Nicoud, F., Toda, H., Cabrit, O., Bose, S., & Lee, J. (2011). Nicoud, F., Toda, H. B., Cabrit, O., Bose, S., & Lee, J. (2011).
Using singular values to build a subgrid-scale model for large Using singular values to build a subgrid-scale
eddy simulations. model for large eddy simulations.
Physics of Fluids, 23(8), 5106, 2011. Physics of fluids, 23(8), 085106.
DOI:10.1063/1.3623274
\endverbatim \endverbatim
The default model coefficients correspond to the following: The default model coefficients correspond to the following:
@ -93,7 +94,7 @@ class sigma
protected: protected:
// Protected data // Protected Data
dimensionedScalar Ck_; dimensionedScalar Ck_;
dimensionedScalar Cw_; dimensionedScalar Cw_;

View File

@ -52,18 +52,6 @@ Description
Spalart-Allmaras One-Equation Model without ft2 Term (SA-noft2). Spalart-Allmaras One-Equation Model without ft2 Term (SA-noft2).
https://turbmodels.larc.nasa.gov/spalart.html#sanoft2 https://turbmodels.larc.nasa.gov/spalart.html#sanoft2
(Retrieved:12-01-2021). (Retrieved:12-01-2021).
Estimation expression for k and epsilon (tag:B), Eq. 4.50:
Bourgoin, A. (2019).
Bathymetry induced turbulence modelling the
Alderney Race site: regional approach with TELEMAC-LES.
Normandie Université.
Estimation expressions for omega (tag:P):
Pope, S. B. (2000).
Turbulent flows.
Cambridge, UK: Cambridge Univ. Press
DOI:10.1017/CBO9780511840531
\endverbatim \endverbatim
Usage Usage
@ -146,7 +134,7 @@ protected:
// Protected Member Functions // Protected Member Functions
//- Length scale //- Return the length scale
virtual tmp<volScalarField> dTilda virtual tmp<volScalarField> dTilda
( (
const volScalarField& chi, const volScalarField& chi,