planeToFaceZone.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) 2020-2024 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::planeToFaceZone
26 
27 Description
28  A topoSetSource to select faces based on the adjacent cell centres spanning
29  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 SourceFiles
39  planeToFaceZone.C
40 
41 \*---------------------------------------------------------------------------*/
42 
43 #ifndef planeToFaceZone_H
44 #define planeToFaceZone_H
45 
46 #include "topoSetSource.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 class faceZoneSet;
54 
55 /*---------------------------------------------------------------------------*\
56  Class planeToFaceZone Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 class planeToFaceZone
60 :
61  public topoSetSource
62 {
63 public:
64 
65  // Public Enumerations
66 
67  //- Enumeration for what to include
68  enum include
69  {
70  all,
72  };
73 
74  //- Included region names
76 
77 
78 private:
79 
80  // Private Data
81 
82  //- Point on the plane
83  const vector point_;
84 
85  //- Normal to the plane
86  const vector normal_;
87 
88  //- Included regions
89  const include include_;
90 
91 
92  // Private Member Functions
93 
94  void combine(faceZoneSet& set, const bool add) const;
95 
96 
97 public:
98 
99  //- Runtime type information
100  TypeName("planeToFaceZone");
101 
102  // Constructors
103 
104  //- Construct from dictionary
106  (
107  const polyMesh& mesh,
108  const dictionary& dict
109  );
110 
111 
112  //- Destructor
113  virtual ~planeToFaceZone();
114 
115 
116  // Member Functions
117 
118  virtual sourceType setType() const
119  {
120  return FACESETSOURCE;
121  }
122 
123  virtual void applyToSet
124  (
125  const topoSetSource::setAction action,
126  topoSet&
127  ) const;
128 };
129 
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 } // End namespace Foam
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 #endif
138 
139 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
Like faceSet but -reads data from faceZone -updates faceZone when writing.
Definition: faceZoneSet.H:52
A topoSetSource to select faces based on the adjacent cell centres spanning a given plane....
TypeName("planeToFaceZone")
Runtime type information.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &) const
static const NamedEnum< include, 2 > includeNames_
Included region names.
virtual sourceType setType() const
include
Enumeration for what to include.
virtual ~planeToFaceZone()
Destructor.
planeToFaceZone(const polyMesh &mesh, const dictionary &dict)
Construct from dictionary.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
Base class of a source for a topoSet.
Definition: topoSetSource.H:64
sourceType
Enumeration defining the types of sources.
Definition: topoSetSource.H:71
setAction
Enumeration defining the valid actions.
Definition: topoSetSource.H:83
const polyMesh & mesh() const
General set of labels of mesh quantity (points, cells, faces).
Definition: topoSet.H:65
Namespace for OpenFOAM.
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
dictionary dict