Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::extrudePatchMesh
29
30Description
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 // Optional feature angle to avoid extruding feature-angles
48 featureAngle 45;
49
50 // Patch information
51 bottomCoeffs
52 {
53 name "bottom";
54 type mappedWall;
55 sampleMode nearestPatchFace;
56 samplePatch fixedWalls;
57 offsetMode uniform;
58 offset (0 0 0);
59 }
60
61 topCoeffs
62 {
63 name "top";
64 type patch;
65 }
66
67 sideCoeffs
68 {
69 name "side";
70 type empty;
71 }
72 \endverbatim
73
74\*---------------------------------------------------------------------------*/
75
76#ifndef Foam_extrudePatchMesh_H
77#define Foam_extrudePatchMesh_H
78
79#include "extrudeModel.H"
80#include "autoPtr.H"
81#include "fvMesh.H"
82#include "Time.H"
83
84// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
85
86namespace Foam
87{
88
89// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
90
91
92/*---------------------------------------------------------------------------*\
93 Class extrudePatchMesh Declaration
94\*---------------------------------------------------------------------------*/
95
96class extrudePatchMesh
97:
98 public fvMesh
99{
100 // Private Data
101
102 //- Enumeration of patch IDs. Must be 0,1,2,...
103 enum patchID
104 {
105 bottomPatchID = 0,
106 topPatchID = 1,
107 sidePatchID = 2
108 };
109
110 //- Const reference to the patch from which this mesh is extruded
111 const polyPatch& extrudedPatch_;
112
113 //- Model dictionary
114 dictionary dict_;
115
116
117 // Private Member Functions
118
119 //- Extrude mesh using polyPatches
120 void extrudeMesh(const polyPatchList& regionPatches);
121
122 //- Construct from mesh, patch and dictionary without patches.
123 // Only used internally
124 extrudePatchMesh
125 (
126 const word& regionName,
127 const fvMesh& mesh,
128 const fvPatch& p,
129 const dictionary& dict
130 );
131
132public:
133
134 //- Runtime type information
135 TypeName("extrudePatchMesh");
136
137
138 // Constructors
139
140 //- Construct from mesh, patch and dictionary
141 extrudePatchMesh
142 (
143 const fvMesh& mesh,
144 const fvPatch& p,
145 const dictionary& dict,
146 const word& regionName
147 );
148
149 //- Construct from mesh, patch, dictionary and new mesh
150 //- polyPatch information
151 extrudePatchMesh
152 (
153 const fvMesh& mesh,
154 const fvPatch& p,
155 const dictionary& dict,
156 const word& regionName,
157 const polyPatchList& regionPatches
158 );
159
160 //- Construct from mesh, patch, dictionary and new mesh
161 //- polyPatch information
162 extrudePatchMesh
163 (
164 const fvMesh& mesh,
165 const fvPatch& p,
166 const dictionary& dict,
167 const word& regionName,
168 const List<polyPatch*>& regionPatches
169 );
170
171
172 //- Destructor
173 virtual ~extrudePatchMesh() = default;
174
175
176 // Member Functions
177
178 // Access functions
179
180 //- Return region mesh
181 const fvMesh& regionMesh() const
182 {
183 return *this;
184 }
185
186 //- Return bottom patch
187 const polyPatch& bottomPatch() const
188 {
189 return this->boundaryMesh()[bottomPatchID];
190 }
191
192 //- Return top patch
193 const polyPatch& topPatch() const
194 {
195 return this->boundaryMesh()[topPatchID];
196 }
198 //- Return sides patch
199 const polyPatch& sidesPatch() const
200 {
201 return this->boundaryMesh()[sidePatchID];
202 }
203
204 //- Return extruded patch
206 {
207 return extrudedPatch_;
208 }
209};
210
211
212// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214} // End namespace Foam
215
216// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
217
218#endif
219
220// ************************************************************************* //
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition List.H:72
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
const fvMesh & regionMesh() const
Return region mesh.
const polyPatch & bottomPatch() const
Return bottom patch.
virtual ~extrudePatchMesh()=default
Destructor.
const polyPatch & extrudedPatch() const
Return extruded patch.
const polyPatch & sidesPatch() const
Return sides patch.
const polyPatch & topPatch() const
Return top patch.
TypeName("extrudePatchMesh")
Runtime type information.
fvMesh(const fvMesh &)=delete
No copy construct.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition fvPatch.H:71
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
Definition polyMesh.H:609
static const word & regionName(const word &region)
The mesh region name or word::null if polyMesh::defaultRegion.
Definition polyMesh.C:796
A patch is a list of labels that address the faces in the global face list.
Definition polyPatch.H:73
A class for handling words, derived from Foam::string.
Definition word.H:66
volScalarField & p
dynamicFvMesh & mesh
Namespace for OpenFOAM.
PtrList< polyPatch > polyPatchList
Store lists of polyPatch as a PtrList.
Definition polyPatch.H:61
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68