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-2020 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  typedef typename TransferType::dataType Type;
64 
65 
66  // Private Member Data
67 
68  //- Reference to field whose data to use (on walls) and update
69  // (every cell and non-wall face)
71 
72  //- Do accurate distance calculation for near-wall cells.
73  bool correctWalls_;
74 
75  //- Number of unset cells and faces.
76  label nUnset_;
77 
78 
79 public:
80 
81  // Constructors
82 
83  //- Construct from mesh and flag whether or not to correct wall.
84  // Calculate for all cells. correctWalls : correct wall (face&point)
85  // cells for correct distance, searching neighbours.
87  (
88  const fvMesh& mesh,
90  bool correctWalls = true
91  );
92 
93  //- Disallow default bitwise copy construction
94  wallDistData(const wallDistData&) = delete;
95 
96 
97  //- Destructor
98  virtual ~wallDistData();
99 
100 
101  // Member Functions
103  const volScalarField& y() const
104  {
105  return *this;
106  }
108  label nUnset() const
109  {
110  return nUnset_;
111  }
112 
113  //- Access field
115  {
116  return field_;
117  }
118 
119  //- Correct for mesh geom/topo changes
120  virtual void correct();
121 
122 
123  // Member Operators
124 
125  //- Disallow default bitwise assignment
126  void operator=(const wallDistData&) = delete;
127 };
128 
129 
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131 
132 } // End namespace Foam
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 #ifdef NoRepository
137  #include "wallDistData.C"
138 #endif
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 #endif
143 
144 // ************************************************************************* //
label nUnset() const
Definition: wallDistData.H:107
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:113
void operator=(const wallDistData &)=delete
Disallow default bitwise assignment.
Collection of functions used in wall distance calculation.
Definition: cellDistFuncs.H:61
wallDistData(const fvMesh &mesh, GeometricField< Type, fvPatchField, volMesh > &, bool correctWalls=true)
Construct from mesh and flag whether or not to correct wall.
Definition: wallDistData.C:35
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:102
const polyMesh & mesh() const
Access mesh.
Definition: cellDistFuncs.H:92
Namespace for OpenFOAM.