All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
smoothDeltaDeltaDataI.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 \*---------------------------------------------------------------------------*/
25 
26 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
27 
28 template<class TrackingData>
29 inline bool Foam::LESModels::smoothDelta::deltaData::update
30 (
31  const smoothDelta::deltaData& w2,
32  const scalar scale,
33  const scalar tol,
34  TrackingData& td
35 )
36 {
37  if (!valid(td) || (delta_ < vSmall))
38  {
39  // My delta not set. Take over neighbour.
40  delta_ = w2.delta()/scale;
41 
42  // Something changed. Let caller know.
43  return true;
44  }
45  else if (w2.delta() > (1 + tol)*scale*delta_)
46  {
47  // Neighbour is too big for me. Up my delta.
48  delta_ = w2.delta()/scale;
49 
50  // Something changed. Let caller know.
51  return true;
52  }
53  else
54  {
55  // Neighbour is not too big for me or change is too small
56  // Nothing changed.
57  return false;
58  }
59 }
60 
61 
62 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
63 
65 :
66  delta_(-great)
67 {}
68 
69 
71 :
72  delta_(delta)
73 {}
74 
75 
76 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
77 
78 template<class TrackingData>
80 (
81  TrackingData& td
82 ) const
83 {
84  return delta_ > -small;
85 }
86 
87 
88 template<class TrackingData>
90 (
91  const polyMesh&,
92  const deltaData&,
93  const scalar,
94  TrackingData& td
95 ) const
96 {
97  return true;
98 }
99 
100 
101 template<class TrackingData>
103 (
104  const polyMesh&,
105  const polyPatch&,
106  const label,
107  const point&,
108  TrackingData& td
109 )
110 {}
111 
112 
113 template<class TrackingData>
115 (
116  const polyMesh&,
117  const tensor&,
118  TrackingData& td
119 )
120 {}
121 
122 
123 template<class TrackingData>
125 (
126  const polyMesh&,
127  const polyPatch&,
128  const label,
129  const point&,
130  TrackingData& td
131 )
132 {}
133 
134 
135 template<class TrackingData>
137 (
138  const polyMesh&,
139  const label,
140  const label,
141  const deltaData& neighbourWallInfo,
142  const scalar tol,
143  TrackingData& td
144 )
145 {
146  // Take over info from face if more than deltaRatio larger.
147  return update(neighbourWallInfo, td, tol, td);
148 }
149 
150 
151 template<class TrackingData>
153 (
154  const polyMesh&,
155  const label,
156  const label,
157  const deltaData& neighbourWallInfo,
158  const scalar tol,
159  TrackingData& td
160 )
161 {
162  // Take over information from cell without any scaling (scale = 1.0)
163  return update(neighbourWallInfo, 1.0, tol, td);
164 }
165 
166 
167 template<class TrackingData>
169 (
170  const polyMesh&,
171  const label,
172  const deltaData& neighbourWallInfo,
173  const scalar tol,
174  TrackingData& td
175 )
176 {
177  // Take over information from coupled face without any scaling (scale = 1.0)
178  return update(neighbourWallInfo, 1.0, tol, td);
179 }
180 
181 
182 template<class TrackingData>
184 (
185  const deltaData& rhs,
186  TrackingData& td
187 ) const
188 {
189  return operator==(rhs);
190 }
191 
192 
193 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
194 
195 inline bool Foam::LESModels::smoothDelta::deltaData::operator==
196 (
197  const deltaData& rhs
198 ) const
199 {
200  return delta_ == rhs.delta();
201 }
202 
203 
204 inline bool Foam::LESModels::smoothDelta::deltaData::operator!=
205 (
206  const deltaData& rhs
207 ) const
208 {
209  return !(*this == rhs);
210 }
211 
212 
213 // ************************************************************************* //
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
bool valid(TrackingData &td) const
Check whether origin has been changed at all or.
void transform(const polyMesh &, const tensor &, TrackingData &td)
Apply rotation matrix to any coordinates.
bool sameGeometry(const polyMesh &, const deltaData &, const scalar, TrackingData &td) const
Check for identical geometrical data.
bool updateFace(const polyMesh &, const label thisFacei, const label neighbourCelli, const deltaData &neighbourInfo, const scalar tol, TrackingData &td)
Influence of neighbouring cell.
void leaveDomain(const polyMesh &, const polyPatch &, const label patchFacei, const point &faceCentre, TrackingData &td)
Convert any absolute coordinates into relative to.
bool operator==(const deltaData &) const
bool updateCell(const polyMesh &, const label thisCelli, const label neighbourFacei, const deltaData &neighbourInfo, const scalar tol, TrackingData &td)
Influence of neighbouring face.
bool equal(const deltaData &, TrackingData &td) const
Same (like operator==)
void enterDomain(const polyMesh &, const polyPatch &, const label patchFacei, const point &faceCentre, TrackingData &td)
Reverse of leaveDomain.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
Public member class used by mesh-wave to propagate the delta-ratio.
Definition: smoothDelta.H:59