initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / turbulenceModels / incompressible / RAS / LienLeschzinerLowRe / LienLeschzinerLowReSetWallDissipation.H
blob1c3f7f8a41d89d42daca218d6e18888497cc486d
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(Cmu_.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 (isType<wallFvPatch>(curPatch))
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 (isType<wallFvPatch>(curPatch))
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 (isType<wallFvPatch>(curPatch))
62         {
63             forAll(curPatch, facei)
64             {
65                 label faceCelli = curPatch.faceCells()[facei];
67                 epsilon_[faceCelli] /= cellBoundaryFaceCount[faceCelli];
68             }
69         }
70     }