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