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-2021 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  //- Enumeration for what to include
66  enum include
67  {
68  all,
70  };
71 
72  //- Included region names
74 
75 
76 private:
77 
78  // Private Data
79 
80 
81  //- Point on the plane
82  const vector point_;
83 
84  //- Normal to the plane
85  const vector normal_;
86 
87  //- Included regions
88  const include include_;
89 
90 
91  // Private Member Functions
92 
93  void combine(faceZoneSet& set, const bool add) const;
94 
95 
96 public:
97 
98  //- Runtime type information
99  TypeName("planeToFaceZone");
100 
101  // Constructors
102 
103  //- Construct from dictionary
105  (
106  const polyMesh& mesh,
107  const dictionary& dict
108  );
109 
110 
111  //- Destructor
112  virtual ~planeToFaceZone();
113 
114 
115  // Member Functions
116 
117  virtual sourceType setType() const
118  {
119  return FACESETSOURCE;
120  }
121 
122  virtual void applyToSet
123  (
124  const topoSetSource::setAction action,
125  topoSet&
126  ) const;
127 };
128 
129 
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131 
132 } // End namespace Foam
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 #endif
137 
138 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
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