jumpCyclicFvPatchField.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) 2018-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::jumpCyclicFvPatchField
29 
30 Group
31  grpCoupledBoundaryConditions
32 
33 Description
34  This boundary condition provides a base class for coupled-cyclic
35  conditions with a specified 'jump' (or offset) between the values
36 
37  The "value" entry is NO_READ.
38 
39 See also
40  Foam::cyclicFvPatchField
41 
42 SourceFiles
43  jumpCyclicFvPatchField.C
44 
45 \*---------------------------------------------------------------------------*/
46 
47 #ifndef Foam_jumpCyclicFvPatchField_H
48 #define Foam_jumpCyclicFvPatchField_H
49 
50 #include "cyclicFvPatchField.H"
51 
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 
54 namespace Foam
55 {
56 
57 /*---------------------------------------------------------------------------*\
58  Class jumpCyclicFvPatchField Declaration
59 \*---------------------------------------------------------------------------*/
60 
61 template<class Type>
63 :
64  public cyclicFvPatchField<Type>
65 {
66 public:
67 
68  //- Runtime type information
69  TypeName("jumpCyclic");
70 
71 
72  // Constructors
73 
74  //- Construct from patch and internal field
76  (
77  const fvPatch&,
79  );
80 
81  //- Construct from patch, internal field and dictionary.
82  //- The "value" entry is NO_READ.
84  (
85  const fvPatch&,
87  const dictionary&,
88  const bool needValue = true
89  );
90 
91  //- Construct by mapping given jumpCyclicFvPatchField onto a new patch
93  (
95  const fvPatch&,
97  const fvPatchFieldMapper&
98  );
99 
100  //- Construct as copy
102  (
104  );
105 
106  //- Construct as copy setting internal field reference
108  (
111  );
112 
113 
114  // Member functions
115 
116  // Access
117 
118  //- Return the interface type
119  virtual const word& interfaceFieldType() const
120  {
122  }
123 
124  //- Return the "jump" across the patch as a "half" field
125  virtual tmp<Field<Type>> jump() const = 0;
126 
127 
128  // Evaluation functions
129 
130  //- Return neighbour coupled values
131  virtual tmp<Field<Type>> patchNeighbourField() const;
132 
133  //- Retrieve neighbour coupled values
134  virtual void patchNeighbourField(UList<Type>& pnf) const;
135 
136  //- Update result field based on interface functionality
137  virtual void updateInterfaceMatrix
138  (
139  solveScalarField& result,
140  const bool add,
141  const lduAddressing& lduAddr,
142  const label patchId,
143  const solveScalarField& psiInternal,
144  const scalarField& coeffs,
145  const direction cmpt,
146  const Pstream::commsTypes commsType
147  ) const;
148 
149  //- Update result field based on interface functionality
150  virtual void updateInterfaceMatrix
151  (
152  Field<Type>&,
153  const bool add,
154  const lduAddressing& lduAddr,
155  const label patchId,
156  const Field<Type>&,
157  const scalarField&,
158  const Pstream::commsTypes commsType
159  ) const;
160 };
161 
162 //- Update result field based on interface functionality
163 template<>
165 (
166  solveScalarField& result,
167  const bool add,
168  const lduAddressing& lduAddr,
169  const label patchId,
170  const solveScalarField& psiInternal,
171  const scalarField& coeffs,
172  const direction cmpt,
173  const Pstream::commsTypes commsType
174 ) const;
175 
176 
177 template<>
179 (
180  solveScalarField& result,
181  const bool add,
182  const lduAddressing& lduAddr,
183  const label patchId,
184  const solveScalarField& psiInternal,
185  const scalarField& coeffs,
186  const direction cmpt,
187  const Pstream::commsTypes commsType
188 ) const;
189 
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 } // End namespace Foam
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 #ifdef NoRepository
198  #include "jumpCyclicFvPatchField.C"
199 #endif
200 
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 
203 #endif
204 
205 // ************************************************************************* //
label patchId(-1)
type
Types of root.
Definition: Roots.H:52
uint8_t direction
Definition: direction.H:46
commsTypes
Communications types.
Definition: UPstream.H:77
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
virtual const word & interfaceFieldType() const
Return the interface type.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
jumpCyclicFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
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.
A class for handling words, derived from Foam::string.
Definition: word.H:63
A FieldMapper for finite-volume patch fields.
This boundary condition provides a base class for coupled-cyclic conditions with a specified &#39;jump&#39; (...
This boundary condition enforces a cyclic condition between a pair of boundaries. ...
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
TypeName("jumpCyclic")
Runtime type information.
virtual tmp< Field< Type > > jump() const =0
Return the "jump" across the patch as a "half" field.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
The class contains the addressing required by the lduMatrix: upper, lower and losort.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
virtual tmp< Field< Type > > patchNeighbourField() const
Return neighbour coupled values.
Namespace for OpenFOAM.