interrogateWallPatches.H
Go to the documentation of this file.
1 // Search for wall patches faces and store normals
2 
7 
8 const fvPatchList& patches = mesh.boundary();
9 
11 {
12  const fvPatch& currPatch = patches[patchi];
13 
14  if (isA<wallFvPatch>(currPatch))
15  {
16  const vectorField nf(currPatch.nf());
17 
18  forAll(nf, facei)
19  {
20  nWallFaces++;
21 
22  if (nWallFaces == 1)
23  {
24  wallNormal = -nf[facei];
25  faceId = facei;
26  patchId = patchi;
27  }
28  else if (nWallFaces == 2)
29  {
30  const vector wallNormal2 = -nf[facei];
31 
32  //- Check that wall faces are parallel
33  if
34  (
35  mag(wallNormal & wallNormal2) > 1.01
36  || mag(wallNormal & wallNormal2) < 0.99
37  )
38  {
40  << "wall faces are not parallel for patches "
41  << patches[patchId].name() << " and "
42  << currPatch.name() << nl
43  << exit(FatalError);
44  }
45  }
46  else
47  {
49  << nl << exit(FatalError);
50  }
51  }
52  }
53 }
54 
55 if (nWallFaces == 0)
56 {
58  << exit(FatalError);
59 }
60 else
61 {
62  Info<< "Generating wall data for patch: " << patches[patchId].name()
63  << endl;
64 }
65 
66 // Store local id of near-walll cell to process
67 const label cellId = patches[patchId].faceCells()[faceId];
68 
69 // Create position array for graph generation
71 (
73  & (mesh.C().primitiveField() - mesh.C().boundaryField()[patchId][faceId])
74 );
75 
76 Info<< " Height to first cell centre y0 = " << y[cellId] << endl;
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:334
volScalarField scalarField(fieldObject, mesh)
volVectorField vectorField(fieldObject, mesh)
label patchi
forAll(patches, patchi)
label patchId(-1)
const scalarField y(wallNormal &(mesh.C().primitiveField() - mesh.C().boundaryField()[patchId][faceId]))
const fvPatchList & patches
vector wallNormal(Zero)
label nWallFaces(0)
const label cellId
label faceId(-1)
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
static const zero Zero
Definition: zero.H:97
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:257
messageStream Info
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:49
PtrList< fvPatch > fvPatchList
container classes for fvPatch
Definition: fvPatchList.H:45
dimensioned< scalar > mag(const dimensioned< Type > &)
error FatalError
static const char nl
Definition: Ostream.H:266