diff --git a/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.C b/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.C index 2fa4e4324d..4018e749a1 100644 --- a/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.C +++ b/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -73,19 +73,6 @@ GenEddyVisc::GenEddyVisc ) ), - k_ - ( - IOobject - ( - "k", - runTime_.timeName(), - mesh_, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh_ - ), - muSgs_ ( IOobject @@ -112,7 +99,7 @@ GenEddyVisc::GenEddyVisc mesh_ ) { - bound(k_, kMin_); +// printCoeffs(); } @@ -120,7 +107,7 @@ GenEddyVisc::GenEddyVisc tmp GenEddyVisc::B() const { - return ((2.0/3.0)*I)*k_ - (muSgs_/rho())*dev(twoSymm(fvc::grad(U()))); + return ((2.0/3.0)*I)*k() - (muSgs_/rho())*dev(twoSymm(fvc::grad(U()))); } diff --git a/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.H b/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.H index d765087176..7450b47740 100644 --- a/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.H +++ b/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -75,7 +75,6 @@ protected: // Fields - volScalarField k_; volScalarField muSgs_; volScalarField alphaSgs_; @@ -106,16 +105,10 @@ public: // Member Functions - //- Return SGS kinetic energy - virtual tmp k() const - { - return k_; - } - //- Return sub-grid disipation rate virtual tmp epsilon() const { - return ce_*k_*sqrt(k_)/delta(); + return ce_*k()*sqrt(k())/delta(); } //- Return viscosity diff --git a/src/turbulenceModels/compressible/LES/Smagorinsky/Smagorinsky.C b/src/turbulenceModels/compressible/LES/Smagorinsky/Smagorinsky.C index 0276ad5559..829acbc922 100644 --- a/src/turbulenceModels/compressible/LES/Smagorinsky/Smagorinsky.C +++ b/src/turbulenceModels/compressible/LES/Smagorinsky/Smagorinsky.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -51,9 +51,9 @@ void Smagorinsky::updateSubGridScaleFields(const volTensorField& gradU) 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)); + volScalarField k = sqr((-b + sqrt(sqr(b) + 4*a*c))/(2*a)); - muSgs_ = ck_*rho()*delta()*sqrt(k_); + muSgs_ = ck_*rho()*delta()*sqrt(k); muSgs_.correctBoundaryConditions(); alphaSgs_ = muSgs_/Prt_; diff --git a/src/turbulenceModels/compressible/LES/Smagorinsky/Smagorinsky.H b/src/turbulenceModels/compressible/LES/Smagorinsky/Smagorinsky.H index 705d0671ea..432fac9486 100644 --- a/src/turbulenceModels/compressible/LES/Smagorinsky/Smagorinsky.H +++ b/src/turbulenceModels/compressible/LES/Smagorinsky/Smagorinsky.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -109,6 +109,20 @@ public: // Member Functions + //- Return SGS kinetic energy + // calculated from the given velocity gradient + tmp k(const tmp& gradU) const + { + return (2.0*ck_/ce_)*sqr(delta())*magSqr(dev(symm(gradU))); + } + + //- Return SGS kinetic energy + virtual tmp k() const + { + return k(fvc::grad(U())); + } + + //- Correct Eddy-Viscosity and related properties virtual void correct(const tmp& gradU); diff --git a/src/turbulenceModels/compressible/LES/dynOneEqEddy/dynOneEqEddy.C b/src/turbulenceModels/compressible/LES/dynOneEqEddy/dynOneEqEddy.C index 54f8cf22ae..1c9eff7f21 100644 --- a/src/turbulenceModels/compressible/LES/dynOneEqEddy/dynOneEqEddy.C +++ b/src/turbulenceModels/compressible/LES/dynOneEqEddy/dynOneEqEddy.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -104,6 +104,19 @@ dynOneEqEddy::dynOneEqEddy LESModel(modelName, rho, U, phi, thermoPhysicalModel, turbulenceModelName), GenEddyVisc(rho, U, phi, thermoPhysicalModel), + k_ + ( + IOobject + ( + "k", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ), + filterPtr_(LESfilter::New(U.mesh(), coeffDict())), filter_(filterPtr_()) { diff --git a/src/turbulenceModels/compressible/LES/dynOneEqEddy/dynOneEqEddy.H b/src/turbulenceModels/compressible/LES/dynOneEqEddy/dynOneEqEddy.H index a8b5d087fd..1b9c682fdb 100644 --- a/src/turbulenceModels/compressible/LES/dynOneEqEddy/dynOneEqEddy.H +++ b/src/turbulenceModels/compressible/LES/dynOneEqEddy/dynOneEqEddy.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -75,6 +75,8 @@ class dynOneEqEddy { // Private data + volScalarField k_; + autoPtr filterPtr_; LESfilter& filter_; @@ -120,6 +122,12 @@ public: // Member Functions + //- Return SGS kinetic energy + virtual tmp k() const + { + return k_; + } + //- Return the effective diffusivity for k tmp DkEff() const { diff --git a/src/turbulenceModels/compressible/LES/lowReOneEqEddy/lowReOneEqEddy.C b/src/turbulenceModels/compressible/LES/lowReOneEqEddy/lowReOneEqEddy.C index f4dd6f8cb9..eb21f9402c 100644 --- a/src/turbulenceModels/compressible/LES/lowReOneEqEddy/lowReOneEqEddy.C +++ b/src/turbulenceModels/compressible/LES/lowReOneEqEddy/lowReOneEqEddy.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -71,6 +71,19 @@ lowReOneEqEddy::lowReOneEqEddy LESModel(modelName, rho, U, phi, thermoPhysicalModel, turbulenceModelName), GenEddyVisc(rho, U, phi, thermoPhysicalModel), + k_ + ( + IOobject + ( + "k", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ), + ck_ ( dimensioned::lookupOrAddToDict diff --git a/src/turbulenceModels/compressible/LES/lowReOneEqEddy/lowReOneEqEddy.H b/src/turbulenceModels/compressible/LES/lowReOneEqEddy/lowReOneEqEddy.H index c8b506b7bc..f78a14cc4d 100644 --- a/src/turbulenceModels/compressible/LES/lowReOneEqEddy/lowReOneEqEddy.H +++ b/src/turbulenceModels/compressible/LES/lowReOneEqEddy/lowReOneEqEddy.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -71,6 +71,8 @@ class lowReOneEqEddy { // Private data + volScalarField k_; + dimensionedScalar ck_; dimensionedScalar beta_; @@ -111,6 +113,12 @@ public: // Member Functions + //- Return SGS kinetic energy + virtual tmp k() const + { + return k_; + } + //- Return the effective diffusivity for k tmp DkEff() const { diff --git a/src/turbulenceModels/compressible/LES/oneEqEddy/oneEqEddy.C b/src/turbulenceModels/compressible/LES/oneEqEddy/oneEqEddy.C index b81487e99e..f5a3ac4b73 100644 --- a/src/turbulenceModels/compressible/LES/oneEqEddy/oneEqEddy.C +++ b/src/turbulenceModels/compressible/LES/oneEqEddy/oneEqEddy.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -67,6 +67,19 @@ oneEqEddy::oneEqEddy LESModel(modelName, rho, U, phi, thermoPhysicalModel, turbulenceModelName), GenEddyVisc(rho, U, phi, thermoPhysicalModel), + k_ + ( + IOobject + ( + "k", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ), + ck_ ( dimensioned::lookupOrAddToDict diff --git a/src/turbulenceModels/compressible/LES/oneEqEddy/oneEqEddy.H b/src/turbulenceModels/compressible/LES/oneEqEddy/oneEqEddy.H index 5a604260fe..3c8f553ad6 100644 --- a/src/turbulenceModels/compressible/LES/oneEqEddy/oneEqEddy.H +++ b/src/turbulenceModels/compressible/LES/oneEqEddy/oneEqEddy.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -74,6 +74,8 @@ class oneEqEddy { // Private data + volScalarField k_; + dimensionedScalar ck_; @@ -114,6 +116,12 @@ public: // Member Functions + //- Return SGS kinetic energy + virtual tmp k() const + { + return k_; + } + //- Return the effective diffusivity for k tmp DkEff() const { diff --git a/src/turbulenceModels/incompressible/LES/GenEddyVisc/GenEddyVisc.H b/src/turbulenceModels/incompressible/LES/GenEddyVisc/GenEddyVisc.H index f5ee625ecc..9c4187e1c9 100644 --- a/src/turbulenceModels/incompressible/LES/GenEddyVisc/GenEddyVisc.H +++ b/src/turbulenceModels/incompressible/LES/GenEddyVisc/GenEddyVisc.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -67,8 +67,12 @@ class GenEddyVisc protected: + // Model coefficients + dimensionedScalar ce_; + // Fields + volScalarField nuSgs_;