cyclicACMIFvPatch.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) 2013-2016 OpenFOAM Foundation
9  Copyright (C) 2020 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::cyclicACMIFvPatch
29 
30 Description
31  Cyclic patch for Arbitrarily Coupled Mesh Interface (ACMI)
32 
33 SourceFiles
34  cyclicACMIFvPatch.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef cyclicACMIFvPatch_H
39 #define cyclicACMIFvPatch_H
40 
41 #include "coupledFvPatch.H"
42 #include "cyclicACMILduInterface.H"
43 #include "cyclicACMIPolyPatch.H"
44 #include "fvBoundaryMesh.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class cyclicACMIFvPatch Declaration
53 \*---------------------------------------------------------------------------*/
54 
56 :
57  public coupledFvPatch,
59 {
60  // Private data
61 
62  const cyclicACMIPolyPatch& cyclicACMIPolyPatch_;
63 
64  //- Flag to detect whether AMI is up to date with mesh points
65  mutable uniformDimensionedScalarField areaTime_;
66 
67 
68 
69 protected:
70 
71  // Protected Member functions
72 
73  //- Update the AMI and patch areas. Return true if anything updated
74  virtual bool updateAreas() const;
75 
76  //- Helper function to reset the FV patch areas from the primitive patch
77  void resetPatchAreas(const fvPatch& fvp) const;
78 
79  //- Make patch weighting factors
80  void makeWeights(scalarField&) const;
81 
82  //- Correct patches after moving points
83  virtual void movePoints();
84 
85 
86 public:
87 
88  //- Runtime type information
89  TypeName(cyclicACMIPolyPatch::typeName_());
90 
91 
92  // Constructors
93 
94  //- Construct from polyPatch
96 
97 
98  // Member functions
99 
100 // // Implicit treatment functions
101 //
102 // //- Return number of new internal sub-faces and new proc faces
103 // virtual void newInternalProcFaces(label&, label&) const;
104 //
105 // //- Return collocated faces
106 // virtual refPtr<labelListList> mapCollocatedFaces() const;
107 
108 
109  // Access
110 
111  //- Return local reference cast into the cyclic patch
112  const cyclicACMIPolyPatch& cyclicACMIPatch() const
113  {
114  return cyclicACMIPolyPatch_;
115  }
116 
117  //- Return neighbour
118  virtual label neighbPatchID() const
119  {
120  return cyclicACMIPolyPatch_.neighbPatchID();
121  }
122 
123  virtual bool owner() const
124  {
125  return cyclicACMIPolyPatch_.owner();
126  }
127 
128  //- Return neighbour fvPatch
129  virtual const cyclicACMIFvPatch& neighbPatch() const
130  {
131  return refCast<const cyclicACMIFvPatch>
132  (
133  this->boundaryMesh()[cyclicACMIPolyPatch_.neighbPatchID()]
134  );
135  }
136 
137  //- Return neighbour
138  virtual label nonOverlapPatchID() const
139  {
140  return cyclicACMIPolyPatch_.nonOverlapPatchID();
141  }
142 
143  //- Return non-overlapping fvPatch
144  virtual const fvPatch& nonOverlapPatch() const
145  {
146  return this->boundaryMesh()[nonOverlapPatchID()];
147  }
148 
149  //- Return a reference to the AMI interpolator
150  virtual const AMIPatchToPatchInterpolation& AMI() const
151  {
152  return cyclicACMIPolyPatch_.AMI();
153  }
154 
155  //- Are the cyclic planes parallel
156  virtual bool parallel() const
157  {
158  return cyclicACMIPolyPatch_.parallel();
159  }
160 
161  //- Return face transformation tensor
162  virtual const tensorField& forwardT() const
163  {
164  return cyclicACMIPolyPatch_.forwardT();
165  }
166 
167  //- Return neighbour-cell transformation tensor
168  virtual const tensorField& reverseT() const
169  {
170  return cyclicACMIPolyPatch_.reverseT();
171  }
172 
173  const cyclicACMIFvPatch& neighbFvPatch() const
174  {
175  return refCast<const cyclicACMIFvPatch>
176  (
177  this->boundaryMesh()[cyclicACMIPolyPatch_.neighbPatchID()]
178  );
179  }
180 
181  //- Return true if this patch is coupled.
182  // This is equivalent to coupledPolyPatch::coupled()
183  // if parallel running or both sides present, false otherwise
184  virtual bool coupled() const;
185 
186  //- Return delta (P to N) vectors across coupled patch
187  virtual tmp<vectorField> delta() const;
188 
189  //- Interpolate (make sure to have uptodate areas)
190  template<class Type>
192  (
193  const Field<Type>& fld
194  ) const
195  {
196  // Make sure areas are up-to-date
197  updateAreas();
198 
199  return
200  cyclicACMIPolyPatch_.cyclicAMIPolyPatch::interpolate
201  (
202  fld
203  );
204  }
205 
206  //- Interpolate (make sure to have up-to-date areas)
207  template<class Type>
209  (
210  const tmp<Field<Type>>& tfld
211  ) const
212  {
213  return interpolate(tfld());
214  }
215 
216 
217  // Interface transfer functions
218 
219  //- Return the values of the given internal data adjacent to
220  //- the interface as a field
222  (
223  const labelUList& internalData
224  ) const;
225 
226  //- Return the values of the given internal data adjacent to
227  //- the interface as a field using a mapping faceCell
229  (
230  const labelUList& internalData,
231  const labelUList& faceCells
232  ) const;
233 
234  //- Return neighbour field
236  (
237  const Pstream::commsTypes commsType,
238  const labelUList& internalData
239  ) const;
240 
241 };
242 
243 
244 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
245 
246 } // End namespace Foam
247 
248 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
249 
250 #endif
251 
252 // ************************************************************************* //
Foam::cyclicACMIFvPatch::neighbFvPatch
const cyclicACMIFvPatch & neighbFvPatch() const
Definition: cyclicACMIFvPatch.H:172
Foam::cyclicAMIPolyPatch::owner
virtual bool owner() const
Does this side own the patch?
Definition: cyclicAMIPolyPatch.C:964
cyclicACMIPolyPatch.H
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::cyclicACMIFvPatch::owner
virtual bool owner() const
Definition: cyclicACMIFvPatch.H:122
Foam::coupledPolyPatch::forwardT
virtual const tensorField & forwardT() const
Return face transformation tensor.
Definition: coupledPolyPatch.H:301
Foam::cyclicACMILduInterface
An abstract base class for cyclic ACMI coupled interfaces.
Definition: cyclicACMILduInterface.H:51
Foam::cyclicACMIFvPatch::interpolate
tmp< Field< Type > > interpolate(const Field< Type > &fld) const
Interpolate (make sure to have uptodate areas)
Definition: cyclicACMIFvPatch.H:191
Foam::coupledPolyPatch::reverseT
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
Definition: coupledPolyPatch.H:307
Foam::cyclicACMIFvPatch::parallel
virtual bool parallel() const
Are the cyclic planes parallel.
Definition: cyclicACMIFvPatch.H:155
Foam::cyclicACMIFvPatch::delta
virtual tmp< vectorField > delta() const
Return delta (P to N) vectors across coupled patch.
Definition: cyclicACMIFvPatch.C:239
Foam::cyclicACMIFvPatch::coupled
virtual bool coupled() const
Return true if this patch is coupled.
Definition: cyclicACMIFvPatch.C:233
Foam::cyclicACMIFvPatch::internalFieldTransfer
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &internalData) const
Return neighbour field.
Definition: cyclicACMIFvPatch.C:303
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::coupledPolyPatch::parallel
virtual bool parallel() const
Are the cyclic planes parallel.
Definition: coupledPolyPatch.H:295
Foam::UniformDimensionedField< scalar >
Foam::cyclicACMIFvPatch::forwardT
virtual const tensorField & forwardT() const
Return face transformation tensor.
Definition: cyclicACMIFvPatch.H:161
Foam::Field< scalar >
Foam::cyclicACMIFvPatch::reverseT
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
Definition: cyclicACMIFvPatch.H:167
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:68
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::cyclicACMIFvPatch::neighbPatch
virtual const cyclicACMIFvPatch & neighbPatch() const
Return neighbour fvPatch.
Definition: cyclicACMIFvPatch.H:128
Foam::cyclicACMIFvPatch::nonOverlapPatchID
virtual label nonOverlapPatchID() const
Return neighbour.
Definition: cyclicACMIFvPatch.H:137
Foam::cyclicACMIFvPatch::TypeName
TypeName(cyclicACMIPolyPatch::typeName_())
Runtime type information.
fld
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Definition: gmvOutputLagrangian.H:23
Foam::cyclicACMIFvPatch::neighbPatchID
virtual label neighbPatchID() const
Return neighbour.
Definition: cyclicACMIFvPatch.H:117
Foam::cyclicACMIFvPatch::movePoints
virtual void movePoints()
Correct patches after moving points.
Definition: cyclicACMIFvPatch.C:312
Foam::cyclicACMIFvPatch::nonOverlapPatch
virtual const fvPatch & nonOverlapPatch() const
Return non-overlapping fvPatch.
Definition: cyclicACMIFvPatch.H:143
fvBoundaryMesh.H
Foam::cyclicACMIPolyPatch::nonOverlapPatchID
virtual label nonOverlapPatchID() const
Non-overlapping patch ID.
Definition: cyclicACMIPolyPatch.C:820
Foam::cyclicAMIPolyPatch::neighbPatchID
virtual label neighbPatchID() const
Neighbour patch ID.
Definition: cyclicAMIPolyPatch.C:902
Foam::cyclicACMIFvPatch::AMI
virtual const AMIPatchToPatchInterpolation & AMI() const
Return a reference to the AMI interpolator.
Definition: cyclicACMIFvPatch.H:149
Foam::cyclicACMIFvPatch::updateAreas
virtual bool updateAreas() const
Update the AMI and patch areas. Return true if anything updated.
Definition: cyclicACMIFvPatch.C:46
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::cyclicACMIFvPatch::cyclicACMIFvPatch
cyclicACMIFvPatch(const polyPatch &patch, const fvBoundaryMesh &bm)
Construct from polyPatch.
Definition: cyclicACMIFvPatch.C:143
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:69
cyclicACMILduInterface.H
Foam::cyclicAMIPolyPatch::AMI
const AMIPatchToPatchInterpolation & AMI() const
Return a reference to the AMI interpolator.
Definition: cyclicAMIPolyPatch.C:977
Foam::cyclicACMIFvPatch::resetPatchAreas
void resetPatchAreas(const fvPatch &fvp) const
Helper function to reset the FV patch areas from the primitive patch.
Definition: cyclicACMIFvPatch.C:83
Foam::cyclicACMIFvPatch::cyclicACMIPatch
const cyclicACMIPolyPatch & cyclicACMIPatch() const
Return local reference cast into the cyclic patch.
Definition: cyclicACMIFvPatch.H:111
Foam::AMIInterpolation
Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mes...
Definition: AMIInterpolation.H:79
Foam::UList< label >
Foam::cyclicACMIFvPatch::interfaceInternalField
virtual tmp< labelField > interfaceInternalField(const labelUList &internalData) const
Definition: cyclicACMIFvPatch.C:284
Foam::fvPatch::patch
const polyPatch & patch() const
Return the polyPatch.
Definition: fvPatch.H:161
Foam::coupledFvPatch
An abstract base class for patches that couple regions of the computational domain e....
Definition: coupledFvPatch.H:53
Foam::cyclicACMIPolyPatch
Cyclic patch for Arbitrarily Coupled Mesh Interface (ACMI).
Definition: cyclicACMIPolyPatch.H:78
Foam::cyclicACMIFvPatch::makeWeights
void makeWeights(scalarField &) const
Make patch weighting factors.
Definition: cyclicACMIFvPatch.C:94
Foam::faceCells
Smooth ATC in cells next to a set of patches supplied by type.
Definition: faceCells.H:56
Foam::cyclicACMIFvPatch
Cyclic patch for Arbitrarily Coupled Mesh Interface (ACMI)
Definition: cyclicACMIFvPatch.H:54