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-2022 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 #include "smoothDelta.H"
27 
28 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
29 
30 template<class TrackingData>
31 inline bool Foam::LESModels::smoothDelta::deltaData::update
32 (
33  const smoothDelta::deltaData& w2,
34  const scalar scale,
35  const scalar tol,
36  TrackingData& td
37 )
38 {
39  if (!valid(td) || (delta_ < vSmall))
40  {
41  // My delta not set. Take over neighbour.
42  delta_ = w2.delta()/scale;
43 
44  // Something changed. Let caller know.
45  return true;
46  }
47  else if (w2.delta() > (1 + tol)*scale*delta_)
48  {
49  // Neighbour is too big for me. Up my delta.
50  delta_ = w2.delta()/scale;
51 
52  // Something changed. Let caller know.
53  return true;
54  }
55  else
56  {
57  // Neighbour is not too big for me or change is too small
58  // ...
59 
60  // Nothing changed
61  return false;
62  }
63 }
64 
65 
66 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
67 
69 :
70  delta_(-great)
71 {}
72 
73 
75 :
76  delta_(delta)
77 {}
78 
79 
80 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
81 
82 template<class TrackingData>
84 (
85  TrackingData& td
86 ) const
87 {
88  return delta_ > -small;
89 }
90 
91 
92 template<class TrackingData>
94 (
95  const fvMesh&,
96  const deltaData&,
97  const scalar,
98  TrackingData& td
99 ) const
100 {
101  return true;
102 }
103 
104 
105 template<class TrackingData>
107 (
108  const fvPatch& patch,
109  const label patchFacei,
110  const transformer& transform,
111  TrackingData& td
112 )
113 {}
114 
115 
116 template<class TrackingData>
118 (
119  const fvMesh&,
120  const label,
121  const labelPair&,
122  const deltaData& neighbourWallInfo,
123  const scalar tol,
124  TrackingData& td
125 )
126 {
127  // Take over info from face if more than deltaRatio larger.
128  return update(neighbourWallInfo, td, tol, td);
129 }
130 
131 
132 template<class TrackingData>
134 (
135  const fvMesh&,
136  const labelPair&,
137  const label,
138  const deltaData& neighbourWallInfo,
139  const scalar tol,
140  TrackingData& td
141 )
142 {
143  // Take over information from cell without any scaling (scale = 1.0)
144  return update(neighbourWallInfo, 1.0, tol, td);
145 }
146 
147 
148 template<class TrackingData>
150 (
151  const fvMesh&,
152  const labelPair&,
153  const deltaData& neighbourWallInfo,
154  const scalar tol,
155  TrackingData& td
156 )
157 {
158  // Take over information from coupled face without any scaling (scale = 1.0)
159  return update(neighbourWallInfo, 1.0, tol, td);
160 }
161 
162 
163 template<class TrackingData>
165 (
166  const deltaData& rhs,
167  TrackingData& td
168 ) const
169 {
170  return operator==(rhs);
171 }
172 
173 
174 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
175 
176 inline bool Foam::LESModels::smoothDelta::deltaData::operator==
177 (
178  const deltaData& rhs
179 ) const
180 {
181  return delta_ == rhs.delta();
182 }
183 
184 
185 inline bool Foam::LESModels::smoothDelta::deltaData::operator!=
186 (
187  const deltaData& rhs
188 ) const
189 {
190  return !(*this == rhs);
191 }
192 
193 
194 // ************************************************************************* //
bool valid(TrackingData &td) const
Check whether origin has been changed at all or.
Vector-tensor class used to perform translations, rotations and scaling operations in 3D space...
Definition: transformer.H:83
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:63
bool updateCell(const fvMesh &, const label thisCelli, const labelPair &neighbourPatchAndFacei, const deltaData &neighbourInfo, const scalar tol, TrackingData &td)
Influence of neighbouring face.
An ordered pair of two objects of type <T> with first() and second() elements.
Definition: contiguous.H:49
bool operator==(const deltaData &) const
bool equal(const deltaData &, TrackingData &td) const
Same (like operator==)
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:95
bool sameGeometry(const fvMesh &, const deltaData &, const scalar, TrackingData &td) const
Check for identical geometrical data.
bool updateFace(const fvMesh &, const labelPair &thisPatchAndFacei, const label neighbourCelli, const deltaData &neighbourInfo, const scalar tol, TrackingData &td)
Influence of neighbouring cell.
void transform(const fvPatch &patch, const label patchFacei, const transformer &transform, TrackingData &td)
Transform across an interface.
Public member class used by mesh-wave to propagate the delta-ratio.
Definition: smoothDelta.H:59