MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / calcYPlus

Function calcYPlus

src/functionObjects/field/yPlus/yPlus.C:65–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63
64
65void Foam::functionObjects::yPlus::calcYPlus
66(
67 const turbulenceModel& turbModel,
68 volScalarField& yPlus
69)
70{
71 volScalarField::Boundary d = nearWallDist(mesh_).y();
72
73 const volScalarField::Boundary nutBf =
74 turbModel.nut()().boundaryField();
75
76 const volScalarField::Boundary nuEffBf =
77 turbModel.nuEff()().boundaryField();
78
79 const volScalarField::Boundary nuBf =
80 turbModel.nu()().boundaryField();
81
82 const fvPatchList& patches = mesh_.boundary();
83
84 volScalarField::Boundary& yPlusBf = yPlus.boundaryFieldRef();
85
86 forAll(patches, patchi)
87 {
88 const fvPatch& patch = patches[patchi];
89
90 if (isA<nutWallFunctionFvPatchScalarField>(nutBf[patchi]))
91 {
92 const nutWallFunctionFvPatchScalarField& nutPf =
93 dynamic_cast<const nutWallFunctionFvPatchScalarField&>
94 (
95 nutBf[patchi]
96 );
97
98 yPlusBf[patchi] = nutPf.yPlus();
99 }
100 else if (isA<wallFvPatch>(patch))
101 {
102 yPlusBf[patchi] =
103 d[patchi]
104 *sqrt
105 (
106 nuEffBf[patchi]
107 *mag(turbModel.U().boundaryField()[patchi].snGrad())
108 )/nuBf[patchi];
109 }
110 }
111}
112
113
114// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

Calls 10

nearWallDistClass · 0.85
sqrtFunction · 0.85
forAllFunction · 0.50
magClass · 0.50
yMethod · 0.45
boundaryFieldMethod · 0.45
nutMethod · 0.45
nuEffMethod · 0.45
nuMethod · 0.45
snGradMethod · 0.45

Tested by

no test coverage detected