smoothDeltaDeltaDataI.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-2015 OpenFOAM Foundation
9  Copyright (C) 2019 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
29 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
30 
31 template<class TrackingData>
32 inline bool Foam::LESModels::smoothDelta::deltaData::update
33 (
34  const smoothDelta::deltaData& w2,
35  const scalar scale,
36  const scalar tol,
37  TrackingData& td
38 )
39 {
40  if (!valid(td) || (delta_ < VSMALL))
41  {
42  // My delta not set. Take over neighbour.
43  delta_ = w2.delta()/scale;
44 
45  // Something changed. Let caller know.
46  return true;
47  }
48  else if (w2.delta() > (1 + tol)*scale*delta_)
49  {
50  // Neighbour is too big for me. Up my delta.
51  delta_ = w2.delta()/scale;
52 
53  // Something changed. Let caller know.
54  return true;
55  }
56 
57  // Neighbour is not too big for me or change is too small
58  // Nothing changed.
59  return false;
60 }
61 
62 
63 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
64 
66 :
67  delta_(-GREAT)
68 {}
69 
70 
72 :
73  delta_(delta)
74 {}
75 
76 
77 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
78 
79 template<class TrackingData>
81 (
82  TrackingData& td
83 ) const
84 {
85  return delta_ > -SMALL;
86 }
87 
88 
89 template<class TrackingData>
91 (
92  const polyMesh&,
93  const deltaData&,
94  const scalar,
95  TrackingData& td
96 ) const
97 {
98  return true;
99 }
100 
101 
102 template<class TrackingData>
104 (
105  const polyMesh&,
106  const polyPatch&,
107  const label,
108  const point&,
109  TrackingData& td
110 )
111 {}
112 
113 
114 template<class TrackingData>
116 (
117  const polyMesh&,
118  const tensor&,
119  TrackingData& td
120 )
121 {}
122 
123 
124 template<class TrackingData>
126 (
127  const polyMesh&,
128  const polyPatch&,
129  const label,
130  const point&,
131  TrackingData& td
132 )
133 {}
134 
135 
136 template<class TrackingData>
138 (
139  const polyMesh&,
140  const label,
141  const label,
142  const deltaData& neighbourWallInfo,
143  const scalar tol,
144  TrackingData& td
145 )
146 {
147  // Take over info from face if more than deltaRatio larger.
148  return update(neighbourWallInfo, td, tol, td);
149 }
150 
151 
152 template<class TrackingData>
154 (
155  const polyMesh&,
156  const label,
157  const label,
158  const deltaData& neighbourWallInfo,
159  const scalar tol,
160  TrackingData& td
161 )
162 {
163  // Take over information from cell without any scaling (scale = 1.0)
164  return update(neighbourWallInfo, 1.0, tol, td);
165 }
166 
167 
168 template<class TrackingData>
170 (
171  const polyMesh&,
172  const label,
173  const deltaData& neighbourWallInfo,
174  const scalar tol,
175  TrackingData& td
176 )
177 {
178  // Take over information from coupled face without any scaling (scale = 1.0)
179  return update(neighbourWallInfo, 1.0, tol, td);
180 }
181 
182 
183 template<class TrackingData>
185 (
186  const deltaData& rhs,
187  TrackingData& td
188 ) const
189 {
190  return operator==(rhs);
191 }
192 
193 
194 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
195 
196 inline bool Foam::LESModels::smoothDelta::deltaData::operator==
197 (
198  const deltaData& rhs
199 ) const
200 {
201  return delta_ == rhs.delta_;
202 }
203 
204 
205 inline bool Foam::LESModels::smoothDelta::deltaData::operator!=
206 (
207  const deltaData& rhs
208 ) const
209 {
210  return !(*this == rhs);
211 }
212 
213 
214 // ************************************************************************* //
Foam::Tensor< scalar >
Foam::LESModels::smoothDelta::deltaData::equal
bool equal(const deltaData &, TrackingData &td) const
Test for equality, with TrackingData.
Definition: smoothDeltaDeltaDataI.H:185
update
mesh update()
Foam::LESModels::smoothDelta::deltaData
Public class used by mesh-wave to propagate the delta-ratio.
Definition: smoothDelta.H:62
Foam::LESdelta::delta_
volScalarField delta_
Definition: LESdelta.H:61
Foam::LESModels::smoothDelta::deltaData::updateFace
bool updateFace(const polyMesh &, const label thisFacei, const label neighbourCelli, const deltaData &neighbourInfo, const scalar tol, TrackingData &td)
Influence of neighbouring cell.
Definition: smoothDeltaDeltaDataI.H:154
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::LESModels::smoothDelta::deltaData::deltaData
deltaData()
Default construct.
Definition: smoothDeltaDeltaDataI.H:65
Foam::LESModels::smoothDelta::deltaData::sameGeometry
bool sameGeometry(const polyMesh &, const deltaData &, const scalar, TrackingData &td) const
Check for identical geometrical data (eg, cyclics checking)
Definition: smoothDeltaDeltaDataI.H:91
Foam::operator==
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
Foam::LESModels::smoothDelta::deltaData::leaveDomain
void leaveDomain(const polyMesh &, const polyPatch &, const label patchFacei, const point &faceCentre, TrackingData &td)
Definition: smoothDeltaDeltaDataI.H:104
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:68
delta
scalar delta
Definition: LISASMDCalcMethod2.H:8
Foam::LESModels::smoothDelta::deltaData::transform
void transform(const polyMesh &, const tensor &, TrackingData &td)
Apply rotation matrix to any coordinates.
Definition: smoothDeltaDeltaDataI.H:116
w2
#define w2
Definition: blockCreate.C:35
Foam::LESModels::smoothDelta::deltaData::valid
bool valid(TrackingData &td) const
Changed or contains original (invalid) value.
Definition: smoothDeltaDeltaDataI.H:81
Foam::Vector< scalar >
Foam::LESModels::smoothDelta::deltaData::updateCell
bool updateCell(const polyMesh &, const label thisCelli, const label neighbourFacei, const deltaData &neighbourInfo, const scalar tol, TrackingData &td)
Influence of neighbouring face.
Definition: smoothDeltaDeltaDataI.H:138
Foam::LESModels::smoothDelta::deltaData::enterDomain
void enterDomain(const polyMesh &, const polyPatch &, const label patchFacei, const point &faceCentre, TrackingData &td)
Reverse of leaveDomain.
Definition: smoothDeltaDeltaDataI.H:126