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-------------------------------------------------------------------------------
11License
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
31template<class TrackingData>
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:
74{}
75
76
77// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
78
79template<class TrackingData>
81(
82 TrackingData& td
83) const
84{
85 return delta_ > -SMALL;
86}
87
88
89template<class TrackingData>
91(
92 const polyMesh&,
93 const deltaData&,
94 const scalar,
95 TrackingData& td
96) const
97{
98 return true;
99}
100
101
102template<class TrackingData>
104(
105 const polyMesh&,
106 const polyPatch&,
107 const label,
108 const point&,
109 TrackingData& td
110)
111{}
112
113
114template<class TrackingData>
116(
117 const polyMesh&,
118 const tensor&,
119 TrackingData& td
120)
121{}
122
123
124template<class TrackingData>
126(
127 const polyMesh&,
128 const polyPatch&,
129 const label,
130 const point&,
131 TrackingData& td
132)
133{}
134
135
136template<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
152template<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
168template<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
183template<class TrackingData>
185(
186 const deltaData& rhs,
187 TrackingData& td
188) const
189{
190 return operator==(rhs);
191}
192
193
194// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
195
197(
198 const deltaData& rhs
199) const
200{
201 return delta_ == rhs.delta_;
202}
203
204
206(
207 const deltaData& rhs
208) const
209{
210 return !(*this == rhs);
211}
212
213
214// ************************************************************************* //
scalar delta
#define w2
Definition: blockCreate.C:35
Public class used by mesh-wave to propagate the delta-ratio.
Definition: smoothDelta.H:63
void enterDomain(const polyMesh &, const polyPatch &, const label patchFacei, const point &faceCentre, TrackingData &td)
Reverse of leaveDomain.
bool equal(const deltaData &, TrackingData &td) const
Test for equality, with TrackingData.
bool sameGeometry(const polyMesh &, const deltaData &, const scalar, TrackingData &td) const
Check for identical geometrical data (eg, cyclics checking)
bool updateCell(const polyMesh &, const label thisCelli, const label neighbourFacei, const deltaData &neighbourInfo, const scalar tol, TrackingData &td)
Influence of neighbouring face.
bool valid(TrackingData &td) const
Changed or contains original (invalid) value.
void leaveDomain(const polyMesh &, const polyPatch &, const label patchFacei, const point &faceCentre, TrackingData &td)
bool updateFace(const polyMesh &, const label thisFacei, const label neighbourCelli, const deltaData &neighbourInfo, const scalar tol, TrackingData &td)
Influence of neighbouring cell.
volScalarField delta_
Definition: LESdelta.H:61
bool valid() const
True if all internal ids are non-negative.
friend Ostream & operator(Ostream &, const faMatrix< Type > &)
virtual bool update()
Update the mesh for both mesh motion and topology change.
Default transformation behaviour.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:75
mesh update()
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)