diff --git a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatPhaseChangeJayatillekeWallFunction/alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.C b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatPhaseChangeJayatillekeWallFunction/alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.C index 024f8c862e..29688fe966 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatPhaseChangeJayatillekeWallFunction/alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.C +++ b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatPhaseChangeJayatillekeWallFunction/alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.C @@ -126,10 +126,7 @@ alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::calcAlphat ); const nutWallFunctionFvPatchScalarField& nutw = - refCast - ( - turbModel.nut()().boundaryField()[patchi] - ); + nutWallFunctionFvPatchScalarField::nutw(turbModel, patchi); const scalar Cmu25 = pow025(nutw.Cmu()); diff --git a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C index 775374f52e..819ee37588 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C +++ b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C @@ -424,10 +424,7 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs() ); const nutWallFunctionFvPatchScalarField& nutw = - refCast - ( - turbModel.nut()().boundaryField()[patchi] - ); + nutWallFunctionFvPatchScalarField::nutw(turbModel, patchi); const scalar Cmu25(pow025(nutw.Cmu())); diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C index 06bd9bb6f7..87295d0c2e 100644 --- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C @@ -171,10 +171,7 @@ void alphatJayatillekeWallFunctionFvPatchScalarField::updateCoeffs() ); const nutWallFunctionFvPatchScalarField& nutw = - refCast - ( - turbModel.nut()().boundaryField()[patchi] - ); + nutWallFunctionFvPatchScalarField::nutw(turbModel, patchi); const scalar Cmu25 = pow025(nutw.Cmu()); diff --git a/src/TurbulenceModels/incompressible/turbulentTransportModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/incompressible/turbulentTransportModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C index 44e36e22da..f74a6333e6 100644 --- a/src/TurbulenceModels/incompressible/turbulentTransportModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/incompressible/turbulentTransportModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C @@ -170,10 +170,7 @@ void alphatJayatillekeWallFunctionFvPatchScalarField::updateCoeffs() ); const nutWallFunctionFvPatchScalarField& nutw = - refCast - ( - turbModel.nut()().boundaryField()[patchi] - ); + nutWallFunctionFvPatchScalarField::nutw(turbModel, patchi); const scalar Cmu25 = pow(nutw.Cmu(), 0.25); const scalarField& y = turbModel.y()[patchi]; diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C index 0053ad556c..fe680779fa 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C @@ -184,10 +184,7 @@ void Foam::epsilonWallFunctionFvPatchScalarField::calculate const label patchi = patch.index(); const nutWallFunctionFvPatchScalarField& nutw = - refCast - ( - turbModel.nut()().boundaryField()[patchi] - ); + nutWallFunctionFvPatchScalarField::nutw(turbModel, patchi); const scalarField& y = turbModel.y()[patchi]; diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C index 5e5ad84af3..2ef17fb222 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C @@ -112,10 +112,7 @@ void fWallFunctionFvPatchScalarField::updateCoeffs() const v2fBase& v2fModel = refCast(turbModel); const nutWallFunctionFvPatchScalarField& nutw = - refCast - ( - turbModel.nut()().boundaryField()[patchi] - ); + nutWallFunctionFvPatchScalarField::nutw(turbModel, patchi); const scalarField& y = turbModel.y()[patchi]; diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C index b0f209f257..240528ab33 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C @@ -113,10 +113,7 @@ void kLowReWallFunctionFvPatchScalarField::updateCoeffs() ); const nutWallFunctionFvPatchScalarField& nutw = - refCast - ( - turbModel.nut()().boundaryField()[patchi] - ); + nutWallFunctionFvPatchScalarField::nutw(turbModel, patchi); const scalarField& y = turbModel.y()[patchi]; diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C index 260f403097..a183df443d 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C @@ -24,8 +24,8 @@ License \*---------------------------------------------------------------------------*/ #include "nutWallFunctionFvPatchScalarField.H" +#include "turbulenceModel.H" #include "fvPatchFieldMapper.H" -#include "volFields.H" #include "wallFvPatch.H" #include "addToRunTimeSelectionTable.H" @@ -149,6 +149,21 @@ Foam::nutWallFunctionFvPatchScalarField::nutWallFunctionFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +const Foam::nutWallFunctionFvPatchScalarField& +Foam::nutWallFunctionFvPatchScalarField::nutw +( + const turbulenceModel& turbModel, + const label patchi +) +{ + return + refCast + ( + turbModel.nut()().boundaryField()[patchi] + ); +} + + Foam::scalar Foam::nutWallFunctionFvPatchScalarField::yPlusLam ( const scalar kappa, diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.H b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.H index 1cd3dde7df..a068785d85 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.H +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.H @@ -71,6 +71,8 @@ SourceFiles namespace Foam { +class turbulenceModel; + /*---------------------------------------------------------------------------*\ Class nutWallFunctionFvPatchScalarField Declaration \*---------------------------------------------------------------------------*/ @@ -176,6 +178,13 @@ public: return E_; } + //- Return the nut patchField for the given wall patch + static const nutWallFunctionFvPatchScalarField& nutw + ( + const turbulenceModel& turbModel, + const label patchi + ); + //- Calculate the Y+ at the edge of the laminar sublayer static scalar yPlusLam(const scalar kappa, const scalar E); diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C index 36e13ba71f..0910d00e32 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C @@ -190,10 +190,7 @@ void omegaWallFunctionFvPatchScalarField::calculate const label patchi = patch.index(); const nutWallFunctionFvPatchScalarField& nutw = - refCast - ( - turbModel.nut()().boundaryField()[patchi] - ); + nutWallFunctionFvPatchScalarField::nutw(turbModel, patchi); const scalarField& y = turbModel.y()[patchi]; diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C index 8cf2de5a23..67f39c7dd3 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C @@ -110,10 +110,7 @@ void v2WallFunctionFvPatchScalarField::updateCoeffs() ); const nutWallFunctionFvPatchScalarField& nutw = - refCast - ( - turbModel.nut()().boundaryField()[patchi] - ); + nutWallFunctionFvPatchScalarField::nutw(turbModel, patchi); const scalarField& y = turbModel.y()[patchi];