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