plane_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::plane
26 
27 Description
28  A zoneGenerator which selects faces based on the adjacent cell centres
29  spanning a given plane. The plane is defined by a point and normal vector.
30 
31  Additionally, an include entry can be specified. When omitted or set to
32  "all", then all faces that meet the criteria are included in the set. When
33  set to "closest", just the faces that belong to the closest contiguous
34  region to the plane point are included. This latter setting is useful when
35  defining face zones through channels on which the flow rate is to be
36  computed, as it keeps the set local to a single channel.
37 
38  The returned faceZone is oriented and provides the corresponding flipMap.
39 
40 Usage
41  \table
42  Property | Description | Required | Default value
43  type | Type: face | yes |
44  name | Name of the zone | no | zoneGenerator name
45  point | Point on plane | yes |
46  normal | Normal to plane | yes |
47  include | Include option: all or closest | yes |
48  moveUpdate | Switch to update after mesh motion | no | false
49  \endtable
50 
51  To create the faceZone \c mid containing the faces based on the adjacent
52  cell centres spanning a given plane:
53  \verbatim
54  mid
55  {
56  type plane;
57  point (0.41 0 0);
58  normal (1 0 0);
59  }
60  \endverbatim
61 
62 SourceFiles
63  plane_zoneGenerator.C
64 
65 \*---------------------------------------------------------------------------*/
66 
67 #ifndef plane_zoneGenerator_H
68 #define plane_zoneGenerator_H
69 
70 #include "zoneGeneratorList.H"
71 
72 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
73 
74 namespace Foam
75 {
76 namespace zoneGenerators
77 {
78 
79 /*---------------------------------------------------------------------------*\
80  Class plane Declaration
81 \*---------------------------------------------------------------------------*/
82 
83 class plane
84 :
85  public zoneGenerator
86 {
87 public:
88 
89  // Public Enumerations
90 
91  //- Enumeration for what to include
92  enum class include
93  {
94  all,
95  closest
96  };
97 
98  //- Include option names
99  static const NamedEnum<include, 2> includeNames;
100 
101 
102 private:
103 
104  // Private Data
105 
106  //- Point on the plane
107  const vector point_;
108 
109  //- Normal to the plane
110  const vector normal_;
111 
112  //- Include option
113  const include include_;
114 
115 
116 public:
117 
118  //- Runtime type information
119  TypeName("plane");
120 
121 
122  // Constructors
123 
124  //- Construct from dictionary
125  plane
126  (
127  const word& name,
128  const polyMesh& mesh,
129  const dictionary& dict
130  );
131 
132 
133  //- Destructor
134  virtual ~plane();
135 
136 
137  // Member Functions
138 
139  virtual zoneSet generate() const;
140 };
141 
142 
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 
145 } // End namespace zoneGenerators
146 } // End namespace Foam
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 #endif
151 
152 // ************************************************************************* //
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
const word & name() const
virtual zoneSet generate() const
Generate and return the zoneSet.
static const NamedEnum< include, 2 > includeNames
Include option names.
include
Enumeration for what to include.
plane(const word &name, const polyMesh &mesh, const dictionary &dict)
Construct from dictionary.
TypeName("plane")
Runtime type information.
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.
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:49
dictionary dict