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  scalar nub_ = nub.value();
6 
7  const fvPatchList& patches = mesh.boundary();
8 
9  forAll(patches, patchi)
10  {
11  const fvPatch& currPatch = patches[patchi];
12 
13  if (isA<wallFvPatch>(currPatch))
14  {
15  scalarField& nutw = nutb.boundaryField()[patchi];
16 
17  forAll(currPatch, facei)
18  {
19  label faceCelli = currPatch.faceCells()[facei];
20 
21  // calculate yPlus
22  scalar yPlus =
23  Cmu25*y[patchi][facei]
24  *::sqrt(k[faceCelli])
25  /nub_;
26 
27  if (yPlus > 11.6)
28  {
29  nutw[facei] =
30  yPlus*nub_*kappa_
31  /::log(E_*yPlus)
32  - nub_;
33  }
34  else
35  {
36  nutw[facei] = 0.0;
37  }
38  }
39  }
40  }
41 }
42 
43 // ************************ vim: set sw=4 sts=4 et: ************************ //