FvWallInfoI.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 "FvWallInfo.H"
27 #include "fvMesh.H"
28 #include "volFields.H"
29 #include "surfaceFields.H"
30 
31 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
32 
33 template<class WallInfo, class Derived>
34 template<class TrackingData>
36 (
37  const fvPatch& patch,
38  const label patchFacei,
39  const transformer& transform,
40  TrackingData& td
41 )
42 {
43  WallInfo::template type<Derived>::transform
44  (
45  patch.patch(),
46  patchFacei,
47  transform,
48  td
49  );
50 }
51 
52 
53 template<class WallInfo, class Derived>
54 template<class TrackingData>
56 (
57  const fvMesh& mesh,
58  const label thisCelli,
59  const labelPair& neighbourPatchAndFacei,
60  const FvWallInfoBase<WallInfo, Derived>& neighbourWallInfo,
61  const scalar tol,
62  TrackingData& td
63 )
64 {
65  return
66  static_cast<Derived&>(*this).update
67  (
68  mesh.C()[thisCelli],
69  static_cast<const Derived&>(neighbourWallInfo),
70  tol,
71  td
72  );
73 }
74 
75 
76 template<class WallInfo, class Derived>
77 template<class TrackingData>
79 (
80  const fvMesh& mesh,
81  const labelPair& thisPatchAndFacei,
82  const label neighbourCelli,
83  const FvWallInfoBase<WallInfo, Derived>& neighbourWallInfo,
84  const scalar tol,
85  TrackingData& td
86 )
87 {
88  const label thisPatchi = thisPatchAndFacei.first();
89  const label thisFacei = thisPatchAndFacei.second();
90 
91  return
92  static_cast<Derived&>(*this).update
93  (
94  thisPatchi == -1
95  ? mesh.Cf()[thisFacei]
96  : mesh.Cf().boundaryField()[thisPatchi][thisFacei],
97  static_cast<const Derived&>(neighbourWallInfo),
98  tol,
99  td
100  );
101 }
102 
103 
104 template<class WallInfo, class Derived>
105 template<class TrackingData>
107 (
108  const fvMesh& mesh,
109  const labelPair& thisPatchAndFacei,
110  const FvWallInfoBase<WallInfo, Derived>& neighbourWallInfo,
111  const scalar tol,
112  TrackingData& td
113 )
114 {
115  const label thisPatchi = thisPatchAndFacei.first();
116  const label thisFacei = thisPatchAndFacei.second();
117 
118  return
119  static_cast<Derived&>(*this).update
120  (
121  thisPatchi == -1
122  ? mesh.Cf()[thisFacei]
123  : mesh.Cf().boundaryField()[thisPatchi][thisFacei],
124  static_cast<const Derived&>(neighbourWallInfo),
125  tol,
126  td
127  );
128 }
129 
130 
131 // ************************************************************************* //
Foam::surfaceFields.
bool updateCell(const fvMesh &, const label thisCelli, const labelPair &neighbourPatchAndFacei, const FvWallInfoBase< WallInfo, Derived > &neighbourInfo, const scalar tol, TrackingData &td)
Influence of neighbouring face.
Definition: FvWallInfoI.H:56
Vector-tensor class used to perform translations, rotations and scaling operations in 3D space...
Definition: transformer.H:83
const surfaceVectorField & Cf() const
Return face centres.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:63
bool updateFace(const fvMesh &, const labelPair &thisPatchAndFacei, const label neighbourCelli, const FvWallInfoBase< WallInfo, Derived > &neighbourInfo, const scalar tol, TrackingData &td)
Influence of neighbouring cell.
Definition: FvWallInfoI.H:79
An ordered pair of two objects of type <T> with first() and second() elements.
Definition: contiguous.H:49
const polyPatch & patch() const
Return the polyPatch.
Definition: fvPatch.H:139
void transform(const fvPatch &patch, const label patchFacei, const transformer &transform, TrackingData &td)
Transform across an interface.
Definition: FvWallInfoI.H:36
const Type & second() const
Return second.
Definition: Pair.H:110
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:95
bool update(const point &, const FvWallInfoDataBase< WallInfo, Type, Derived > &w2, const scalar tol, TrackingData &td)
Evaluate distance to point. Update distSqr, origin from whomever.
const volVectorField & C() const
Return cell centres.
const Type & first() const
Return first.
Definition: Pair.H:98
dimensionSet transform(const dimensionSet &)
Definition: dimensionSet.C:483