FreeFOAM The Cross-Platform CFD Toolkit
LienLeschzinerLowReSetWallDissipation.H
Go to the documentation of this file.
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
3 
4 {
5  labelList cellBoundaryFaceCount(epsilon_.size(), 0);
6 
7  //- use constant Cmu for epsilon in the near-wall cell
8  scalar Cmu75 = pow(Cmu_.value(), 0.75);
9 
10  const fvPatchList& patches = mesh_.boundary();
11 
12  //- Initialise the near-wall epsilon field to zero
13  forAll(patches, patchi)
14  {
15  const fvPatch& curPatch = patches[patchi];
16 
17  if (isA<wallFvPatch>(curPatch))
18  {
19  forAll(curPatch, facei)
20  {
21  label faceCelli = curPatch.faceCells()[facei];
22 
23  epsilon_[faceCelli] = 0.0;
24  }
25  }
26  }
27 
28  forAll(patches, patchi)
29  {
30  const fvPatch& curPatch = patches[patchi];
31 
32  if (isA<wallFvPatch>(curPatch))
33  {
34  forAll(curPatch, facei)
35  {
36  label faceCelli = curPatch.faceCells()[facei];
37 
38  // For corner cells (with two boundary or more faces),
39  // epsilon in the near-wall cell are calculated as an average
40 
41  cellBoundaryFaceCount[faceCelli]++;
42 
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]));
50 
51  }
52  }
53  }
54 
55  // perform the averaging
56 
57  forAll(patches, patchi)
58  {
59  const fvPatch& curPatch = patches[patchi];
60 
61  if (isA<wallFvPatch>(curPatch))
62  {
63  forAll(curPatch, facei)
64  {
65  label faceCelli = curPatch.faceCells()[facei];
66 
67  epsilon_[faceCelli] /= cellBoundaryFaceCount[faceCelli];
68  }
69  }
70  }
71 }
72 
73 // ************************ vim: set sw=4 sts=4 et: ************************ //