Merge branch 'master' of ssh://git.code.sf.net/p/foam-extend/foam-extend-3.2
[foam-extend-3.2.git] / src / turbulenceModels / incompressible / RAS / LienCubicKELowRe / LienCubicKELowReSetWallDissipation.H
blobf067f8d0de3235dac99fb6c8f100f2aaf3826605
1 // Set the dissipation in the near-wall cell to the value prescribed by the
2 // Lien-Leschziner low-Re model with Wolfstein length-scale prescription
5     labelList cellBoundaryFaceCount(epsilon_.size(), 0);
7     //- use constant Cmu for epsilon in the near-wall cell
8     scalar Cmu75 = pow(CmuWall_.value(), 0.75);
10     const fvPatchList& patches = mesh_.boundary();
12     //- Initialise the near-wall epsilon field to zero
13     forAll(patches, patchi)
14     {
15         const fvPatch& curPatch = patches[patchi];
17         if (curPatch.isWall())
18         {
19             forAll(curPatch, facei)
20             {
21                 label faceCelli = curPatch.faceCells()[facei];
23                 epsilon_[faceCelli] = 0.0;
24             }
25         }
26     }
28     forAll(patches, patchi)
29     {
30         const fvPatch& curPatch = patches[patchi];
32         if (curPatch.isWall())
33         {
34             forAll(curPatch, facei)
35             {
36                 label faceCelli = curPatch.faceCells()[facei];
38                 // For corner cells (with two boundary or more faces),
39                 // epsilon in the near-wall cell are calculated as an average
41                 cellBoundaryFaceCount[faceCelli]++;
43                 epsilon_[faceCelli] +=
44                      Cmu75*pow(k_[faceCelli], 1.5)
45                     /(
46                          kappa_.value()*y_[faceCelli]
47                         *(1.0 - exp(-Aepsilon_.value()*yStar_[faceCelli]))
48                      )
49                     *exp(-Amu_.value()*sqr(yStar_[faceCelli]));
51             }
52         }
53     }
55     // perform the averaging
57     forAll(patches, patchi)
58     {
59         const fvPatch& curPatch = patches[patchi];
61         if (curPatch.isWall())
62         {
63             forAll(curPatch, facei)
64             {
65                 label faceCelli = curPatch.faceCells()[facei];
67                 epsilon_[faceCelli] /= cellBoundaryFaceCount[faceCelli];
68             }
69         }
70     }