ENH: autoLayerDriver: better layering information message
[OpenFOAM-2.0.x.git] / applications / solvers / multiphase / settlingFoam / wallViscosity.H
blob9516bb0feae318d5b0297b10107748a32d8405cc
2     scalar Cmu25 = ::pow(Cmu.value(), 0.25);
3     scalar kappa_ = kappa.value();
4     scalar E_ = E.value();
6     const fvPatchList& patches = mesh.boundary();
8     forAll(patches, patchi)
9     {
10         const fvPatch& curPatch = patches[patchi];
12         if (isA<wallFvPatch>(curPatch))
13         {
14             const scalarField& rhow = rho.boundaryField()[patchi];
16             const scalarField muw(mul.boundaryField()[patchi]);
17             scalarField& mutw = mut.boundaryField()[patchi];
19             forAll(curPatch, facei)
20             {
21                 label faceCelli = curPatch.faceCells()[facei];
23                 scalar yPlus =
24                     Cmu25*y[patchi][facei]*::sqrt(k[faceCelli])
25                    /(muw[facei]/rhow[facei]);
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     }