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 Foam_extrudePatchMesh_H
74 #define Foam_extrudePatchMesh_H
75 
76 #include "extrudeModel.H"
77 #include "autoPtr.H"
78 #include "fvMesh.H"
79 #include "Time.H"
80 
81 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
82 
83 namespace Foam
84 {
85 
86 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
87 
88 
89 /*---------------------------------------------------------------------------*\
90  Class extrudePatchMesh Declaration
91 \*---------------------------------------------------------------------------*/
92 
93 class extrudePatchMesh
94 :
95  public fvMesh
96 {
97  // Private Data
98 
99  //- Enumeration of patch IDs. Must be 0,1,2,...
100  enum patchID
101  {
102  bottomPatchID = 0,
103  topPatchID = 1,
104  sidePatchID = 2
105  };
106 
107  //- Const reference to the patch from which this mesh is extruded
108  const polyPatch& extrudedPatch_;
109 
110  //- Model dictionary
111  dictionary dict_;
112 
113 
114  // Private Member Functions
115 
116  //- Extrude mesh using polyPatches
117  void extrudeMesh(polyPatchList& regionPatches);
118 
119  //- Construct from mesh, patch and dictionary without patches.
120  // Only used internally
122  (
123  const word& regionName,
124  const fvMesh& mesh,
125  const fvPatch& p,
126  const dictionary& dict
127  );
128 
129 public:
130 
131  //- Runtime type information
132  TypeName("extrudePatchMesh");
133 
134 
135  // Constructors
136 
137  //- Construct from mesh, patch and dictionary
139  (
140  const fvMesh& mesh,
141  const fvPatch& p,
142  const dictionary& dict,
143  const word& regionName
144  );
145 
146  //- Construct from mesh, patch, dictionary and new mesh
147  //- polyPatch information
149  (
150  const fvMesh& mesh,
151  const fvPatch& p,
152  const dictionary& dict,
153  const word& regionName,
154  polyPatchList& regionPatches
155  );
156 
157  //- Construct from mesh, patch, dictionary and new mesh
158  //- polyPatch information
160  (
161  const fvMesh& mesh,
162  const fvPatch& p,
163  const dictionary& dict,
164  const word& regionName,
165  const List<polyPatch*>& regionPatches
166  );
167 
168 
169  //- Destructor
170  virtual ~extrudePatchMesh() = default;
171 
172 
173  // Member Functions
174 
175  // Access functions
176 
177  //- Return region mesh
178  const fvMesh& regionMesh() const
179  {
180  return *this;
181  }
182 
183  //- Return bottom patch
184  const polyPatch& bottomPatch() const
185  {
186  return this->boundaryMesh()[bottomPatchID];
187  }
188 
189  //- Return top patch
190  const polyPatch& topPatch() const
191  {
192  return this->boundaryMesh()[topPatchID];
193  }
195  //- Return sides patch
196  const polyPatch& sidesPatch() const
197  {
198  return this->boundaryMesh()[sidePatchID];
199  }
200 
201  //- Return extruded patch
202  const polyPatch& extrudedPatch() const
203  {
204  return extrudedPatch_;
205  }
206 };
207 
208 
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211 } // End namespace Foam
212 
213 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214 
215 #endif
216 
217 // ************************************************************************* //
const polyPatch & bottomPatch() const
Return bottom patch.
dictionary dict
const polyPatch & topPatch() const
Return top patch.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
const polyPatch & extrudedPatch() const
Return extruded patch.
const word & regionName() const
The mesh region name or word::null if polyMesh::defaultRegion.
Definition: polyMesh.C:847
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: BitOps.H:56
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
const polyPatch & sidesPatch() const
Return sides patch.
Mesh at a patch created on the fly. The following entry should be used on the field boundary dictiona...
TypeName("extrudePatchMesh")
Runtime type information.
dynamicFvMesh & mesh
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
Definition: polyMesh.H:608
A class for handling words, derived from Foam::string.
Definition: word.H:63
virtual ~extrudePatchMesh()=default
Destructor.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
Definition: List.H:55
const fvMesh & regionMesh() const
Return region mesh.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
volScalarField & p
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:69
Namespace for OpenFOAM.