Loading...
Searching...
No Matches
cyclicFvPatchField.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-2016 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
27Class
28 Foam::cyclicFvPatchField
29
30Group
31 grpCoupledBoundaryConditions
32
33Description
34 This boundary condition enforces a cyclic condition between a pair of
35 boundaries.
36
37 The "value" entry is NO_READ.
38
39Usage
40 Example of the boundary condition specification:
41 \verbatim
42 <patchName>
43 {
44 type cyclic;
45 }
46 \endverbatim
47
48Note
49 The patches must be topologically similar, i.e. if the owner patch is
50 transformed to the neighbour patch, the patches should be identical (or
51 very similar).
52
53SourceFiles
54 cyclicFvPatchField.C
55
56\*---------------------------------------------------------------------------*/
57
58#ifndef Foam_cyclicFvPatchField_H
59#define Foam_cyclicFvPatchField_H
60
61#include "coupledFvPatchField.H"
63#include "cyclicFvPatch.H"
64
65// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
66
67namespace Foam
68{
69
70/*---------------------------------------------------------------------------*\
71 Class cyclicFvPatch Declaration
72\*---------------------------------------------------------------------------*/
73
74template<class Type>
76:
77 virtual public cyclicLduInterfaceField,
78 public coupledFvPatchField<Type>
79{
80 // Private Data
81
82 //- Local reference cast into the cyclic patch
83 const cyclicFvPatch& cyclicPatch_;
84
85
86public:
87
88
89 //- Runtime type information
90 TypeName(cyclicFvPatch::typeName_());
91
92
93 // Constructors
94
95 //- Construct from patch and internal field
97 (
98 const fvPatch&,
100 );
101
102 //- Construct from patch, internal field and dictionary
104 (
105 const fvPatch&,
107 const dictionary&,
108 const bool needValue = true
109 );
110
111 //- Construct by mapping given cyclicFvPatchField onto a new patch
113 (
115 const fvPatch&,
117 const fvPatchFieldMapper&
118 );
119
120 //- Construct as copy
122 (
124 );
125
126 //- Construct as copy setting internal field reference
128 (
131 );
132
133 //- Return a clone
134 virtual tmp<fvPatchField<Type>> clone() const
135 {
136 return fvPatchField<Type>::Clone(*this);
137 }
138
139 //- Clone with an internal field reference
141 (
143 ) const
144 {
145 return fvPatchField<Type>::Clone(*this, iF);
146 }
147
148
149 // Member Functions
150
151 // Access
152
153 //- Return local reference cast into the cyclic patch
154 const cyclicFvPatch& cyclicPatch() const
155 {
156 return cyclicPatch_;
157 }
158
159
160 // Evaluation functions
161
162 //- Return neighbour coupled internal cell data
163 virtual tmp<Field<Type>> patchNeighbourField() const;
164
165 //- Retrieve neighbour coupled internal cell data
166 virtual void patchNeighbourField(UList<Type>& pnf) const;
167
168 //- Return reference to neighbour patchField
170
171 //- Update result field based on interface functionality
172 virtual void updateInterfaceMatrix
173 (
174 solveScalarField& result,
175 const bool add,
176 const lduAddressing& lduAddr,
177 const label patchId,
178 const solveScalarField& psiInternal,
179 const scalarField& coeffs,
180 const direction cmpt,
181 const Pstream::commsTypes commsType
182 ) const;
183
184 //- Update result field based on interface functionality
185 virtual void updateInterfaceMatrix
186 (
187 Field<Type>& result,
188 const bool add,
189 const lduAddressing& lduAddr,
190 const label patchId,
191 const Field<Type>& psiInternal,
192 const scalarField& coeffs,
193 const Pstream::commsTypes commsType
194 ) const;
195
196
197 //- Manipulate matrix
198 virtual void manipulateMatrix
199 (
201 const label iMatrix,
202 const direction cmp
203 );
204
205
206
207 // Cyclic coupled interface functions
208
209 //- Does the patch field perform the transformation
210 virtual bool doTransform() const
211 {
212 return
213 (
215 && !cyclicPatch_.parallel()
216 );
217 }
218
219 //- Return face transformation tensor
220 virtual const tensorField& forwardT() const
221 {
222 return cyclicPatch_.forwardT();
223 }
224
225 //- Return neighbour-cell transformation tensor
226 virtual const tensorField& reverseT() const
227 {
228 return cyclicPatch_.reverseT();
229 }
230
231 //- Return rank of component for transform
232 virtual int rank() const
233 {
234 return pTraits<Type>::rank;
235 }
236
237
238 // I-O
240 //- Write
241 virtual void write(Ostream& os) const;
242};
243
244
245// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
246
247} // End namespace Foam
248
249// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
250
251#ifdef NoRepository
252 #include "cyclicFvPatchField.C"
253#endif
254
255// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
256
257#endif
258
259// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
Definition Field.H:172
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition UList.H:89
commsTypes
Communications types.
Definition UPstream.H:81
coupledFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
This boundary condition enforces a cyclic condition between a pair of boundaries.
const cyclicFvPatchField< Type > & neighbourPatchField() const
Return reference to neighbour patchField.
virtual bool doTransform() const
Does the patch field perform the transformation.
virtual int rank() const
Return rank of component for transform.
cyclicFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
TypeName(cyclicFvPatch::typeName_())
Runtime type information.
virtual void updateInterfaceMatrix(solveScalarField &result, const bool add, const lduAddressing &lduAddr, const label patchId, const solveScalarField &psiInternal, const scalarField &coeffs, const direction cmpt, const Pstream::commsTypes commsType) const
Update result field based on interface functionality.
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
const cyclicFvPatch & cyclicPatch() const
Return local reference cast into the cyclic patch.
virtual void manipulateMatrix(fvMatrix< Type > &m, const label iMatrix, const direction cmp)
Manipulate matrix.
virtual tmp< fvPatchField< Type > > clone() const
Return a clone.
virtual tmp< Field< Type > > patchNeighbourField() const
Return neighbour coupled internal cell data.
virtual tmp< fvPatchField< Type > > clone(const DimensionedField< Type, volMesh > &iF) const
Clone with an internal field reference.
virtual const tensorField & forwardT() const
Return face transformation tensor.
Cyclic-plane patch.
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
virtual const tensorField & forwardT() const
Return face transformation tensor.
cyclicLduInterfaceField()=default
Construct null.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition fvMatrix.H:118
A FieldMapper for finite-volume patch fields.
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition fvPatch.H:71
The class contains the addressing required by the lduMatrix: upper, lower and losort.
A traits class, which is primarily used for primitives and vector-space.
Definition pTraits.H:64
A class for managing temporary objects.
Definition tmp.H:75
OBJstream os(runTime.globalPath()/outputName)
label patchId(-1)
Namespace for OpenFOAM.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
void add(DimensionedField< scalar, GeoMesh > &result, const dimensioned< scalar > &dt1, const DimensionedField< scalar, GeoMesh > &f2)
Field< solveScalar > solveScalarField
uint8_t direction
Definition direction.H:49
Field< tensor > tensorField
Specialisation of Field<T> for tensor.
constexpr bool is_rotational_vectorspace_v
The is_rotational_vectorspace value of Type.
Definition pTraits.H:251
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68