From 6656daf4a2a118b0c2038a20e448e5fa35d88199 Mon Sep 17 00:00:00 2001 From: Henry Date: Sat, 1 Feb 2014 22:05:44 +0000 Subject: [PATCH] yPlusLES: Corrected conversion of dynamic to kinematic viscosity --- .../utilities/yPlusLES/yPlusLES.C | 34 +++++++++---------- .../utilities/yPlusRAS/yPlusRAS.C | 24 ++++++------- 2 files changed, 28 insertions(+), 30 deletions(-) diff --git a/src/postProcessing/functionObjects/utilities/yPlusLES/yPlusLES.C b/src/postProcessing/functionObjects/utilities/yPlusLES/yPlusLES.C index b84942fffb..a372da08d5 100644 --- a/src/postProcessing/functionObjects/utilities/yPlusLES/yPlusLES.C +++ b/src/postProcessing/functionObjects/utilities/yPlusLES/yPlusLES.C @@ -31,7 +31,6 @@ License #include "wallFvPatch.H" #include "nearWallDist.H" - // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam @@ -72,23 +71,23 @@ void Foam::yPlusLES::calcIncompressibleYPlus const volScalarField nuLam(model.nu()); bool foundPatch = false; - forAll(patches, patchI) + forAll(patches, patchi) { - const fvPatch& currPatch = patches[patchI]; + const fvPatch& currPatch = patches[patchi]; if (isA(currPatch)) { foundPatch = true; - yPlus.boundaryField()[patchI] = - d[patchI] + yPlus.boundaryField()[patchi] = + d[patchi] *sqrt ( - nuEff.boundaryField()[patchI] - *mag(U.boundaryField()[patchI].snGrad()) + nuEff.boundaryField()[patchi] + *mag(U.boundaryField()[patchi].snGrad()) ) - /nuLam.boundaryField()[patchI]; + /nuLam.boundaryField()[patchi]; - const scalarField& Yp = yPlus.boundaryField()[patchI]; + const scalarField& Yp = yPlus.boundaryField()[patchi]; scalar minYp = gMin(Yp); scalar maxYp = gMax(Yp); @@ -129,6 +128,7 @@ void Foam::yPlusLES::calcCompressibleYPlus volScalarField::GeometricBoundaryField d = nearWallDist(mesh).y(); volScalarField muEff(model.muEff()); + const volScalarField& rho(model.rho()); const fvPatchList& patches = mesh.boundary(); @@ -137,23 +137,23 @@ void Foam::yPlusLES::calcCompressibleYPlus Info<< type() << " output:" << nl; bool foundPatch = false; - forAll(patches, patchI) + forAll(patches, patchi) { - const fvPatch& currPatch = patches[patchI]; + const fvPatch& currPatch = patches[patchi]; if (isA(currPatch)) { foundPatch = true; - yPlus.boundaryField()[patchI] = - d[patchI] + yPlus.boundaryField()[patchi] = + d[patchi] *sqrt ( - muEff.boundaryField()[patchI] - *mag(U.boundaryField()[patchI].snGrad()) + (muEff.boundaryField()[patchi]/rho.boundaryField()[patchi]) + *mag(U.boundaryField()[patchi].snGrad()) ) - /muLam.boundaryField()[patchI]; + /(muLam.boundaryField()[patchi]/rho.boundaryField()[patchi]); - const scalarField& Yp = yPlus.boundaryField()[patchI]; + const scalarField& Yp = yPlus.boundaryField()[patchi]; scalar minYp = gMin(Yp); scalar maxYp = gMax(Yp); diff --git a/src/postProcessing/functionObjects/utilities/yPlusRAS/yPlusRAS.C b/src/postProcessing/functionObjects/utilities/yPlusRAS/yPlusRAS.C index c93875b3e5..f093306bb7 100644 --- a/src/postProcessing/functionObjects/utilities/yPlusRAS/yPlusRAS.C +++ b/src/postProcessing/functionObjects/utilities/yPlusRAS/yPlusRAS.C @@ -28,17 +28,15 @@ License #include "incompressible/RAS/RASModel/RASModel.H" #include "nutWallFunction/nutWallFunctionFvPatchScalarField.H" - #include "compressible/RAS/RASModel/RASModel.H" #include "mutWallFunction/mutWallFunctionFvPatchScalarField.H" - #include "wallDist.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { -defineTypeNameAndDebug(yPlusRAS, 0); + defineTypeNameAndDebug(yPlusRAS, 0); } @@ -73,17 +71,17 @@ void Foam::yPlusRAS::calcIncompressibleYPlus nut.boundaryField(); bool foundPatch = false; - forAll(nutPatches, patchI) + forAll(nutPatches, patchi) { - if (isA(nutPatches[patchI])) + if (isA(nutPatches[patchi])) { foundPatch = true; const wallFunctionPatchField& nutPw = - dynamic_cast(nutPatches[patchI]); + dynamic_cast(nutPatches[patchi]); - yPlus.boundaryField()[patchI] = nutPw.yPlus(); - const scalarField& Yp = yPlus.boundaryField()[patchI]; + yPlus.boundaryField()[patchi] = nutPw.yPlus(); + const scalarField& Yp = yPlus.boundaryField()[patchi]; scalar minYp = gMin(Yp); scalar maxYp = gMax(Yp); @@ -130,17 +128,17 @@ void Foam::yPlusRAS::calcCompressibleYPlus mut.boundaryField(); bool foundPatch = false; - forAll(mutPatches, patchI) + forAll(mutPatches, patchi) { - if (isA(mutPatches[patchI])) + if (isA(mutPatches[patchi])) { foundPatch = true; const wallFunctionPatchField& mutPw = - dynamic_cast(mutPatches[patchI]); + dynamic_cast(mutPatches[patchi]); - yPlus.boundaryField()[patchI] = mutPw.yPlus(); - const scalarField& Yp = yPlus.boundaryField()[patchI]; + yPlus.boundaryField()[patchi] = mutPw.yPlus(); + const scalarField& Yp = yPlus.boundaryField()[patchi]; scalar minYp = gMin(Yp); scalar maxYp = gMax(Yp);