FreeFOAM The Cross-Platform CFD Toolkit
wallViscosity.H
Go to the documentation of this file.
1 {
2  scalar Cmu25 = ::pow(Cmu.value(), 0.25);
3  scalar kappa_ = kappa.value();
4  scalar E_ = E.value();
5 
6  const fvPatchList& patches = mesh.boundary();
7 
8  forAll(patches, patchi)
9  {
10  const fvPatch& curPatch = patches[patchi];
11 
12  if (isA<wallFvPatch>(curPatch))
13  {
14  const scalarField& rhow = rho.boundaryField()[patchi];
15 
16  const scalarField muw = mul.boundaryField()[patchi];
17  scalarField& mutw = mut.boundaryField()[patchi];
18 
19  forAll(curPatch, facei)
20  {
21  label faceCelli = curPatch.faceCells()[facei];
22 
23  scalar yPlus =
24  Cmu25*y[patchi][facei]*::sqrt(k[faceCelli])
25  /(muw[facei]/rhow[facei]);
26 
27  if (yPlus > 11.6)
28  {
29  mutw[facei] =
30  muw[facei]
31  *(yPlus*kappa_/::log(E_*yPlus) - 1);
32  }
33  else
34  {
35  mutw[facei] = 0.0;
36  }
37  }
38  }
39  }
40 }
41 
42 // ************************ vim: set sw=4 sts=4 et: ************************ //