surface_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::surface
26 
27 Description
28  A faceZone zoneGenerator which selects faces based on the intersection of
29  a surface with the vector between the adjacent cell centres.
30 
31  The returned faceZone is oriented and provides the corresponding flipMap.
32 
33 Usage
34  \table
35  Property | Description | Required | Default value
36  type | Type: face | yes |
37  name | Name of the zone | no | zoneGenerator name
38  surface | searchableSurface type | yes |
39  tol | cell-cell vector intersection tolerance | no | rootSmall
40  moveUpdate | Switch to update after mesh motion | no | false
41  \endtable
42 
43  To create the faceZone \c baffles containing the faces based on the adjacent
44  cell centres spanning the given triangulated surface:
45  \verbatim
46  baffles
47  {
48  type surface;
49  surface triSurface;
50  file "baffles.obj";
51  }
52  \endverbatim
53 
54  To create the faceZone \c rotatingZone containing the faces based on the
55  adjacent cell centres spanning the given cylinder:
56  \verbatim
57  rotatingZone
58  {
59  type surface;
60  surface cylinder;
61  point1 (0 0 0.54);
62  point2 (0 0 0.66);
63  radius 0.2;
64  }
65  \endverbatim
66 
67 See also
68  searchableSurface
69  zoneGenerators::plane_zoneGenerator
70 
71 SourceFiles
72  surface.C
73 
74 \*---------------------------------------------------------------------------*/
75 
76 #ifndef surface_zoneGenerator_H
77 #define surface_zoneGenerator_H
78 
79 #include "zoneGeneratorList.H"
80 
81 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
82 
83 namespace Foam
84 {
85 
86 class searchableSurface;
87 
88 namespace zoneGenerators
89 {
90 
91 /*---------------------------------------------------------------------------*\
92  Class surface Declaration
93 \*---------------------------------------------------------------------------*/
94 
95 class surface
96 :
97  public zoneGenerator
98 {
99  // Private Data
100 
101  //- Surface
102  autoPtr<searchableSurface> surfacePtr_;
103 
104  //- Tolerance with which to extend the cell-cell vectors
105  const scalar tol_;
106 
107 
108 public:
109 
110  //- Runtime type information
111  TypeName("surface");
112 
113 
114  // Constructors
115 
116  //- Construct from dictionary
117  surface
118  (
119  const word& name,
120  const polyMesh& mesh,
121  const dictionary& dict
122  );
123 
124 
125  //- Destructor
126  virtual ~surface();
127 
128 
129  // Member Functions
130 
131  virtual zoneSet generate() const;
132 };
133 
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 } // End namespace zoneGenerators
138 } // End namespace Foam
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 #endif
143 
144 // ************************************************************************* //
const word & name() const
virtual zoneSet generate() const
Generate and return the zoneSet.
TypeName("surface")
Runtime type information.
surface(const word &name, const polyMesh &mesh, const dictionary &dict)
Construct from dictionary.
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