face_zoneGenerator.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) 2025 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::zoneGenerators::face
26 
27 Description
28  A zoneGenerator which converts the point, cell and face zones
29  from a list of zoneGenerators into a faceZone
30 
31  If a faceZone with the same name as the faceZone to be generated is
32  returned by a zoneGenerator in the list it is ignored.
33 
34  The returned faceZone is oriented and provides the corresponding flipMap.
35 
36 Usage
37  \table
38  Property | Description | Required | Default value
39  type | Type: face | yes |
40  name | Name of the zone | no | zoneGenerator name
41  cellFaces | Cell face selection option | no | all
42  moveUpdate | Switch to update after mesh motion | no | false
43  \endtable
44 
45  cellFaces face selection controls:
46  \table
47  Option | Description
48  all | Select all faces of the cells in the cellZone
49  inner | Select the faces inside the cellZone
50  outer | Select the faces on the outer surface of the cellZone
51  outerInternal | Select the internal faces on the outer surface \\
52  of the cellZone
53  \endtable
54 
55  To convert cellZone named \c cone1 generated by
56  \verbatim
57  cone1
58  {
59  type truncatedCone;
60  zoneType cell;
61 
62  point1 (-0.0075 0 -1);
63  point2 (-0.003 0.0025 1);
64  radius1 0.001;
65  radius2 0.0005;
66  }
67  \endverbatim
68  into a faceZone also named \c cone1, the following zoneGenerator named \c
69  cone1Faces can be used
70  \verbatim
71  cone1Faces
72  {
73  type face;
74  name cone1;
75 
76  cone1;
77  }
78  \endverbatim
79  To create a faceZone which includes only the internal mesh faces on the
80  outer surface of a pre-generated cellZone named \c leftFluid the \c
81  outerInternal \c cellFaces face selection option can be used:
82  \verbatim
83  cycLeft
84  {
85  type face;
86  cellFaces outerInternal;
87  leftFluid;
88  }
89  \endverbatim
90 
91 SourceFiles
92  face_zoneGenerator.C
93 
94 \*---------------------------------------------------------------------------*/
95 
96 #ifndef face_zoneGenerator_H
97 #define face_zoneGenerator_H
98 
99 #include "zoneGeneratorList.H"
100 
101 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
102 
103 namespace Foam
104 {
105 namespace zoneGenerators
106 {
107 
108 /*---------------------------------------------------------------------------*\
109  Class face Declaration
110 \*---------------------------------------------------------------------------*/
111 
112 class face
113 :
114  public zoneGenerator
115 {
116 public:
117 
118  //- Enumeration defining the valid options
119  enum class cellFaces
120  {
121  all,
122  inner,
123  outer,
125  };
126 
127  //- Names of the valid options
128  static const NamedEnum<cellFaces, 4> cellFacesNames;
129 
130 
131 private:
132 
133  // Private Data
134 
135  //- List of zoneGenerators
136  // which generate the zones to convert to the faceZone
137  zoneGeneratorList zoneGenerators_;
138 
139  //- Cell face selection option
140  cellFaces cellFaces_;
141 
142 
143 public:
144 
145  //- Runtime type information
146  TypeName("face");
147 
148 
149  // Constructors
150 
151  //- Construct from dictionary
152  face
153  (
154  const word& name,
155  const polyMesh& mesh,
156  const dictionary& dict
157  );
158 
159 
160  //- Destructor
161  virtual ~face();
162 
163 
164  // Member Functions
165 
166  virtual zoneSet generate() const;
167 };
168 
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 } // End namespace zoneGenerators
173 } // End namespace Foam
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 #endif
178 
179 // ************************************************************************* //
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
A class for handling words, derived from string.
Definition: word.H:62
friend class zoneGeneratorList
Definition: zoneGenerator.H:80
const word & name() const
face(const word &name, const polyMesh &mesh, const dictionary &dict)
Construct from dictionary.
virtual zoneSet generate() const
Generate and return the zoneSet.
cellFaces
Enumeration defining the valid options.
TypeName("face")
Runtime type information.
virtual ~face()
Destructor.
static const NamedEnum< cellFaces, 4 > cellFacesNames
Names of the valid options.
Zone container returned by zoneGenerator::generate.
Definition: zoneSet.H:94
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
Namespace for OpenFOAM.
dictionary dict