extrudePatchMesh.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::extrudePatchMesh
29 
30 Description
31  Mesh at a patch created on the fly. The following entry should be used
32  on the field boundary dictionary:
33 
34  Example:
35  \verbatim
36  // New Shell mesh data
37 
38  extrudeModel linearNormal;
39  linearNormalCoeffs
40  {
41  thickness 40e-6;
42  }
43  nLayers 50;
44  expansionRatio 1;
45  columnCells true;
46 
47  // Patch information
48  bottomCoeffs
49  {
50  name "bottom";
51  type mappedWall;
52  sampleMode nearestPatchFace;
53  samplePatch fixedWalls;
54  offsetMode uniform;
55  offset (0 0 0);
56  }
57 
58  topCoeffs
59  {
60  name "top";
61  type patch;
62  }
63 
64  sideCoeffs
65  {
66  name "side";
67  type empty;
68  }
69  \endverbatim
70 
71 \*---------------------------------------------------------------------------*/
72 
73 #ifndef extrudePatchMesh_H
74 #define extrudePatchMesh_H
75 
76 #include "extrudeModel.H"
77 #include "autoPtr.H"
78 
79 #include "fvMesh.H"
80 #include "Time.H"
81 
82 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
83 
84 namespace Foam
85 {
86 
87 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
88 
89 
90 /*---------------------------------------------------------------------------*\
91  Class extrudePatchMesh Declaration
92 \*---------------------------------------------------------------------------*/
93 
94 class extrudePatchMesh
95 :
96  public fvMesh
97 {
98  // Private Data
99 
100  //- Enumeration of patch IDs
101  enum patchID
102  {
103  bottomPatchID,
104  topPatchID,
105  sidePatchID
106  };
107 
108  //- Const reference to the patch from which this mesh is extruded
109  const polyPatch& extrudedPatch_;
110 
111  //- Model dictionary
112  dictionary dict_;
113 
114 
115  // Private Member Functions
116 
117  //- Extrude mesh using polyPatches
118  void extrudeMesh(const List<polyPatch*>& regionPatches);
119 
120  //- Construct from mesh, patch and dictionary without patches.
121  // Only used internally
123  (
124  const word& regionName,
125  const fvMesh& mesh,
126  const fvPatch& p,
127  const dictionary& dict
128  );
129 
130 public:
131 
132  //- Runtime type information
133  TypeName("extrudePatchMesh");
134 
135 
136  // Constructors
137 
138  //- Construct from mesh, patch and dictionary
140  (
141  const fvMesh& mesh,
142  const fvPatch& p,
143  const dictionary& dict,
144  const word& regionName
145  );
146 
147  //- Construct from mesh, patch, dictionary and new mesh
148  // polyPatch information
150  (
151  const fvMesh& mesh,
152  const fvPatch& p,
153  const dictionary& dict,
154  const word& regionName,
155  const List<polyPatch*>& polyPatches
156  );
157 
158 
159  //- Destructor
160  virtual ~extrudePatchMesh() = default;
161 
162 
163  // Member Functions
164 
165  // Access functions
166 
167  //- Return region mesh
168  const fvMesh& regionMesh() const
169  {
170  return *this;
171  }
172 
173  //- Return bottom patch
174  const polyPatch& bottomPatch() const
175  {
176  return this->boundaryMesh()[bottomPatchID];
177  }
178 
179  //- Return top patch
180  const polyPatch& topPatch() const
181  {
182  return this->boundaryMesh()[topPatchID];
183  }
184 
185  //- Return sides patch
186  const polyPatch& sidesPatch() const
187  {
188  return this->boundaryMesh()[sidePatchID];
189  }
190 
191  //- Return extruded patch
192  const polyPatch& extrudedPatch() const
193  {
194  return extrudedPatch_;
195  }
196 };
197 
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 
201 } // End namespace Foam
202 
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 
205 #endif
206 
207 // ************************************************************************* //
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::extrudePatchMesh::extrudedPatch
const polyPatch & extrudedPatch() const
Return extruded patch.
Definition: extrudePatchMesh.H:191
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::polyMesh::boundaryMesh
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Definition: polyMesh.H:444
Foam::extrudePatchMesh::topPatch
const polyPatch & topPatch() const
Return top patch.
Definition: extrudePatchMesh.H:179
Foam::extrudePatchMesh::regionMesh
const fvMesh & regionMesh() const
Return region mesh.
Definition: extrudePatchMesh.H:167
regionName
Foam::word regionName
Definition: createNamedDynamicFvMesh.H:1
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:68
extrudeModel.H
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::extrudePatchMesh::~extrudePatchMesh
virtual ~extrudePatchMesh()=default
Destructor.
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
fvMesh.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Time.H
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: BitOps.H:63
Foam::extrudePatchMesh::sidesPatch
const polyPatch & sidesPatch() const
Return sides patch.
Definition: extrudePatchMesh.H:185
Foam::extrudePatchMesh::TypeName
TypeName("extrudePatchMesh")
Runtime type information.
Foam::extrudePatchMesh
Mesh at a patch created on the fly. The following entry should be used on the field boundary dictiona...
Definition: extrudePatchMesh.H:93
Foam::extrudePatchMesh::bottomPatch
const polyPatch & bottomPatch() const
Return bottom patch.
Definition: extrudePatchMesh.H:173
autoPtr.H