From 1b94025a64373af990803c60ca42524354ffee67 Mon Sep 17 00:00:00 2001 From: sergio Date: Mon, 14 Dec 2015 15:05:44 -0800 Subject: [PATCH] BUG: adding limiter for KK to dynamicKEqn. Fixing access to tmp of nuEff. --- .../turbulenceModels/LES/dynamicKEqn/dynamicKEqn.C | 8 +++++++- .../fixedShearStress/fixedShearStressFvPatchVectorField.C | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/TurbulenceModels/turbulenceModels/LES/dynamicKEqn/dynamicKEqn.C b/src/TurbulenceModels/turbulenceModels/LES/dynamicKEqn/dynamicKEqn.C index ac076991e8..19f557bc36 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/dynamicKEqn/dynamicKEqn.C +++ b/src/TurbulenceModels/turbulenceModels/LES/dynamicKEqn/dynamicKEqn.C @@ -48,7 +48,13 @@ volScalarField dynamicKEqn::Ck const volSymmTensorField MM ( - simpleFilter_(-2.0*this->delta()*sqrt(KK)*filter_(D)) + simpleFilter_ + ( + -2.0*this->delta()*sqrt + ( + max(KK, dimensionedScalar("zero", KK.dimensions(), 0.0)) + )*filter_(D) + ) ); const volScalarField Ck diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C index db6e0ecd43..291d5d33dc 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C @@ -109,7 +109,7 @@ void Foam::fixedShearStressFvPatchVectorField::updateCoeffs() ) ); - scalarField nuEff(turbModel.nuEff()()[patch().index()]); + tmp nuEff(turbModel.nuEff(patch().index())); const vectorField Uc(patchInternalField()); @@ -117,7 +117,7 @@ void Foam::fixedShearStressFvPatchVectorField::updateCoeffs() const scalarField& ry = patch().deltaCoeffs(); - operator==(tauHat*(tauHat & (tau0_*(1.0/(ry*nuEff)) + Uc))); + operator==(tauHat*(tauHat & (tau0_*(1.0/(ry*nuEff())) + Uc))); fixedValueFvPatchVectorField::updateCoeffs(); }