FreeFOAM The Cross-Platform CFD Toolkit
boundaryTreatment.H
Go to the documentation of this file.
1 if (isA<wallPolyPatch>(pbMesh[patch(face())]))
2 {
3  keepParcel = sDB.wall().wallTreatment(*this, face());
4 
5  if (sDB.twoD())
6  {
7  scalar vs = U() & sDB.axisOfSymmetry();
8  vector Us = U() - (vs * sDB.axisOfSymmetry());
9  scalar magUs = mag(Us);
10  scalar v1 = Us & n();
11  scalar magV1 = mag(v1);
12  U() = (magUs/magV1)*v1*n() + vs*sDB.axisOfSymmetry();
13  }
14 }
15 else if (isA<wedgePolyPatch>(pbMesh[patch(face())]))
16 {
17  // check if parcel is trying to move out of the domain
18  label patchi = patch(face());
19  label patchFacei = patchFace(patchi, face());
20  const polyPatch& patch = mesh.boundaryMesh()[patchi];
21  vector nf = patch.faceAreas()[patchFacei];
22 
23  scalar Un = U() & nf;
24  if (Un > 0)
25  {
26  scalar Un2 = U() & n();
27  U() -= 2.0*Un2*n();
28  }
29 }
30 else if (isA<symmetryPolyPatch>(pbMesh[patch(face())]))
31 {
32  // check if parcel is trying to move out of the domain
33  label patchi = patch(face());
34  label patchFacei = patchFace(patchi, face());
35  const polyPatch& patch = mesh.boundaryMesh()[patchi];
36  vector nf = patch.faceAreas()[patchFacei];
37 
38  scalar Un = U() & nf;
39  if (Un > 0)
40  {
41  if (sDB.twoD())
42  {
43  U() -= 2.0*(U() & n())*n();
44  }
45  else
46  {
47  nf /= mag(nf);
48  U() -= 2.0*(U() & nf)*nf;
49  }
50  }
51 }
52 else if (isType<polyPatch>(pbMesh[patch(face())]))
53 {
54  // Parcel has hit an inlet or outlet or some such so throw it away
55  keepParcel = false;
56 }
57 
58 // ************************ vim: set sw=4 sts=4 et: ************************ //