wallDistData.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) 2011-2018 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::wallDistData
26 
27 Description
28  Wall distance calculation. Like wallDist but also transports extra
29  data (template argument).
30 
31  Used for e.g reflection vector calculation or vanDriest damping.
32 
33  Templated on two parameters:
34  - TransferType: type of overall data transported
35  (e.g. wallPointData<vector>)
36 
37 SourceFiles
38  wallDistData.C
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef wallDistData_H
43 #define wallDistData_H
44 
45 #include "cellDistFuncs.H"
46 #include "volFields.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 /*---------------------------------------------------------------------------*\
54  Class wallDistData Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 template<class TransferType>
58 class wallDistData
59 :
60  public volScalarField,
61  public cellDistFuncs
62 {
63 
64 private:
65 
66  typedef typename TransferType::dataType Type;
67 
68 
69  // Private Member Data
70 
71  //- Reference to field whose data to use (on walls) and update
72  // (every cell and non-wall face)
74 
75  //- Do accurate distance calculation for near-wall cells.
76  bool correctWalls_;
77 
78  //- Number of unset cells and faces.
79  label nUnset_;
80 
81 
82  // Private Member Functions
83 
84  //- Disallow default bitwise copy construct
85  wallDistData(const wallDistData&);
86 
87  //- Disallow default bitwise assignment
88  void operator=(const wallDistData&);
89 
90 
91 public:
92 
93  // Constructors
94 
95  //- Construct from mesh and flag whether or not to correct wall.
96  // Calculate for all cells. correctWalls : correct wall (face&point)
97  // cells for correct distance, searching neighbours.
99  (
100  const fvMesh& mesh,
102  bool correctWalls = true
103  );
104 
105 
106  //- Destructor
107  virtual ~wallDistData();
108 
109 
110  // Member Functions
112  const volScalarField& y() const
113  {
114  return *this;
115  }
117  label nUnset() const
118  {
119  return nUnset_;
120  }
121 
122  //- Access field
124  {
125  return field_;
126  }
127 
128  //- Correct for mesh geom/topo changes
129  virtual void correct();
130 };
131 
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 } // End namespace Foam
136 
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 
139 #ifdef NoRepository
140  #include "wallDistData.C"
141 #endif
142 
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 
145 #endif
146 
147 // ************************************************************************* //
label nUnset() const
Definition: wallDistData.H:116
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
virtual ~wallDistData()
Destructor.
Definition: wallDistData.C:64
const GeometricField< Type, fvPatchField, volMesh > & data() const
Access field.
Definition: wallDistData.H:122
Collection of functions used in wall distance calculation.
Definition: cellDistFuncs.H:61
virtual void correct()
Correct for mesh geom/topo changes.
Definition: wallDistData.C:71
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Wall distance calculation. Like wallDist but also transports extra data (template argument)...
Definition: wallDistData.H:57
const volScalarField & y() const
Definition: wallDistData.H:111
const polyMesh & mesh() const
Access mesh.
Definition: cellDistFuncs.H:95
Namespace for OpenFOAM.