diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C b/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C index fdddddfbfee1d75bd8b95ba5351581ff3dec79ee..821eb5adb0579ddf53af1006248d9177e01030ae 100644 --- a/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C +++ b/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -121,9 +121,8 @@ PDRkEpsilon::PDRkEpsilon IOobject::MUST_READ, IOobject::AUTO_WRITE ), - mesh_ + autoCreateK("k", mesh_) ), - epsilon_ ( IOobject @@ -134,9 +133,8 @@ PDRkEpsilon::PDRkEpsilon IOobject::MUST_READ, IOobject::AUTO_WRITE ), - mesh_ + autoCreateEpsilon("epsilon", mesh_) ), - mut_ ( IOobject @@ -147,9 +145,8 @@ PDRkEpsilon::PDRkEpsilon IOobject::NO_READ, IOobject::NO_WRITE ), - Cmu_*rho_*sqr(k_)/(epsilon_ + epsilonSmall_) + autoCreateMut("mut", mesh_) ), - alphat_ ( IOobject @@ -163,7 +160,9 @@ PDRkEpsilon::PDRkEpsilon autoCreateAlphat("alphat", mesh_) ) { - mut_ = Cmu_*rho_*sqr(k_)/(epsilon_ + epsilonSmall_); + bound(epsilon_, epsilonMin_); + + mut_ = Cmu_*rho_*sqr(k_)/epsilon_; mut_.correctBoundaryConditions(); alphat_ = mut_/Prt_; @@ -250,7 +249,7 @@ void PDRkEpsilon::correct() if (!turbulence_) { // Re-calculate viscosity - mut_ = rho_*Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_); + mut_ = rho_*Cmu_*sqr(k_)/epsilon_; mut_.correctBoundaryConditions(); // Re-calculate thermal diffusivity @@ -302,7 +301,7 @@ void PDRkEpsilon::correct() epsEqn().boundaryManipulate(epsilon_.boundaryField()); solve(epsEqn); - bound(epsilon_, epsilon0_); + bound(epsilon_, epsilonMin_); // Turbulent kinetic energy equation @@ -320,7 +319,7 @@ void PDRkEpsilon::correct() kEqn().relax(); solve(kEqn); - bound(k_, k0_); + bound(k_, kMin_); // Re-calculate viscosity mut_ = rho_*Cmu_*sqr(k_)/epsilon_; diff --git a/applications/solvers/multiphase/settlingFoam/kEpsilon.H b/applications/solvers/multiphase/settlingFoam/kEpsilon.H index 522a9afac7f814ba75914179853a53c360ff13a9..e27594ffed49a1d5b4804a6be73d0864a0c9e965 100644 --- a/applications/solvers/multiphase/settlingFoam/kEpsilon.H +++ b/applications/solvers/multiphase/settlingFoam/kEpsilon.H @@ -5,8 +5,8 @@ if (turbulence) y.correct(); } - dimensionedScalar k0("k0", k.dimensions(), SMALL); - dimensionedScalar epsilon0("epsilon0", epsilon.dimensions(), SMALL); + dimensionedScalar kMin("kMin", k.dimensions(), SMALL); + dimensionedScalar epsilonMin("epsilonMin", epsilon.dimensions(), SMALL); volScalarField divU = fvc::div(phi/fvc::interpolate(rho)); @@ -15,7 +15,7 @@ if (turbulence) tgradU.clear(); volScalarField Gcoef = - Cmu*k/sigmak*(g & fvc::grad(rho))/(epsilon + epsilon0); + Cmu*k/sigmak*(g & fvc::grad(rho))/(epsilon + epsilonMin); #include "wallFunctions.H" @@ -40,7 +40,7 @@ if (turbulence) epsEqn.relax(); epsEqn.solve(); - bound(epsilon, epsilon0); + bound(epsilon, epsilonMin); // Turbulent kinetic energy equation @@ -60,11 +60,13 @@ if (turbulence) - fvm::Sp(rho*epsilon/k, k) ); - bound(k, k0); + //FIXME: why no kEqn.relax()? + + bound(k, kMin); //- Re-calculate viscosity - mut = rho*Cmu*sqr(k)/(epsilon + epsilon0); + mut = rho*Cmu*sqr(k)/(epsilon + epsilonMin); #include "wallViscosity.H" } diff --git a/src/finiteVolume/cfdTools/general/bound/bound.C b/src/finiteVolume/cfdTools/general/bound/bound.C index b6290337546252e9c547907cde00c7989a5b5e05..7054434c0ff654f7934df602e962780538bdb375 100644 --- a/src/finiteVolume/cfdTools/general/bound/bound.C +++ b/src/finiteVolume/cfdTools/general/bound/bound.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,11 +30,11 @@ License // * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * // -void Foam::bound(volScalarField& vsf, const dimensionedScalar& vsf0) +void Foam::bound(volScalarField& vsf, const dimensionedScalar& lowerBound) { - scalar minVsf = min(vsf).value(); + const scalar minVsf = min(vsf).value(); - if (minVsf < vsf0.value()) + if (minVsf < lowerBound.value()) { Info<< "bounding " << vsf.name() << ", min: " << minVsf @@ -47,13 +47,13 @@ void Foam::bound(volScalarField& vsf, const dimensionedScalar& vsf0) max ( vsf.internalField(), - fvc::average(max(vsf, vsf0))().internalField() - *pos(-vsf.internalField()) + fvc::average(max(vsf, lowerBound))().internalField() + * pos(-vsf.internalField()) ), - vsf0.value() + lowerBound.value() ); - vsf.boundaryField() = max(vsf.boundaryField(), vsf0.value()); + vsf.boundaryField() = max(vsf.boundaryField(), lowerBound.value()); } } diff --git a/src/finiteVolume/cfdTools/general/bound/bound.H b/src/finiteVolume/cfdTools/general/bound/bound.H index 08a58e55504b474ac9a575beec9b572512410f01..f301c5a217f6e5337d74874b1536ce6d4378288d 100644 --- a/src/finiteVolume/cfdTools/general/bound/bound.H +++ b/src/finiteVolume/cfdTools/general/bound/bound.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,11 +23,13 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA InNamespace - Foam::bound + Foam Description - Bound the given scalar field if it has gone unbounded. Used extensively - in RAS and LES turbulence models. + Bound the given scalar field if it has gone unbounded. + + Used extensively in RAS and LES turbulence models, but also of use + within solvers. SourceFiles bound.C @@ -49,7 +51,7 @@ namespace Foam //- Bound the given scalar field if it has gone unbounded. // Used extensively in RAS and LES turbulence models. -void bound(volScalarField& vsf, const dimensionedScalar& vsf0); +void bound(volScalarField&, const dimensionedScalar& lowerBound); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/turbulenceModels/compressible/LES/DeardorffDiffStress/DeardorffDiffStress.C b/src/turbulenceModels/compressible/LES/DeardorffDiffStress/DeardorffDiffStress.C index 41063cd2cd9ceab0c265ad068e8223471ed21427..cff839b5e3714b3dcc3e6a315f50ccba72ff1b1b 100644 --- a/src/turbulenceModels/compressible/LES/DeardorffDiffStress/DeardorffDiffStress.C +++ b/src/turbulenceModels/compressible/LES/DeardorffDiffStress/DeardorffDiffStress.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -132,7 +132,7 @@ void DeardorffDiffStress::correct(const tmp<volTensorField>& tgradU) } K = 0.5*tr(B_); - bound(K, k0()); + bound(K, kMin_); updateSubGridScaleFields(K); } diff --git a/src/turbulenceModels/compressible/LES/LESModel/LESModel.C b/src/turbulenceModels/compressible/LES/LESModel/LESModel.C index 6ac295dea68c6bcf8ec213714e6fee2f40b45ed1..daeec0a05eee6d48dba7c8850e8da2d6ac7a55ea 100644 --- a/src/turbulenceModels/compressible/LES/LESModel/LESModel.C +++ b/src/turbulenceModels/compressible/LES/LESModel/LESModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -79,11 +79,11 @@ LESModel::LESModel printCoeffs_(lookupOrDefault<Switch>("printCoeffs", false)), coeffDict_(subOrEmptyDict(type + "Coeffs")), - k0_("k0", dimVelocity*dimVelocity, SMALL), + kMin_("kMin", dimVelocity*dimVelocity, SMALL), delta_(LESdelta::New("delta", U.mesh(), *this)) { - readIfPresent("k0", k0_); + readIfPresent("kMin", kMin_); // Force the construction of the mesh deltaCoeffs which may be needed // for the construction of the derived models and BCs @@ -167,7 +167,7 @@ bool LESModel::read() coeffDict_ <<= *dictPtr; } - readIfPresent("k0", k0_); + readIfPresent("kMin", kMin_); delta_().read(*this); diff --git a/src/turbulenceModels/compressible/LES/LESModel/LESModel.H b/src/turbulenceModels/compressible/LES/LESModel/LESModel.H index 2cdde6c61eda86c94183ae323944ef04866bdb89..6b10b930cccd63f432ece858d60d9f7b6a323a9c 100644 --- a/src/turbulenceModels/compressible/LES/LESModel/LESModel.H +++ b/src/turbulenceModels/compressible/LES/LESModel/LESModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -83,7 +83,7 @@ protected: Switch printCoeffs_; dictionary coeffDict_; - dimensionedScalar k0_; + dimensionedScalar kMin_; autoPtr<LESdelta> delta_; @@ -170,16 +170,16 @@ public: return coeffDict_; } - //- Return the value of k0 which k is not allowed to be less than - const dimensionedScalar& k0() const + //- Return the lower allowable limit for k (default: SMALL) + const dimensionedScalar& kMin() const { - return k0_; + return kMin_; } - //- Allow k0 to be changed - dimensionedScalar& k0() + //- Allow kMin to be changed + dimensionedScalar& kMin() { - return k0_; + return kMin_; } //- Access function to filter width diff --git a/src/turbulenceModels/compressible/LES/dynOneEqEddy/dynOneEqEddy.C b/src/turbulenceModels/compressible/LES/dynOneEqEddy/dynOneEqEddy.C index edd0f4bcf079b07f551a0e1fc831a075900ecc19..68233e0f28bdf4c035de4ac39f1027d57a0070d1 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-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -74,10 +74,10 @@ dimensionedScalar dynOneEqEddy::ce_(const volSymmTensorField& D) const pow(KK + filter_(k_), 1.5)/(2*delta()) - filter_(pow(k_, 1.5))/delta(); volScalarField ee = - 2*delta()*ck_(D)* - ( + 2*delta()*ck_(D) + *( filter_(sqrt(k_)*magSqr(D)) - - 2*sqrt(KK + filter_(k_))*magSqr(filter_(D)) + - 2*sqrt(KK + filter_(k_))*magSqr(filter_(D)) ); return average(ee*mm)/average(mm*mm); @@ -129,7 +129,11 @@ void dynOneEqEddy::correct(const tmp<volTensorField>& tgradU) - fvm::Sp(ce_(D)*rho()*sqrt(k_)/delta(), k_) ); - bound(k_, dimensionedScalar("0", k_.dimensions(), 1.0e-10)); + //FIXME: why not this? + // kEqn.relax(); + // kEqn.solve(); + + bound(k_, kMin_); updateSubGridScaleFields(D); } diff --git a/src/turbulenceModels/compressible/LES/lowReOneEqEddy/lowReOneEqEddy.C b/src/turbulenceModels/compressible/LES/lowReOneEqEddy/lowReOneEqEddy.C index 77b12af60e986f60818ce5a63aac45687f2642c6..696e9b8ddf738599ada4e90efeaafd046910acbc 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-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -117,7 +117,7 @@ void lowReOneEqEddy::correct(const tmp<volTensorField>& tgradU) - fvm::Sp(ce_*rho()*sqrt(k_)/delta(), k_) ); - bound(k_, k0()); + bound(k_, kMin_); updateSubGridScaleFields(); } diff --git a/src/turbulenceModels/compressible/LES/oneEqEddy/oneEqEddy.C b/src/turbulenceModels/compressible/LES/oneEqEddy/oneEqEddy.C index c6212dd74c250cc9faba61c91ad05d7792e68443..dd032dad791a6dcfdca51ef08db37abf16776d73 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-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -107,7 +107,7 @@ void oneEqEddy::correct(const tmp<volTensorField>& tgradU) kEqn.relax(); kEqn.solve(); - bound(k_, k0()); + bound(k_, kMin_); updateSubGridScaleFields(); } diff --git a/src/turbulenceModels/compressible/RAS/LRR/LRR.C b/src/turbulenceModels/compressible/RAS/LRR/LRR.C index e2d925c3bbf4616c0175371a4b03145b61a29160..06e23ecc9214a0131596a49870bba7838b9fd897 100644 --- a/src/turbulenceModels/compressible/RAS/LRR/LRR.C +++ b/src/turbulenceModels/compressible/RAS/LRR/LRR.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -229,7 +229,9 @@ LRR::LRR << exit(FatalError); } - mut_ = Cmu_*rho_*sqr(k_)/(epsilon_ + epsilonSmall_); + bound(epsilon_, epsilonMin_); + + mut_ = Cmu_*rho_*sqr(k_)/epsilon_; mut_.correctBoundaryConditions(); alphat_ = mut_/Prt_; @@ -324,7 +326,7 @@ void LRR::correct() if (!turbulence_) { // Re-calculate viscosity - mut_ = rho_*Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_); + mut_ = rho_*Cmu_*sqr(k_)/epsilon_; mut_.correctBoundaryConditions(); // Re-calculate thermal diffusivity @@ -359,7 +361,7 @@ void LRR::correct() epsEqn().boundaryManipulate(epsilon_.boundaryField()); solve(epsEqn); - bound(epsilon_, epsilon0_); + bound(epsilon_, epsilonMin_); // Reynolds stress equation @@ -406,15 +408,15 @@ void LRR::correct() R_.dimensions(), symmTensor ( - k0_.value(), -GREAT, -GREAT, - k0_.value(), -GREAT, - k0_.value() + kMin_.value(), -GREAT, -GREAT, + kMin_.value(), -GREAT, + kMin_.value() ) ) ); k_ = 0.5*tr(R_); - bound(k_, k0_); + bound(k_, kMin_); // Re-calculate viscosity diff --git a/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C b/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C index 66c54ec222233cd8cdbae18fc8b8f755e4533b82..e612cebecd5cf6bb521aecc0f55043f7e65518e8 100644 --- a/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C +++ b/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -258,7 +258,9 @@ LaunderGibsonRSTM::LaunderGibsonRSTM << exit(FatalError); } - mut_ = Cmu_*rho_*sqr(k_)/(epsilon_ + epsilonSmall_); + bound(epsilon_, epsilonMin_); + + mut_ = Cmu_*rho_*sqr(k_)/epsilon_; mut_.correctBoundaryConditions(); alphat_ = mut_/Prt_; @@ -357,7 +359,7 @@ void LaunderGibsonRSTM::correct() if (!turbulence_) { // Re-calculate viscosity - mut_ = rho_*Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_); + mut_ = rho_*Cmu_*sqr(k_)/epsilon_; mut_.correctBoundaryConditions(); // Re-calculate thermal diffusivity @@ -397,7 +399,7 @@ void LaunderGibsonRSTM::correct() epsEqn().boundaryManipulate(epsilon_.boundaryField()); solve(epsEqn); - bound(epsilon_, epsilon0_); + bound(epsilon_, epsilonMin_); // Reynolds stress equation @@ -453,15 +455,15 @@ void LaunderGibsonRSTM::correct() R_.dimensions(), symmTensor ( - k0_.value(), -GREAT, -GREAT, - k0_.value(), -GREAT, - k0_.value() + kMin_.value(), -GREAT, -GREAT, + kMin_.value(), -GREAT, + kMin_.value() ) ) ); k_ == 0.5*tr(R_); - bound(k_, k0_); + bound(k_, kMin_); // Re-calculate turbulent viscosity diff --git a/src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C b/src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C index f1dc4e9203767f045707e99ffb66103d7e5e47e4..149ed0b28939e179b0583ca03e8e0dec0770bd2e 100644 --- a/src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C +++ b/src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -187,7 +187,9 @@ LaunderSharmaKE::LaunderSharmaKE autoCreateAlphat("alphat", mesh_) ) { - mut_ = rho_*Cmu_*fMu()*sqr(k_)/(epsilon_ + epsilonSmall_); + bound(epsilon_, epsilonMin_); + + mut_ = rho_*Cmu_*fMu()*sqr(k_)/epsilon_; mut_.correctBoundaryConditions(); alphat_ = mut_/Prt_; @@ -275,7 +277,7 @@ void LaunderSharmaKE::correct() if (!turbulence_) { // Re-calculate viscosity - mut_ == rho_*Cmu_*fMu()*sqr(k_)/(epsilon_ + epsilonSmall_); + mut_ == rho_*Cmu_*fMu()*sqr(k_)/epsilon_; // Re-calculate thermal diffusivity alphat_ = mut_/Prt_; @@ -320,7 +322,7 @@ void LaunderSharmaKE::correct() epsEqn().relax(); solve(epsEqn); - bound(epsilon_, epsilon0_); + bound(epsilon_, epsilonMin_); // Turbulent kinetic energy equation @@ -338,11 +340,11 @@ void LaunderSharmaKE::correct() kEqn().relax(); solve(kEqn); - bound(k_, k0_); + bound(k_, kMin_); // Re-calculate viscosity - mut_ == Cmu_*fMu()*rho_*sqr(k_)/(epsilon_ + epsilonSmall_); + mut_ == Cmu_*fMu()*rho_*sqr(k_)/epsilon_; // Re-calculate thermal diffusivity diff --git a/src/turbulenceModels/compressible/RAS/RASModel/RASModel.C b/src/turbulenceModels/compressible/RAS/RASModel/RASModel.C index e5aa916702560e1a51c6820b7e1944bf66e98ad2..5ac546d69ce50e3d9a13b1a80540a63f1421018f 100644 --- a/src/turbulenceModels/compressible/RAS/RASModel/RASModel.C +++ b/src/turbulenceModels/compressible/RAS/RASModel/RASModel.C @@ -81,11 +81,9 @@ RASModel::RASModel printCoeffs_(lookupOrDefault<Switch>("printCoeffs", false)), coeffDict_(subOrEmptyDict(type + "Coeffs")), - k0_("k0", dimVelocity*dimVelocity, SMALL), - epsilon0_("epsilon0", k0_.dimensions()/dimTime, SMALL), - epsilonSmall_("epsilonSmall", epsilon0_.dimensions(), SMALL), - omega0_("omega0", dimless/dimTime, SMALL), - omegaSmall_("omegaSmall", omega0_.dimensions(), SMALL), + kMin_("kMin", dimVelocity*dimVelocity, SMALL), + epsilonMin_("epsilonMin", kMin_.dimensions()/dimTime, SMALL), + omegaMin_("omegaMin", dimless/dimTime, SMALL), y_(mesh_) { @@ -219,11 +217,9 @@ bool RASModel::read() coeffDict_ <<= *dictPtr; } - k0_.readIfPresent(*this); - epsilon0_.readIfPresent(*this); - epsilonSmall_.readIfPresent(*this); - omega0_.readIfPresent(*this); - omegaSmall_.readIfPresent(*this); + kMin_.readIfPresent(*this); + epsilonMin_.readIfPresent(*this); + omegaMin_.readIfPresent(*this); return true; } diff --git a/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H b/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H index d5a12902ccf5cf14c1b786823707d29d9fc6f902..9bddec38aa7f7d0eee0e5b9379af7944c0f5820c 100644 --- a/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H +++ b/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H @@ -93,19 +93,13 @@ protected: scalar yPlusLam_; //- Lower limit of k - dimensionedScalar k0_; + dimensionedScalar kMin_; //- Lower limit of epsilon - dimensionedScalar epsilon0_; - - //- Small epsilon value used to avoid divide by zero - dimensionedScalar epsilonSmall_; + dimensionedScalar epsilonMin_; //- Lower limit for omega - dimensionedScalar omega0_; - - //- Small omega value used to avoid divide by zero - dimensionedScalar omegaSmall_; + dimensionedScalar omegaMin_; //- Near wall distance boundary field nearWallDist y_; @@ -185,66 +179,40 @@ public: // Access - //- Return the lower allowable limit for k - const dimensionedScalar& k0() const - { - return k0_; - } - - //- Return the lower allowable limit for epsilon - const dimensionedScalar& epsilon0() const - { - return epsilon0_; - } - - //- Return the value of epsilonSmall which is added to epsilon when - // calculating mut - const dimensionedScalar& epsilonSmall() const - { - return epsilonSmall_; - } - - //- Return the lower allowable limit for omega - const dimensionedScalar& omega0() const - { - return omega0_; - } - - //- Return the value of omegaSmall which is added to omega when - // calculating mut - const dimensionedScalar& omegaSmall() const + //- Return the lower allowable limit for k (default: SMALL) + const dimensionedScalar& kMin() const { - return omegaSmall_; + return kMin_; } - //- Allow k0 to be changed - dimensionedScalar& k0() + //- Return the lower allowable limit for epsilon (default: SMALL) + const dimensionedScalar& epsilonMin() const { - return k0_; + return epsilonMin_; } - //- Allow epsilon0 to be changed - dimensionedScalar& epsilon0() + //- Return the lower allowable limit for omega (default: SMALL) + const dimensionedScalar& omegaMin() const { - return epsilon0_; + return omegaMin_; } - //- Allow epsilonSmall to be changed - dimensionedScalar& epsilonSmall() + //- Allow kMin to be changed + dimensionedScalar& kMin() { - return epsilonSmall_; + return kMin_; } - //- Allow omega0 to be changed - dimensionedScalar& omega0() + //- Allow epsilonMin to be changed + dimensionedScalar& epsilonMin() { - return omega0_; + return epsilonMin_; } - //- Allow omegaSmall to be changed - dimensionedScalar& omegaSmall() + //- Allow omegaMin to be changed + dimensionedScalar& omegaMin() { - return omegaSmall_; + return omegaMin_; } //- Return the near wall distances diff --git a/src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.C b/src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.C index 2fc2bdab294ab8a4c8247cd54e2a2f9ab92d80cd..fd3955a5730983a4bdb1caed80a107fc3686d8d1 100644 --- a/src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.C +++ b/src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -186,7 +186,9 @@ RNGkEpsilon::RNGkEpsilon autoCreateAlphat("alphat", mesh_) ) { - mut_ = Cmu_*rho_*sqr(k_)/(epsilon_ + epsilonSmall_); + bound(epsilon_, epsilonMin_); + + mut_ = Cmu_*rho_*sqr(k_)/epsilon_; mut_.correctBoundaryConditions(); alphat_ = mut_/Prt_; @@ -276,7 +278,7 @@ void RNGkEpsilon::correct() if (!turbulence_) { // Re-calculate viscosity - mut_ = rho_*Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_); + mut_ = rho_*Cmu_*sqr(k_)/epsilon_; mut_.correctBoundaryConditions(); // Re-calculate thermal diffusivity @@ -327,7 +329,7 @@ void RNGkEpsilon::correct() epsEqn().boundaryManipulate(epsilon_.boundaryField()); solve(epsEqn); - bound(epsilon_, epsilon0_); + bound(epsilon_, epsilonMin_); // Turbulent kinetic energy equation @@ -339,12 +341,12 @@ void RNGkEpsilon::correct() - fvm::laplacian(DkEff(), k_) == G - fvm::SuSp(2.0/3.0*rho_*divU, k_) - - fvm::Sp(rho_*(epsilon_)/k_, k_) + - fvm::Sp(rho_*epsilon_/k_, k_) ); kEqn().relax(); solve(kEqn); - bound(k_, k0_); + bound(k_, kMin_); // Re-calculate viscosity diff --git a/src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.C b/src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.C index e0c04f1e446f9594b093b3ea543954d7a670016f..43e63367cefdadb69edc1b3231b0ee2b6f153380 100644 --- a/src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.C +++ b/src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -168,7 +168,9 @@ kEpsilon::kEpsilon autoCreateAlphat("alphat", mesh_) ) { - mut_ = Cmu_*rho_*sqr(k_)/(epsilon_ + epsilonSmall_); + bound(epsilon_, epsilonMin_); + + mut_ = Cmu_*rho_*sqr(k_)/epsilon_; mut_.correctBoundaryConditions(); alphat_ = mut_/Prt_; @@ -257,7 +259,7 @@ void kEpsilon::correct() if (!turbulence_) { // Re-calculate viscosity - mut_ = rho_*Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_); + mut_ = rho_*Cmu_*sqr(k_)/epsilon_; mut_.correctBoundaryConditions(); // Re-calculate thermal diffusivity @@ -300,7 +302,7 @@ void kEpsilon::correct() epsEqn().boundaryManipulate(epsilon_.boundaryField()); solve(epsEqn); - bound(epsilon_, epsilon0_); + bound(epsilon_, epsilonMin_); // Turbulent kinetic energy equation @@ -318,7 +320,7 @@ void kEpsilon::correct() kEqn().relax(); solve(kEqn); - bound(k_, k0_); + bound(k_, kMin_); // Re-calculate viscosity diff --git a/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.C b/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.C index 23e9f0569fc299e3bb97b80ed8223f7d8dfd9b5e..6f9da54c9746d37fb2b67c494c27aac843a844a7 100644 --- a/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.C +++ b/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.C @@ -258,12 +258,14 @@ kOmegaSST::kOmegaSST autoCreateAlphat("alphat", mesh_) ) { + bound(omega_, omegaMin_); + mut_ = ( a1_*rho_*k_ / max ( - a1_*(omega_ + omegaSmall_), + a1_*omega_, F2()*sqrt(magSqr(symm(fvc::grad(U_)))) ) ); @@ -422,7 +424,7 @@ void kOmegaSST::correct() omegaEqn().boundaryManipulate(omega_.boundaryField()); solve(omegaEqn); - bound(omega_, omega0_); + bound(omega_, omegaMin_); // Turbulent kinetic energy equation tmp<fvScalarMatrix> kEqn @@ -438,7 +440,7 @@ void kOmegaSST::correct() kEqn().relax(); solve(kEqn); - bound(k_, k0_); + bound(k_, kMin_); // Re-calculate viscosity diff --git a/src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.C b/src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.C index a79eff7b8a9e7647e8a85022f55f445fed39d863..c03e603acf69d3b1eac5736f40b4426f8ff1d4c5 100644 --- a/src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.C +++ b/src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -69,7 +69,7 @@ tmp<volScalarField> realizableKE::rCmu volScalarField As = sqrt(6.0)*cos(phis); volScalarField Us = sqrt(S2/2.0 + magSqr(skew(gradU))); - return 1.0/(A0_ + As*Us*k_/(epsilon_ + epsilonSmall_)); + return 1.0/(A0_ + As*Us*k_/epsilon_); } @@ -200,10 +200,10 @@ realizableKE::realizableKE autoCreateAlphat("alphat", mesh_) ) { - bound(k_, k0_); - bound(epsilon_, epsilon0_); + bound(k_, kMin_); + bound(epsilon_, epsilonMin_); - mut_ = rCmu(fvc::grad(U_))*rho_*sqr(k_)/(epsilon_ + epsilonSmall_); + mut_ = rCmu(fvc::grad(U_))*rho_*sqr(k_)/epsilon_; mut_.correctBoundaryConditions(); alphat_ = mut_/Prt_; @@ -341,7 +341,7 @@ void realizableKE::correct() epsEqn().boundaryManipulate(epsilon_.boundaryField()); solve(epsEqn); - bound(epsilon_, epsilon0_); + bound(epsilon_, epsilonMin_); // Turbulent kinetic energy equation @@ -353,12 +353,12 @@ void realizableKE::correct() - fvm::laplacian(DkEff(), k_) == G - fvm::SuSp(2.0/3.0*rho_*divU, k_) - - fvm::Sp(rho_*(epsilon_)/k_, k_) + - fvm::Sp(rho_*epsilon_/k_, k_) ); kEqn().relax(); solve(kEqn); - bound(k_, k0_); + bound(k_, kMin_); // Re-calculate viscosity mut_ = rCmu(gradU, S2, magS)*rho_*sqr(k_)/epsilon_; diff --git a/src/turbulenceModels/incompressible/LES/DeardorffDiffStress/DeardorffDiffStress.C b/src/turbulenceModels/incompressible/LES/DeardorffDiffStress/DeardorffDiffStress.C index dd35b035ece5d9e6bcea56bd2d8909c83da1d60e..a5a0c562a13d69cd015a388f161dd4757ce3b8fe 100644 --- a/src/turbulenceModels/incompressible/LES/DeardorffDiffStress/DeardorffDiffStress.C +++ b/src/turbulenceModels/incompressible/LES/DeardorffDiffStress/DeardorffDiffStress.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -122,15 +122,15 @@ void DeardorffDiffStress::correct(const tmp<volTensorField>& tgradU) forAll(B_, celli) { B_[celli].component(symmTensor::XX) = - max(B_[celli].component(symmTensor::XX), k0().value()); + max(B_[celli].component(symmTensor::XX), kMin_.value()); B_[celli].component(symmTensor::YY) = - max(B_[celli].component(symmTensor::YY), k0().value()); + max(B_[celli].component(symmTensor::YY), kMin_.value()); B_[celli].component(symmTensor::ZZ) = - max(B_[celli].component(symmTensor::ZZ), k0().value()); + max(B_[celli].component(symmTensor::ZZ), kMin_.value()); } K = 0.5*tr(B_); - bound(K, k0()); + bound(K, kMin_); updateSubGridScaleFields(K); } diff --git a/src/turbulenceModels/incompressible/LES/LESModel/LESModel.C b/src/turbulenceModels/incompressible/LES/LESModel/LESModel.C index fd7791d9f322cfae4c5ba3bd81335d714fe00903..d32fd1647ac2549706d66352a8562fed7a6152bf 100644 --- a/src/turbulenceModels/incompressible/LES/LESModel/LESModel.C +++ b/src/turbulenceModels/incompressible/LES/LESModel/LESModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -78,10 +78,10 @@ LESModel::LESModel printCoeffs_(lookupOrDefault<Switch>("printCoeffs", false)), coeffDict_(subOrEmptyDict(type + "Coeffs")), - k0_("k0", dimVelocity*dimVelocity, SMALL), + kMin_("kMin", dimVelocity*dimVelocity, SMALL), delta_(LESdelta::New("delta", U.mesh(), *this)) { - readIfPresent("k0", k0_); + readIfPresent("kMin", kMin_); // Force the construction of the mesh deltaCoeffs which may be needed // for the construction of the derived models and BCs @@ -167,7 +167,7 @@ bool LESModel::read() delta_().read(*this); - readIfPresent("k0", k0_); + readIfPresent("kMin", kMin_); return true; } diff --git a/src/turbulenceModels/incompressible/LES/LESModel/LESModel.H b/src/turbulenceModels/incompressible/LES/LESModel/LESModel.H index 49fe52c4541d1ee46d56953f33a732c1869a0911..8b4b43ceda126b522643cae4ae40d3908bd53144 100644 --- a/src/turbulenceModels/incompressible/LES/LESModel/LESModel.H +++ b/src/turbulenceModels/incompressible/LES/LESModel/LESModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -83,7 +83,7 @@ protected: Switch printCoeffs_; dictionary coeffDict_; - dimensionedScalar k0_; + dimensionedScalar kMin_; autoPtr<LESdelta> delta_; @@ -171,16 +171,16 @@ public: return delta_(); } - //- Return the value of k0 which k is not allowed to be less than - const dimensionedScalar& k0() const + //- Return the lower allowable limit for k (default: SMALL) + const dimensionedScalar& kMin() const { - return k0_; + return kMin_; } - //- Allow k0 to be changed - dimensionedScalar& k0() + //- Allow kMin to be changed + dimensionedScalar& kMin() { - return k0_; + return kMin_; } diff --git a/src/turbulenceModels/incompressible/LES/LRRDiffStress/LRRDiffStress.C b/src/turbulenceModels/incompressible/LES/LRRDiffStress/LRRDiffStress.C index 58368cc587c12a74a477d6a85159492340a62bb2..10c0116b6a3f332d441cc1ae0ebd5fa07cf42186 100644 --- a/src/turbulenceModels/incompressible/LES/LRRDiffStress/LRRDiffStress.C +++ b/src/turbulenceModels/incompressible/LES/LRRDiffStress/LRRDiffStress.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -132,15 +132,15 @@ void LRRDiffStress::correct(const tmp<volTensorField>& tgradU) forAll(B_, celli) { B_[celli].component(symmTensor::XX) = - max(B_[celli].component(symmTensor::XX), k0().value()); + max(B_[celli].component(symmTensor::XX), kMin_.value()); B_[celli].component(symmTensor::YY) = - max(B_[celli].component(symmTensor::YY), k0().value()); + max(B_[celli].component(symmTensor::YY), kMin_.value()); B_[celli].component(symmTensor::ZZ) = - max(B_[celli].component(symmTensor::ZZ), k0().value()); + max(B_[celli].component(symmTensor::ZZ), kMin_.value()); } K = 0.5*tr(B_); - bound(K, k0()); + bound(K, kMin_); updateSubGridScaleFields(K); } diff --git a/src/turbulenceModels/incompressible/LES/dynOneEqEddy/dynOneEqEddy.C b/src/turbulenceModels/incompressible/LES/dynOneEqEddy/dynOneEqEddy.C index 4aadf02bf2ea098f7521c95f826768894638bae5..08f9c62fe7be657ac2f44d402d2c1e3c71c2edbc 100644 --- a/src/turbulenceModels/incompressible/LES/dynOneEqEddy/dynOneEqEddy.C +++ b/src/turbulenceModels/incompressible/LES/dynOneEqEddy/dynOneEqEddy.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -80,10 +80,10 @@ dimensionedScalar dynOneEqEddy::ce(const volSymmTensorField& D) const pow(KK + filter_(k_), 1.5)/(2*delta()) - filter_(pow(k_, 1.5))/delta(); volScalarField ee = - 2*delta()*ck(D) + 2*delta()*ck(D) *( - filter_(sqrt(k_)*magSqr(D)) - - 2*sqrt(KK + filter_(k_))*magSqr(filter_(D)) + filter_(sqrt(k_)*magSqr(D)) + - 2*sqrt(KK + filter_(k_))*magSqr(filter_(D)) ); dimensionedScalar mmmm = average(magSqr(mm)); @@ -135,8 +135,10 @@ dynOneEqEddy::dynOneEqEddy // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void dynOneEqEddy::correct(const tmp<volTensorField>& gradU) +void dynOneEqEddy::correct(const tmp<volTensorField>& tgradU) { + const volTensorField& gradU = tgradU(); + GenEddyVisc::correct(gradU); volSymmTensorField D = symm(gradU); @@ -156,7 +158,7 @@ void dynOneEqEddy::correct(const tmp<volTensorField>& gradU) kEqn.relax(); kEqn.solve(); - bound(k_, k0()); + bound(k_, kMin_); updateSubGridScaleFields(D); } diff --git a/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.C b/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.C index a755d4e56e8a02b6fccea56adf22b75043471c6a..86cd8227d10ff732b21c801ea95aa118cd548111 100644 --- a/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.C +++ b/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -263,8 +263,7 @@ kOmegaSSTSAS::kOmegaSSTSAS ) ), - omega0_("omega0", dimless/dimTime, SMALL), - omegaSmall_("omegaSmall", dimless/dimTime, SMALL), + omegaMin_("omegaMin", dimless/dimTime, SMALL), y_(mesh_), Cmu_ ( @@ -324,6 +323,8 @@ kOmegaSSTSAS::kOmegaSSTSAS mesh_ ) { + bound(omega_, omegaMin_); + updateSubGridScaleFields(magSqr(symm(fvc::grad(U)))); printCoeffs(); @@ -346,9 +347,8 @@ void kOmegaSSTSAS::correct(const tmp<volTensorField>& gradU) volVectorField gradK = fvc::grad(k_); volVectorField gradOmega = fvc::grad(omega_); - volScalarField L = sqrt(k_)/(pow025(Cmu_)*(omega_ + omegaSmall_)); - volScalarField CDkOmega = - (2.0*alphaOmega2_)*(gradK & gradOmega)/(omega_ + omegaSmall_); + volScalarField L = sqrt(k_)/(pow025(Cmu_)*omega_); + volScalarField CDkOmega = (2.0*alphaOmega2_)*(gradK & gradOmega)/omega_; volScalarField F1 = this->F1(CDkOmega); volScalarField G = nuSgs_*2.0*S2; @@ -368,14 +368,12 @@ void kOmegaSSTSAS::correct(const tmp<volTensorField>& gradU) kEqn.relax(); kEqn.solve(); } - bound(k_, k0()); + bound(k_, kMin_); volScalarField grad_omega_k = max ( - magSqr(gradOmega)/ - sqr(omega_ + omegaSmall_), - magSqr(gradK)/ - sqr(k_ + k0()) + magSqr(gradOmega)/sqr(omega_), + magSqr(gradK)/sqr(k_) ); // Turbulent frequency equation @@ -397,7 +395,7 @@ void kOmegaSSTSAS::correct(const tmp<volTensorField>& gradU) + FSAS_ *max ( - dimensionedScalar("zero",dimensionSet(0, 0 , -2, 0, 0),0. ), + dimensionedScalar("zero",dimensionSet(0, 0, -2, 0, 0), 0.0), zetaTilda2_*kappa_*S2*(L/Lvk2(S2)) - 2.0/alphaPhi_*k_*grad_omega_k ) @@ -406,7 +404,7 @@ void kOmegaSSTSAS::correct(const tmp<volTensorField>& gradU) omegaEqn.relax(); omegaEqn.solve(); } - bound(omega_, omega0_); + bound(omega_, omegaMin_); updateSubGridScaleFields(S2); } diff --git a/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.H b/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.H index 89b9a8819021d01d4d360e7e3111dcd1db1ffbd8..4c2ac8d55bc753d74c915daeb0b135fb13646405 100644 --- a/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.H +++ b/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -103,8 +103,7 @@ protected: dimensionedScalar zetaTilda2_; dimensionedScalar FSAS_; - dimensionedScalar omega0_; - dimensionedScalar omegaSmall_; + dimensionedScalar omegaMin_; wallDist y_; dimensionedScalar Cmu_; diff --git a/src/turbulenceModels/incompressible/LES/locDynOneEqEddy/locDynOneEqEddy.C b/src/turbulenceModels/incompressible/LES/locDynOneEqEddy/locDynOneEqEddy.C index f463e3f2082aad874af2ce36dfd8def76e93ed75..3decb7080e9be7fbdb7e1f13e64bcb82e2d67ee7 100644 --- a/src/turbulenceModels/incompressible/LES/locDynOneEqEddy/locDynOneEqEddy.C +++ b/src/turbulenceModels/incompressible/LES/locDynOneEqEddy/locDynOneEqEddy.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -152,7 +152,7 @@ void locDynOneEqEddy::correct(const tmp<volTensorField>& gradU) kEqn.relax(); kEqn.solve(); - bound(k_, k0()); + bound(k_, kMin_); updateSubGridScaleFields(D, KK); } diff --git a/src/turbulenceModels/incompressible/LES/oneEqEddy/oneEqEddy.C b/src/turbulenceModels/incompressible/LES/oneEqEddy/oneEqEddy.C index 28a0a1ed5a00ddac94a2b0818ee2343c279f9faf..96188e59e4cbc1747e75e7c9c6e2a5ecba8e369d 100644 --- a/src/turbulenceModels/incompressible/LES/oneEqEddy/oneEqEddy.C +++ b/src/turbulenceModels/incompressible/LES/oneEqEddy/oneEqEddy.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -113,7 +113,7 @@ void oneEqEddy::correct(const tmp<volTensorField>& gradU) kEqn.relax(); kEqn.solve(); - bound(k_, k0()); + bound(k_, kMin_); updateSubGridScaleFields(); } diff --git a/src/turbulenceModels/incompressible/RAS/LRR/LRR.C b/src/turbulenceModels/incompressible/RAS/LRR/LRR.C index 08d1b4a39aaefcb1a9686281ae1672ed29e9d0b5..037da5b430aff25fce6f6d0c6eac469b8164bf17 100644 --- a/src/turbulenceModels/incompressible/RAS/LRR/LRR.C +++ b/src/turbulenceModels/incompressible/RAS/LRR/LRR.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -186,9 +186,6 @@ LRR::LRR autoCreateNut("nut", mesh_) ) { - nut_ = Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_); - nut_.correctBoundaryConditions(); - if (couplingFactor_.value() < 0.0 || couplingFactor_.value() > 1.0) { FatalErrorIn @@ -201,6 +198,11 @@ LRR::LRR << exit(FatalError); } + bound(epsilon_, epsilonMin_); + + nut_ = Cmu_*sqr(k_)/epsilon_; + nut_.correctBoundaryConditions(); + printCoeffs(); } @@ -320,7 +322,7 @@ void LRR::correct() epsEqn().boundaryManipulate(epsilon_.boundaryField()); solve(epsEqn); - bound(epsilon_, epsilon0_); + bound(epsilon_, epsilonMin_); // Reynolds stress equation @@ -368,15 +370,15 @@ void LRR::correct() R_.dimensions(), symmTensor ( - k0_.value(), -GREAT, -GREAT, - k0_.value(), -GREAT, - k0_.value() + kMin_.value(), -GREAT, -GREAT, + kMin_.value(), -GREAT, + kMin_.value() ) ) ); k_ = 0.5*tr(R_); - bound(k_, k0_); + bound(k_, kMin_); // Re-calculate viscosity diff --git a/src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.C b/src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.C index 1edcb224b556829a6a0aa2a1a8ce383ed251b662..b6d20aea2d41f29f303e81da6c3df95af3be8adf 100644 --- a/src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.C +++ b/src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -140,7 +140,9 @@ LamBremhorstKE::LamBremhorstKE autoCreateLowReNut("nut", mesh_) ) { - nut_ = Cmu_*fMu_*sqr(k_)/(epsilon_ + epsilonSmall_); + bound(epsilon_, epsilonMin_); + + nut_ = Cmu_*fMu_*sqr(k_)/epsilon_; nut_.correctBoundaryConditions(); printCoeffs(); @@ -260,7 +262,7 @@ void LamBremhorstKE::correct() epsEqn().relax(); solve(epsEqn); - bound(epsilon_, epsilon0_); + bound(epsilon_, epsilonMin_); // Turbulent kinetic energy equation @@ -276,7 +278,7 @@ void LamBremhorstKE::correct() kEqn().relax(); solve(kEqn); - bound(k_, k0_); + bound(k_, kMin_); // Re-calculate viscosity diff --git a/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C b/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C index 33939dfc15f32f79a28c0d32c2bb4cb9ce0fbf99..98001c6a68811bc8a753ec6079cfab0dc8505391 100644 --- a/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C +++ b/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -224,7 +224,9 @@ LaunderGibsonRSTM::LaunderGibsonRSTM autoCreateNut("nut", mesh_) ) { - nut_ = Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_); + bound(epsilon_, epsilonMin_); + + nut_ = Cmu_*sqr(k_)/epsilon_; nut_.correctBoundaryConditions(); if (couplingFactor_.value() < 0.0 || couplingFactor_.value() > 1.0) @@ -362,7 +364,7 @@ void LaunderGibsonRSTM::correct() epsEqn().boundaryManipulate(epsilon_.boundaryField()); solve(epsEqn); - bound(epsilon_, epsilon0_); + bound(epsilon_, epsilonMin_); // Reynolds stress equation @@ -419,15 +421,15 @@ void LaunderGibsonRSTM::correct() R_.dimensions(), symmTensor ( - k0_.value(), -GREAT, -GREAT, - k0_.value(), -GREAT, - k0_.value() + kMin_.value(), -GREAT, -GREAT, + kMin_.value(), -GREAT, + kMin_.value() ) ) ); k_ == 0.5*tr(R_); - bound(k_, k0_); + bound(k_, kMin_); // Re-calculate turbulent viscosity diff --git a/src/turbulenceModels/incompressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C b/src/turbulenceModels/incompressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C index 3bbdcb6a4734a47eee3a0543d5ed6d741d653e12..6f840c57d38d1d3a880ef854a40b04e0ae7af44b 100644 --- a/src/turbulenceModels/incompressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C +++ b/src/turbulenceModels/incompressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -146,7 +146,9 @@ LaunderSharmaKE::LaunderSharmaKE autoCreateLowReNut("nut", mesh_) ) { - nut_ = Cmu_*fMu()*sqr(k_)/(epsilonTilda_ + epsilonSmall_); + bound(epsilonTilda_, epsilonMin_); + + nut_ = Cmu_*fMu()*sqr(k_)/epsilonTilda_; nut_.correctBoundaryConditions(); printCoeffs(); @@ -256,7 +258,7 @@ void LaunderSharmaKE::correct() epsEqn().relax(); solve(epsEqn); - bound(epsilonTilda_, epsilon0_); + bound(epsilonTilda_, epsilonMin_); // Turbulent kinetic energy equation @@ -272,7 +274,7 @@ void LaunderSharmaKE::correct() kEqn().relax(); solve(kEqn); - bound(k_, k0_); + bound(k_, kMin_); // Re-calculate viscosity diff --git a/src/turbulenceModels/incompressible/RAS/LienCubicKE/LienCubicKE.C b/src/turbulenceModels/incompressible/RAS/LienCubicKE/LienCubicKE.C index c786116bd9dd1652bcdd24027a8b18074312610b..f01805f115606666ca4da22ca493277199a5e69b 100644 --- a/src/turbulenceModels/incompressible/RAS/LienCubicKE/LienCubicKE.C +++ b/src/turbulenceModels/incompressible/RAS/LienCubicKE/LienCubicKE.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -170,6 +170,8 @@ LienCubicKE::LienCubicKE autoCreateEpsilon("epsilon", mesh_) ), + //FIXME - epsilon is not bounded + gradU_(fvc::grad(U)), eta_(k_/epsilon_*sqrt(2.0*magSqr(0.5*(gradU_ + gradU_.T())))), ksi_(k_/epsilon_*sqrt(2.0*magSqr(0.5*(gradU_ - gradU_.T())))), @@ -226,7 +228,9 @@ LienCubicKE::LienCubicKE ) ) { - nut_ = Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_) + C5viscosity_; + bound(epsilon_, epsilonMin_); + + nut_ = Cmu_*sqr(k_)/epsilon_ + C5viscosity_; nut_.correctBoundaryConditions(); printCoeffs(); @@ -350,7 +354,7 @@ void LienCubicKE::correct() epsEqn().boundaryManipulate(epsilon_.boundaryField()); solve(epsEqn); - bound(epsilon_, epsilon0_); + bound(epsilon_, epsilonMin_); // Turbulent kinetic energy equation @@ -367,7 +371,7 @@ void LienCubicKE::correct() kEqn().relax(); solve(kEqn); - bound(k_, k0_); + bound(k_, kMin_); // Re-calculate viscosity diff --git a/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.C b/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.C index 886b984f57215d0db703f14b437817969ebca825..8c7bbc7c7b09b0848b1ca03bd1f665a90757c60d 100644 --- a/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.C +++ b/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.C @@ -280,10 +280,12 @@ LienCubicKELowRe::LienCubicKELowRe ) ) { + bound(epsilon_, epsilonMin_); + nut_ = Cmu_ * (scalar(1) - exp(-Am_*yStar_)) / (scalar(1) - exp(-Aepsilon_*yStar_) + SMALL) - * sqr(k_)/(epsilon_ + epsilonSmall_) + * sqr(k_)/epsilon_ // cubic term C5, implicit part + max ( @@ -432,7 +434,7 @@ void LienCubicKELowRe::correct() # include "wallDissipationI.H" solve(epsEqn); - bound(epsilon_, epsilon0_); + bound(epsilon_, epsilonMin_); // Turbulent kinetic energy equation @@ -449,7 +451,7 @@ void LienCubicKELowRe::correct() kEqn().relax(); solve(kEqn); - bound(k_, k0_); + bound(k_, kMin_); // Re-calculate viscosity diff --git a/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.C b/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.C index 6e47e1d926f77bd2e5a794decc8a6c4c16ddfd65..a2a807676dd8bca6f65b5bd04acff34993d56242 100644 --- a/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.C +++ b/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -180,9 +180,11 @@ LienLeschzinerLowRe::LienLeschzinerLowRe autoCreateLowReNut("nut", mesh_) ) { + bound(epsilon_, epsilonMin_); + nut_ = Cmu_*(scalar(1) - exp(-Am_*yStar_)) /(scalar(1) - exp(-Aepsilon_*yStar_) + SMALL)*sqr(k_) - /(epsilon_ + epsilonSmall_); + /(epsilon_); nut_.correctBoundaryConditions(); printCoeffs(); @@ -322,7 +324,7 @@ void LienLeschzinerLowRe::correct() #include "wallDissipationI.H" solve(epsEqn); - bound(epsilon_, epsilon0_); + bound(epsilon_, epsilonMin_); // Turbulent kinetic energy equation @@ -339,7 +341,7 @@ void LienLeschzinerLowRe::correct() kEqn().relax(); solve(kEqn); - bound(k_, k0_); + bound(k_, kMin_); // Re-calculate viscosity diff --git a/src/turbulenceModels/incompressible/RAS/NonlinearKEShih/NonlinearKEShih.C b/src/turbulenceModels/incompressible/RAS/NonlinearKEShih/NonlinearKEShih.C index f6d778b3a6f68b8762725a8c798bc3c0f926bc56..01324af90a21f5f9a0d2e513e5018560ae071fe6 100644 --- a/src/turbulenceModels/incompressible/RAS/NonlinearKEShih/NonlinearKEShih.C +++ b/src/turbulenceModels/incompressible/RAS/NonlinearKEShih/NonlinearKEShih.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -144,6 +144,7 @@ NonlinearKEShih::NonlinearKEShih ) ), + //FIXME: should be named 'kappa_' or 'kappa'? kappa_ ( dimensioned<scalar>::lookupOrAddToDict @@ -174,6 +175,7 @@ NonlinearKEShih::NonlinearKEShih IOobject::AUTO_WRITE ), mesh_ + //FIXME: what about autoCreateK("k", mesh_) ), epsilon_ @@ -187,15 +189,32 @@ NonlinearKEShih::NonlinearKEShih IOobject::AUTO_WRITE ), mesh_ + //FIXME: what about autoCreateK("epsilon", mesh_) ), + //FIXME: epsilon is not bounded + gradU_(fvc::grad(U)), eta_(k_/epsilon_*sqrt(2.0*magSqr(0.5*(gradU_ + gradU_.T())))), ksi_(k_/epsilon_*sqrt(2.0*magSqr(0.5*(gradU_ - gradU_.T())))), Cmu_(2.0/(3.0*(A1_ + eta_ + alphaKsi_*ksi_))), fEta_(A2_ + pow(eta_, 3.0)), - nut_("nut", Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_)), + // FIXME: epsilon is not bounded + nut_("nut", Cmu_*sqr(k_)/(epsilon_ + epsilonMin_)), + // FIXME: why not use the following? + // nut_ + // ( + // IOobject + // ( + // "nut", + // runTime_.timeName(), + // mesh_, + // IOobject::NO_READ, + // IOobject::AUTO_WRITE + // ), + // autoCreateNut("nut", mesh_) + // ), nonlinearStress_ ( @@ -215,6 +234,11 @@ NonlinearKEShih::NonlinearKEShih ) ) { + bound(epsilon_, epsilonMin_); + + //FIXME: could use this + // nut_ = Cmu_*sqr(k_)/epsilon_; + #include "wallNonlinearViscosityI.H" printCoeffs(); @@ -343,7 +367,7 @@ void NonlinearKEShih::correct() #include "wallDissipationI.H" solve(epsEqn); - bound(epsilon_, epsilon0_); + bound(epsilon_, epsilonMin_); // Turbulent kinetic energy equation @@ -360,7 +384,7 @@ void NonlinearKEShih::correct() kEqn().relax(); solve(kEqn); - bound(k_, k0_); + bound(k_, kMin_); // Re-calculate viscosity diff --git a/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.C b/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.C index 8944f94c2334c4c2124006867042000d997eeece..f45c1ee0ff13fe3cf4c54cce36c75393336b83fc 100644 --- a/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.C +++ b/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.C @@ -80,11 +80,9 @@ RASModel::RASModel printCoeffs_(lookupOrDefault<Switch>("printCoeffs", false)), coeffDict_(subOrEmptyDict(type + "Coeffs")), - k0_("k0", dimVelocity*dimVelocity, SMALL), - epsilon0_("epsilon0", k0_.dimensions()/dimTime, SMALL), - epsilonSmall_("epsilonSmall", epsilon0_.dimensions(), SMALL), - omega0_("omega0", dimless/dimTime, SMALL), - omegaSmall_("omegaSmall", omega0_.dimensions(), SMALL), + kMin_("kMin", dimVelocity*dimVelocity, SMALL), + epsilonMin_("epsilonMin", kMin_.dimensions()/dimTime, SMALL), + omegaMin_("omegaMin", dimless/dimTime, SMALL), y_(mesh_) { @@ -213,11 +211,9 @@ bool RASModel::read() coeffDict_ <<= *dictPtr; } - k0_.readIfPresent(*this); - epsilon0_.readIfPresent(*this); - epsilonSmall_.readIfPresent(*this); - omega0_.readIfPresent(*this); - omegaSmall_.readIfPresent(*this); + kMin_.readIfPresent(*this); + epsilonMin_.readIfPresent(*this); + omegaMin_.readIfPresent(*this); return true; } diff --git a/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.H b/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.H index a8eab758f04c719dd31b2ed28e51454a660128b3..337f044f0a5e27c289cb426f984647180a1fad9c 100644 --- a/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.H +++ b/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.H @@ -87,19 +87,13 @@ protected: dictionary coeffDict_; //- Lower limit of k - dimensionedScalar k0_; + dimensionedScalar kMin_; //- Lower limit of epsilon - dimensionedScalar epsilon0_; - - //- Small epsilon value used to avoid divide by zero - dimensionedScalar epsilonSmall_; + dimensionedScalar epsilonMin_; //- Lower limit for omega - dimensionedScalar omega0_; - - //- Small omega value used to avoid divide by zero - dimensionedScalar omegaSmall_; + dimensionedScalar omegaMin_; //- Near wall distance boundary field nearWallDist y_; @@ -176,66 +170,40 @@ public: // Access - //- Return lower allowable limit for k - const dimensionedScalar& k0() const - { - return k0_; - } - - //- Return the lower allowable limit for epsilon - const dimensionedScalar& epsilon0() const - { - return epsilon0_; - } - - //- Return the value of epsilonSmall which is added to epsilon when - // calculating nut - const dimensionedScalar& epsilonSmall() const - { - return epsilonSmall_; - } - - //- Return the lower allowable limit for omega0 - const dimensionedScalar& omega0() const - { - return omega0_; - } - - //- Return the value of omegaSmall which is added to omega when - // calculating nut - const dimensionedScalar& omegaSmall() const + //- Return lower allowable limit for k (default: SMALL) + const dimensionedScalar& kMin() const { - return omegaSmall_; + return kMin_; } - //- Allow k0 to be changed - dimensionedScalar& k0() + //- Return the lower allowable limit for epsilon (default: SMALL) + const dimensionedScalar& epsilonMin() const { - return k0_; + return epsilonMin_; } - //- Allow epsilon0 to be changed - dimensionedScalar& epsilon0() + //- Return the lower allowable limit for omega (default: SMALL) + const dimensionedScalar& omegaMin() const { - return epsilon0_; + return omegaMin_; } - //- Allow epsilonSmall to be changed - dimensionedScalar& epsilonSmall() + //- Allow kMin to be changed + dimensionedScalar& kMin() { - return epsilonSmall_; + return kMin_; } - //- Allow omega0 to be changed - dimensionedScalar& omega0() + //- Allow epsilonMin to be changed + dimensionedScalar& epsilonMin() { - return omega0_; + return epsilonMin_; } - //- Allow omegaSmall to be changed - dimensionedScalar& omegaSmall() + //- Allow omegaMin to be changed + dimensionedScalar& omegaMin() { - return omegaSmall_; + return omegaMin_; } //- Return the near wall distances diff --git a/src/turbulenceModels/incompressible/RAS/RNGkEpsilon/RNGkEpsilon.C b/src/turbulenceModels/incompressible/RAS/RNGkEpsilon/RNGkEpsilon.C index aa7e53700195d98a9ef0f51a819a332e1df88a4f..1591608717616dea676ac56fd4340dd71ebf20ae 100644 --- a/src/turbulenceModels/incompressible/RAS/RNGkEpsilon/RNGkEpsilon.C +++ b/src/turbulenceModels/incompressible/RAS/RNGkEpsilon/RNGkEpsilon.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -155,7 +155,9 @@ RNGkEpsilon::RNGkEpsilon autoCreateNut("nut", mesh_) ) { - nut_ = Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_); + bound(epsilon_, epsilonMin_); + + nut_ = Cmu_*sqr(k_)/epsilon_; nut_.correctBoundaryConditions(); printCoeffs(); @@ -274,7 +276,7 @@ void RNGkEpsilon::correct() epsEqn().boundaryManipulate(epsilon_.boundaryField()); solve(epsEqn); - bound(epsilon_, epsilon0_); + bound(epsilon_, epsilonMin_); // Turbulent kinetic energy equation @@ -290,7 +292,7 @@ void RNGkEpsilon::correct() kEqn().relax(); solve(kEqn); - bound(k_, k0_); + bound(k_, kMin_); // Re-calculate viscosity diff --git a/src/turbulenceModels/incompressible/RAS/kEpsilon/kEpsilon.C b/src/turbulenceModels/incompressible/RAS/kEpsilon/kEpsilon.C index 08618636737bd6da17157329b66ec81efe546580..8c41bf4d2786f5f2bc5da29e466611ccadec0187 100644 --- a/src/turbulenceModels/incompressible/RAS/kEpsilon/kEpsilon.C +++ b/src/turbulenceModels/incompressible/RAS/kEpsilon/kEpsilon.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -128,7 +128,9 @@ kEpsilon::kEpsilon autoCreateNut("nut", mesh_) ) { - nut_ = Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_); + bound(epsilon_, epsilonMin_); + + nut_ = Cmu_*sqr(k_)/epsilon_; nut_.correctBoundaryConditions(); printCoeffs(); @@ -237,7 +239,7 @@ void kEpsilon::correct() epsEqn().boundaryManipulate(epsilon_.boundaryField()); solve(epsEqn); - bound(epsilon_, epsilon0_); + bound(epsilon_, epsilonMin_); // Turbulent kinetic energy equation @@ -254,7 +256,7 @@ void kEpsilon::correct() kEqn().relax(); solve(kEqn); - bound(k_, k0_); + bound(k_, kMin_); // Re-calculate viscosity diff --git a/src/turbulenceModels/incompressible/RAS/kOmega/kOmega.C b/src/turbulenceModels/incompressible/RAS/kOmega/kOmega.C index 64b095d27b9b6933f7e7aa25e3879bac43238ce4..04f505376b9e36715c4e0dde6d95ca11a93ceaa0 100644 --- a/src/turbulenceModels/incompressible/RAS/kOmega/kOmega.C +++ b/src/turbulenceModels/incompressible/RAS/kOmega/kOmega.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -137,7 +137,9 @@ kOmega::kOmega autoCreateNut("nut", mesh_) ) { - nut_ = k_/(omega_ + omegaSmall_); + bound(omega_, omegaMin_); + + nut_ = k_/omega_; nut_.correctBoundaryConditions(); printCoeffs(); @@ -246,7 +248,7 @@ void kOmega::correct() omegaEqn().boundaryManipulate(omega_.boundaryField()); solve(omegaEqn); - bound(omega_, omega0_); + bound(omega_, omegaMin_); // Turbulent kinetic energy equation @@ -263,11 +265,11 @@ void kOmega::correct() kEqn().relax(); solve(kEqn); - bound(k_, k0_); + bound(k_, kMin_); // Re-calculate viscosity - nut_ = k_/(omega_ + omegaSmall_); + nut_ = k_/omega_; nut_.correctBoundaryConditions(); } diff --git a/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C b/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C index 8323a23011d63d69c34a01ec84226025be6025f4..4332fc3706fac8a15d6db7d9f6d62152030dd993 100644 --- a/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C +++ b/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C @@ -236,12 +236,14 @@ kOmegaSST::kOmegaSST autoCreateNut("nut", mesh_) ) { + bound(omega_, omegaMin_); + nut_ = ( a1_*k_ / max ( - a1_*(omega_ + omegaSmall_), + a1_*omega_, F2()*mag(symm(fvc::grad(U_))) ) ); @@ -376,7 +378,7 @@ void kOmegaSST::correct() omegaEqn().boundaryManipulate(omega_.boundaryField()); solve(omegaEqn); - bound(omega_, omega0_); + bound(omega_, omegaMin_); // Turbulent kinetic energy equation tmp<fvScalarMatrix> kEqn @@ -392,7 +394,7 @@ void kOmegaSST::correct() kEqn().relax(); solve(kEqn); - bound(k_, k0_); + bound(k_, kMin_); // Re-calculate viscosity diff --git a/src/turbulenceModels/incompressible/RAS/qZeta/qZeta.C b/src/turbulenceModels/incompressible/RAS/qZeta/qZeta.C index 9b16f1c621076a051cd969a5e126147bd418a9d1..d72fd30f3e7a6d439971c6fb64d53999919b7816 100644 --- a/src/turbulenceModels/incompressible/RAS/qZeta/qZeta.C +++ b/src/turbulenceModels/incompressible/RAS/qZeta/qZeta.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -126,6 +126,9 @@ qZeta::qZeta ) ), + qMin_("qMin", dimVelocity, SMALL), + zetaMin_("zetaMin", dimVelocity/dimTime, SMALL), + k_ ( IOobject @@ -193,7 +196,11 @@ qZeta::qZeta autoCreateNut("nut", mesh_) ) { - nut_ = Cmu_*fMu()*sqr(k_)/(epsilon_ + epsilonSmall_); + bound(epsilon_, epsilonMin_); + bound(q_, qMin_); + bound(zeta_, zetaMin_); + + nut_ = Cmu_*fMu()*sqr(k_)/epsilon_; nut_.correctBoundaryConditions(); printCoeffs(); @@ -263,6 +270,9 @@ bool qZeta::read() sigmaZeta_.readIfPresent(coeffDict()); anisotropic_.readIfPresent("anisotropic", coeffDict()); + qMin_.readIfPresent(*this); + zetaMin_.readIfPresent(*this); + return true; } else @@ -302,7 +312,7 @@ void qZeta::correct() zetaEqn().relax(); solve(zetaEqn); - bound(zeta_, epsilon0_/(2*sqrt(k0_))); + bound(zeta_, zetaMin_); // q equation @@ -318,7 +328,7 @@ void qZeta::correct() qEqn().relax(); solve(qEqn); - bound(q_, sqrt(k0_)); + bound(q_, qMin_); // Re-calculate k and epsilon diff --git a/src/turbulenceModels/incompressible/RAS/qZeta/qZeta.H b/src/turbulenceModels/incompressible/RAS/qZeta/qZeta.H index 6300868d2d7f8b40b0d47bdc5c8068ad381846cb..4c396c13a13e18c8643d1b396ebd5a675682f50f 100644 --- a/src/turbulenceModels/incompressible/RAS/qZeta/qZeta.H +++ b/src/turbulenceModels/incompressible/RAS/qZeta/qZeta.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -66,6 +66,11 @@ class qZeta dimensionedScalar sigmaZeta_; Switch anisotropic_; + //- Lower limit of q + dimensionedScalar qMin_; + + //- Lower limit of zeta + dimensionedScalar zetaMin_; // Fields @@ -107,6 +112,33 @@ public: // Member Functions + // Access + + //- Return lower allowable limit for q (default: SMALL) + const dimensionedScalar& qMin() const + { + return qMin_; + } + + //- Return the lower allowable limit for zeta (default: SMALL) + const dimensionedScalar& zetaMin() const + { + return zetaMin_; + } + + //- Allow qMin to be changed + dimensionedScalar& qMin() + { + return qMin_; + } + + //- Allow zetaMin to be changed + dimensionedScalar& zetaMin() + { + return zetaMin_; + } + + //- Return the turbulence viscosity virtual tmp<volScalarField> nut() const { diff --git a/src/turbulenceModels/incompressible/RAS/realizableKE/realizableKE.C b/src/turbulenceModels/incompressible/RAS/realizableKE/realizableKE.C index 5072f9b1cffb87e5d6f4f7041caebaac68e62e84..5a53c6b0fc0826085dc5a6dec001928817ca1909 100644 --- a/src/turbulenceModels/incompressible/RAS/realizableKE/realizableKE.C +++ b/src/turbulenceModels/incompressible/RAS/realizableKE/realizableKE.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -69,7 +69,7 @@ tmp<volScalarField> realizableKE::rCmu volScalarField As = sqrt(6.0)*cos(phis); volScalarField Us = sqrt(S2/2.0 + magSqr(skew(gradU))); - return 1.0/(A0_ + As*Us*k_/(epsilon_ + epsilonSmall_)); + return 1.0/(A0_ + As*Us*k_/epsilon_); } @@ -178,10 +178,10 @@ realizableKE::realizableKE autoCreateNut("nut", mesh_) ) { - bound(k_, k0_); - bound(epsilon_, epsilon0_); + bound(k_, kMin_); + bound(epsilon_, epsilonMin_); - nut_ = rCmu(fvc::grad(U_))*sqr(k_)/(epsilon_ + epsilonSmall_); + nut_ = rCmu(fvc::grad(U_))*sqr(k_)/epsilon_; nut_.correctBoundaryConditions(); printCoeffs(); @@ -303,7 +303,7 @@ void realizableKE::correct() epsEqn().boundaryManipulate(epsilon_.boundaryField()); solve(epsEqn); - bound(epsilon_, epsilon0_); + bound(epsilon_, epsilonMin_); // Turbulent kinetic energy equation @@ -319,7 +319,7 @@ void realizableKE::correct() kEqn().relax(); solve(kEqn); - bound(k_, k0_); + bound(k_, kMin_); // Re-calculate viscosity