cyclicFvPatch.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 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 Class
28  Foam::cyclicFvPatch
29 
30 Description
31  Cyclic-plane patch.
32 
33 SourceFiles
34  cyclicFvPatch.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef cyclicFvPatch_H
39 #define cyclicFvPatch_H
40 
41 #include "coupledFvPatch.H"
42 #include "cyclicLduInterface.H"
43 #include "cyclicPolyPatch.H"
44 #include "fvBoundaryMesh.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class cyclicFvPatch Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 class cyclicFvPatch
56 :
57  public coupledFvPatch,
58  public cyclicLduInterface
59 {
60  // Private data
61 
62  const cyclicPolyPatch& cyclicPolyPatch_;
63 
64 
65 protected:
66 
67  // Protected Member functions
68 
69  //- Make patch weighting factors
70  void makeWeights(scalarField&) const;
71 
72 
73 public:
74 
75  //- Runtime type information
76  TypeName(cyclicPolyPatch::typeName_());
77 
78 
79  // Constructors
80 
81  //- Construct from polyPatch
82  cyclicFvPatch(const polyPatch& patch, const fvBoundaryMesh& bm)
83  :
84  coupledFvPatch(patch, bm),
85  cyclicPolyPatch_(refCast<const cyclicPolyPatch>(patch))
86  {}
87 
88 
89  // Member functions
90 
91 
92  // Access
93 
94  //- Return local reference cast into the cyclic patch
95  const cyclicPolyPatch& cyclicPatch() const
96  {
97  return cyclicPolyPatch_;
98  }
99 
100  //- Return neighbour
101  virtual label neighbPatchID() const
102  {
103  return cyclicPolyPatch_.neighbPatchID();
104  }
105 
106  virtual bool owner() const
107  {
108  return cyclicPolyPatch_.owner();
109  }
110 
111  //- Return processor number
112  virtual const cyclicFvPatch& neighbPatch() const
113  {
114  return refCast<const cyclicFvPatch>
115  (
116  this->boundaryMesh()[cyclicPolyPatch_.neighbPatchID()]
117  );
118  }
119 
120  //- Are the cyclic planes parallel
121  virtual bool parallel() const
122  {
123  return cyclicPolyPatch_.parallel();
124  }
125 
126  //- Return face transformation tensor
127  virtual const tensorField& forwardT() const
128  {
129  return cyclicPolyPatch_.forwardT();
130  }
131 
132  //- Return neighbour-cell transformation tensor
133  virtual const tensorField& reverseT() const
134  {
135  return cyclicPolyPatch_.reverseT();
136  }
137 
138  const cyclicFvPatch& neighbFvPatch() const
139  {
140  return refCast<const cyclicFvPatch>
141  (
142  this->boundaryMesh()[cyclicPolyPatch_.neighbPatchID()]
143  );
144  }
145 
146 
147  //- Return delta (P to N) vectors across coupled patch
148  virtual tmp<vectorField> delta() const;
149 
150 
151  // Interface transfer functions
152 
153  //- Return the values of the given internal data adjacent to
154  //- the interface as a field
156  (
157  const labelUList& internalData
158  ) const;
159 
160 
161  //- Return the values of the given internal data adjacent to
162  //- the interface as a field using a mapping faceCell
164  (
165  const labelUList& internalData,
166  const labelUList& faceCell
167  ) const;
168 
169 
170  //- Return neighbour field
172  (
173  const Pstream::commsTypes commsType,
174  const labelUList& internalData
175  ) const;
176 
177 };
178 
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 } // End namespace Foam
183 
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 
186 #endif
187 
188 // ************************************************************************* //
Foam::cyclicFvPatch::parallel
virtual bool parallel() const
Are the cyclic planes parallel.
Definition: cyclicFvPatch.H:120
Foam::cyclicFvPatch::makeWeights
void makeWeights(scalarField &) const
Make patch weighting factors.
Definition: cyclicFvPatch.C:45
Foam::cyclicFvPatch::interfaceInternalField
virtual tmp< labelField > interfaceInternalField(const labelUList &internalData) const
Definition: cyclicFvPatch.C:97
cyclicPolyPatch.H
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::cyclicPolyPatch
Cyclic plane patch.
Definition: cyclicPolyPatch.H:66
Foam::coupledPolyPatch::forwardT
virtual const tensorField & forwardT() const
Return face transformation tensor.
Definition: coupledPolyPatch.H:301
Foam::coupledPolyPatch::reverseT
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
Definition: coupledPolyPatch.H:307
cyclicLduInterface.H
coupledFvPatch.H
Foam::fvPatch::boundaryMesh
const fvBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
Definition: fvPatch.H:203
Foam::fvBoundaryMesh
Foam::fvBoundaryMesh.
Definition: fvBoundaryMesh.H:57
Foam::cyclicFvPatch::reverseT
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
Definition: cyclicFvPatch.H:132
Foam::coupledPolyPatch::parallel
virtual bool parallel() const
Are the cyclic planes parallel.
Definition: coupledPolyPatch.H:295
Foam::cyclicFvPatch::neighbFvPatch
const cyclicFvPatch & neighbFvPatch() const
Definition: cyclicFvPatch.H:137
Foam::cyclicFvPatch::TypeName
TypeName(cyclicPolyPatch::typeName_())
Runtime type information.
Foam::Field< scalar >
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:68
Foam::cyclicFvPatch::delta
virtual tmp< vectorField > delta() const
Return delta (P to N) vectors across coupled patch.
Definition: cyclicFvPatch.C:62
fvBoundaryMesh.H
Foam::cyclicPolyPatch::owner
virtual bool owner() const
Does this side own the patch ?
Definition: cyclicPolyPatch.H:372
Foam::cyclicFvPatch::owner
virtual bool owner() const
Definition: cyclicFvPatch.H:105
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::refCast
To & refCast(From &r)
Reference type cast template function.
Definition: typeInfo.H:131
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:69
Foam::cyclicFvPatch::forwardT
virtual const tensorField & forwardT() const
Return face transformation tensor.
Definition: cyclicFvPatch.H:126
Foam::cyclicFvPatch
Cyclic-plane patch.
Definition: cyclicFvPatch.H:54
Foam::cyclicFvPatch::neighbPatch
virtual const cyclicFvPatch & neighbPatch() const
Return processor number.
Definition: cyclicFvPatch.H:111
Foam::UList< label >
Foam::cyclicFvPatch::neighbPatchID
virtual label neighbPatchID() const
Return neighbour.
Definition: cyclicFvPatch.H:100
Foam::fvPatch::patch
const polyPatch & patch() const
Return the polyPatch.
Definition: fvPatch.H:161
Foam::cyclicFvPatch::internalFieldTransfer
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &internalData) const
Return neighbour field.
Definition: cyclicFvPatch.C:116
Foam::coupledFvPatch
An abstract base class for patches that couple regions of the computational domain e....
Definition: coupledFvPatch.H:53
Foam::cyclicPolyPatch::neighbPatchID
virtual label neighbPatchID() const
Neighbour patchID.
Definition: cyclicPolyPatch.C:837
Foam::cyclicFvPatch::cyclicFvPatch
cyclicFvPatch(const polyPatch &patch, const fvBoundaryMesh &bm)
Construct from polyPatch.
Definition: cyclicFvPatch.H:81
Foam::cyclicLduInterface
An abstract base class for cyclic coupled interfaces.
Definition: cyclicLduInterface.H:52
Foam::cyclicFvPatch::cyclicPatch
const cyclicPolyPatch & cyclicPatch() const
Return local reference cast into the cyclic patch.
Definition: cyclicFvPatch.H:94