From 0726060d77013ee70eeb749c0e318a0815cc9897 Mon Sep 17 00:00:00 2001 From: Vuko Vukcevic Date: Tue, 19 Jun 2018 15:03:20 +0200 Subject: [PATCH] Refactored mutLowReWallFunction according to the new interface --- .../compressible/RAS/Make/files | 1 + .../mutLowReWallFunctionFvPatchScalarField.C | 19 ++++++++++++++++ .../mutLowReWallFunctionFvPatchScalarField.H | 22 +++++++++++++++++-- 3 files changed, 40 insertions(+), 2 deletions(-) diff --git a/src/turbulenceModels/compressible/RAS/Make/files b/src/turbulenceModels/compressible/RAS/Make/files index 16804f7a6..247015969 100644 --- a/src/turbulenceModels/compressible/RAS/Make/files +++ b/src/turbulenceModels/compressible/RAS/Make/files @@ -18,6 +18,7 @@ $(alphatWallFunctions)/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C mutWallFunctions = $(wallFunctions)/mutWallFunctions $(mutWallFunctions)/mutWallFunction/mutWallFunctionFvPatchScalarField.C +$(mutWallFunctions)/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.C epsilonWallFunctions = $(wallFunctions)/epsilonWallFunctions $(epsilonWallFunctions)/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.C index d168dc8ca..2f8ed30f5 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.C @@ -100,6 +100,25 @@ mutLowReWallFunctionFvPatchScalarField::mutLowReWallFunctionFvPatchScalarField {} +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp mutLowReWallFunctionFvPatchScalarField::yPlus() const +{ + const label patchI = patch().index(); + const turbulenceModel& turbModel = + db().lookupObject("turbulenceModel"); + + const scalarField& y = turbModel.y()[patchI]; + const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchI]; + const scalarField& muw = turbModel.mu().boundaryField()[patchI]; + const scalarField& rhow = turbModel.rho().boundaryField()[patchI]; + + const scalarField nuw = muw/rhow; + + return y*sqrt(nuw*mag(Uw.snGrad()))/nuw; +} + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // makePatchTypeField diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.H index 3172b8d8a..7b8bfebf9 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.H @@ -28,7 +28,19 @@ Description Boundary condition for turbulent (kinematic) viscosity when for use with low Reynolds number models. - Sets mut to zero, and provides an access to calculate y+. + Sets mut to zero, and provides an access function to calculate y+. + +Usage + Example of the boundary condition specification: + \verbatim + + { + type mutLowReWallFunction; + } + \endverbatim + +See also + Foam::nutWallFunctionFvPatchScalarField SourceFiles mutLowReWallFunctionFvPatchScalarField.C @@ -59,7 +71,7 @@ class mutLowReWallFunctionFvPatchScalarField { protected: - // Private member functions + // Protected Member Functions //- Calculate the turbulence viscosity virtual tmp calcMut() const; @@ -132,6 +144,12 @@ public: new mutLowReWallFunctionFvPatchScalarField(*this, iF) ); } + + + // Member functions + + //- Calculate and return the yPlus at the boundary + virtual tmp yPlus() const; };