nutWallFunction: Added a nutw static function to return the nutWallFunction patchField for a given patch

This commit is contained in:
Henry Weller
2019-06-02 13:10:34 +01:00
parent 1e2550b6cd
commit aaed26965f
11 changed files with 34 additions and 37 deletions

View File

@ -171,10 +171,7 @@ void alphatJayatillekeWallFunctionFvPatchScalarField::updateCoeffs()
);
const nutWallFunctionFvPatchScalarField& nutw =
refCast<const nutWallFunctionFvPatchScalarField>
(
turbModel.nut()().boundaryField()[patchi]
);
nutWallFunctionFvPatchScalarField::nutw(turbModel, patchi);
const scalar Cmu25 = pow025(nutw.Cmu());

View File

@ -170,10 +170,7 @@ void alphatJayatillekeWallFunctionFvPatchScalarField::updateCoeffs()
);
const nutWallFunctionFvPatchScalarField& nutw =
refCast<const nutWallFunctionFvPatchScalarField>
(
turbModel.nut()().boundaryField()[patchi]
);
nutWallFunctionFvPatchScalarField::nutw(turbModel, patchi);
const scalar Cmu25 = pow(nutw.Cmu(), 0.25);
const scalarField& y = turbModel.y()[patchi];

View File

@ -184,10 +184,7 @@ void Foam::epsilonWallFunctionFvPatchScalarField::calculate
const label patchi = patch.index();
const nutWallFunctionFvPatchScalarField& nutw =
refCast<const nutWallFunctionFvPatchScalarField>
(
turbModel.nut()().boundaryField()[patchi]
);
nutWallFunctionFvPatchScalarField::nutw(turbModel, patchi);
const scalarField& y = turbModel.y()[patchi];

View File

@ -112,10 +112,7 @@ void fWallFunctionFvPatchScalarField::updateCoeffs()
const v2fBase& v2fModel = refCast<const v2fBase>(turbModel);
const nutWallFunctionFvPatchScalarField& nutw =
refCast<const nutWallFunctionFvPatchScalarField>
(
turbModel.nut()().boundaryField()[patchi]
);
nutWallFunctionFvPatchScalarField::nutw(turbModel, patchi);
const scalarField& y = turbModel.y()[patchi];

View File

@ -113,10 +113,7 @@ void kLowReWallFunctionFvPatchScalarField::updateCoeffs()
);
const nutWallFunctionFvPatchScalarField& nutw =
refCast<const nutWallFunctionFvPatchScalarField>
(
turbModel.nut()().boundaryField()[patchi]
);
nutWallFunctionFvPatchScalarField::nutw(turbModel, patchi);
const scalarField& y = turbModel.y()[patchi];

View File

@ -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<const nutWallFunctionFvPatchScalarField>
(
turbModel.nut()().boundaryField()[patchi]
);
}
Foam::scalar Foam::nutWallFunctionFvPatchScalarField::yPlusLam
(
const scalar kappa,

View File

@ -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);

View File

@ -190,10 +190,7 @@ void omegaWallFunctionFvPatchScalarField::calculate
const label patchi = patch.index();
const nutWallFunctionFvPatchScalarField& nutw =
refCast<const nutWallFunctionFvPatchScalarField>
(
turbModel.nut()().boundaryField()[patchi]
);
nutWallFunctionFvPatchScalarField::nutw(turbModel, patchi);
const scalarField& y = turbModel.y()[patchi];

View File

@ -110,10 +110,7 @@ void v2WallFunctionFvPatchScalarField::updateCoeffs()
);
const nutWallFunctionFvPatchScalarField& nutw =
refCast<const nutWallFunctionFvPatchScalarField>
(
turbModel.nut()().boundaryField()[patchi]
);
nutWallFunctionFvPatchScalarField::nutw(turbModel, patchi);
const scalarField& y = turbModel.y()[patchi];