wallDistData.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2016 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::wallDistData
28
29Description
30 Wall distance calculation. Like wallDist but also transports extra
31 data (template argument).
32
33 Used for e.g reflection vector calculation or vanDriest damping.
34
35 Templated on two parameters:
36 - TransferType: type of overall data transported
37 (e.g. wallPointData<vector>)
38
39SourceFiles
40 wallDistData.C
41
42\*---------------------------------------------------------------------------*/
43
44#ifndef wallDistData_H
45#define wallDistData_H
46
47#include "cellDistFuncs.H"
48#include "volFields.H"
49
50// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51
52namespace Foam
53{
54
55/*---------------------------------------------------------------------------*\
56 Class wallDistData Declaration
57\*---------------------------------------------------------------------------*/
58
59template<class TransferType>
60class wallDistData
61:
62 public volScalarField,
63 public cellDistFuncs
64{
65
66private:
67
68 typedef typename TransferType::dataType Type;
69
70
71 // Private Member Data
72
73 //- Reference to field whose data to use (on walls) and update
74 // (every cell and non-wall face)
76
77 //- Do accurate distance calculation for near-wall cells.
78 bool correctWalls_;
79
80 //- Number of unset cells and faces.
81 label nUnset_;
82
83
84 // Private Member Functions
85
86 //- No copy construct
87 wallDistData(const wallDistData&) = delete;
88
89 //- No copy assignment
90 void operator=(const wallDistData&) = delete;
91
92
93public:
94
95 // Constructors
96
97 //- Construct from mesh and flag whether or not to correct wall.
98 // Calculate for all cells. correctWalls : correct wall (face&point)
99 // cells for correct distance, searching neighbours.
101 (
102 const fvMesh& mesh,
104 bool correctWalls = true
105 );
106
107
108 //- Destructor
109 virtual ~wallDistData();
110
111
112 // Member Functions
114 const volScalarField& y() const
115 {
116 return *this;
117 }
119 label nUnset() const
120 {
121 return nUnset_;
122 }
123
124 //- Access field
126 {
127 return field_;
128 }
129
130 //- Correct for mesh geom/topo changes
131 virtual void correct();
132};
133
134
135// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136
137} // End namespace Foam
138
139// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140
141#ifdef NoRepository
142 #include "wallDistData.C"
143#endif
144
145// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146
147#endif
148
149// ************************************************************************* //
Collection of functions used in wall distance calculation.
Definition: cellDistFuncs.H:64
const polyMesh & mesh() const
Access mesh.
Definition: cellDistFuncs.H:92
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Wall distance calculation. Like wallDist but also transports extra data (template argument).
Definition: wallDistData.H:63
virtual void correct()
Correct for mesh geom/topo changes.
Definition: wallDistData.C:74
const GeometricField< Type, fvPatchField, volMesh > & data() const
Access field.
Definition: wallDistData.H:124
virtual ~wallDistData()
Destructor.
Definition: wallDistData.C:67
label nUnset() const
Definition: wallDistData.H:118
const volScalarField & y() const
Definition: wallDistData.H:113
Namespace for OpenFOAM.