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  );
87 
88  //- Construct by mapping given jumpCyclicFvPatchField onto a new patch
90  (
92  const fvPatch&,
94  const fvPatchFieldMapper&
95  );
96 
97  //- Construct as copy
99  (
101  );
102 
103  //- Construct as copy setting internal field reference
105  (
108  );
109 
110 
111  // Member functions
112 
113  // Access
114 
115  //- Return the interface type
116  virtual const word& interfaceFieldType() const
117  {
119  }
120 
121  //- Return the "jump" across the patch as a "half" field
122  virtual tmp<Field<Type>> jump() const = 0;
123 
124 
125  // Evaluation functions
126 
127  //- Return neighbour coupled given internal cell data
129 
130  //- Update result field based on interface functionality
131  virtual void updateInterfaceMatrix
132  (
133  solveScalarField& result,
134  const bool add,
135  const solveScalarField& psiInternal,
136  const scalarField& coeffs,
137  const direction cmpt,
138  const Pstream::commsTypes commsType
139  ) const;
140 
141  //- Update result field based on interface functionality
142  virtual void updateInterfaceMatrix
143  (
144  Field<Type>&,
145  const bool add,
146  const Field<Type>&,
147  const scalarField&,
148  const Pstream::commsTypes commsType
149  ) const;
150 };
151 
152 //- Update result field based on interface functionality
153 template<>
155 (
156  solveScalarField& result,
157  const bool add,
158  const solveScalarField& psiInternal,
159  const scalarField& coeffs,
160  const direction cmpt,
161  const Pstream::commsTypes commsType
162 ) const;
163 
164 
165 template<>
167 (
168  solveScalarField& result,
169  const bool add,
170  const solveScalarField& psiInternal,
171  const scalarField& coeffs,
172  const direction cmpt,
173  const Pstream::commsTypes commsType
174 ) const;
175 
176 
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 
179 } // End namespace Foam
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 #ifdef NoRepository
184  #include "jumpCyclicFvPatchField.C"
185 #endif
186 
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 
189 #endif
190 
191 // ************************************************************************* //
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:62
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::jumpCyclicFvPatchField::updateInterfaceMatrix
virtual void updateInterfaceMatrix(solveScalarField &result, const bool add, const solveScalarField &psiInternal, const scalarField &coeffs, const direction cmpt, const Pstream::commsTypes commsType) const
Update result field based on interface functionality.
Definition: jumpCyclicFvPatchField.C:136
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:121
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::jumpCyclicFvPatchField::TypeName
TypeName("jumpCyclic")
Runtime type information.
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:69
Foam::jumpCyclicFvPatchField::interfaceFieldType
virtual const word & interfaceFieldType() const
Return the interface type.
Definition: jumpCyclicFvPatchField.H:115
Foam::jumpCyclicFvPatchField::patchNeighbourField
tmp< Field< Type > > patchNeighbourField() const
Return neighbour coupled given internal cell data.
Definition: jumpCyclicFvPatchField.C:97
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
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