jumpCyclicAMIFvPatchField.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) 2012-2016 OpenFOAM Foundation
9  Copyright (C) 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::jumpCyclicAMIFvPatchField
29 
30 Group
31  grpCoupledBoundaryConditions
32 
33 Description
34  This boundary condition provides a base class that enforces a cyclic
35  condition with a specified 'jump' (or offset) between a pair of boundaries,
36  whereby communication between the patches is performed using an arbitrary
37  mesh interface (AMI) interpolation.
38 
39 See also
40  Foam::cyclicAMIFvPatchField
41 
42 SourceFiles
43  jumpCyclicAMIFvPatchField.C
44 
45 \*---------------------------------------------------------------------------*/
46 
47 #ifndef jumpCyclicAMIFvPatchField_H
48 #define jumpCyclicAMIFvPatchField_H
49 
50 #include "cyclicAMIFvPatchField.H"
51 
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 
54 namespace Foam
55 {
56 
57 /*---------------------------------------------------------------------------*\
58  Class jumpCyclicAMIFvPatchField Declaration
59 \*---------------------------------------------------------------------------*/
60 
61 template<class Type>
63 :
64  public cyclicAMIFvPatchField<Type>
65 {
66 
67 public:
68 
69  //- Runtime type information
70  TypeName("jumpCyclicAMI");
71 
72 
73  // Constructors
74 
75  //- Construct from patch and internal field
77  (
78  const fvPatch&,
80  );
81 
82  //- Construct from patch, internal field and dictionary
84  (
85  const fvPatch&,
87  const dictionary&
88  );
89 
90  //- Construct by mapping given jumpCyclicAMIFvPatchField onto a
91  // 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 given internal cell data
132 
133  //- Update result field based on interface functionality
134  virtual void updateInterfaceMatrix
135  (
136  solveScalarField& result,
137  const bool add,
138  const lduAddressing& lduAddr,
139  const label patchId,
140  const solveScalarField& psiInternal,
141  const scalarField& coeffs,
142  const direction cmpt,
143  const Pstream::commsTypes commsType
144  ) const;
145 
146  //- Update result field based on interface functionality
147  virtual void updateInterfaceMatrix
148  (
149  Field<Type>&,
150  const bool add,
151  const lduAddressing& lduAddr,
152  const label patchId,
153  const Field<Type>&,
154  const scalarField&,
155  const Pstream::commsTypes commsType
156  ) const;
157 };
158 
159 
160 //- Update result field based on interface functionality
161 template<>
163 (
164  solveScalarField& result,
165  const bool add,
166  const lduAddressing& lduAddr,
167  const label patchId,
168  const solveScalarField& psiInternal,
169  const scalarField& coeffs,
170  const direction cmpt,
171  const Pstream::commsTypes commsType
172 ) const;
173 
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 } // End namespace Foam
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 #ifdef NoRepository
182  #include "jumpCyclicAMIFvPatchField.C"
183 #endif
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 #endif
188 
189 // ************************************************************************* //
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::jumpCyclicAMIFvPatchField::jumpCyclicAMIFvPatchField
jumpCyclicAMIFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Definition: jumpCyclicAMIFvPatchField.C:36
cyclicAMIFvPatchField.H
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::jumpCyclicAMIFvPatchField
This boundary condition provides a base class that enforces a cyclic condition with a specified 'jump...
Definition: jumpCyclicAMIFvPatchField.H:61
Foam::cyclicAMIFvPatchField
This boundary condition enforces a cyclic condition between a pair of boundaries, whereby communicati...
Definition: cyclicAMIFvPatchField.H:77
jumpCyclicAMIFvPatchField.C
Foam::Field< solveScalar >
Foam::jumpCyclicAMIFvPatchField::patchNeighbourField
tmp< Field< Type > > patchNeighbourField() const
Return neighbour coupled given internal cell data.
Definition: jumpCyclicAMIFvPatchField.C:98
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::solveScalarField
Field< solveScalar > solveScalarField
Definition: primitiveFieldsFwd.H:53
Foam::jumpCyclicAMIFvPatchField::TypeName
TypeName("jumpCyclicAMI")
Runtime type information.
Foam::jumpCyclicAMIFvPatchField::jump
virtual tmp< Field< Type > > jump() const =0
Return the "jump" across the patch as a "half" field.
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::direction
uint8_t direction
Definition: direction.H:52
Foam::roots::type
type
Types of root.
Definition: Roots.H:54
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
patchId
label patchId(-1)
Foam::jumpCyclicAMIFvPatchField::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: jumpCyclicAMIFvPatchField.C:138
Foam::jumpCyclicAMIFvPatchField::interfaceFieldType
virtual const word & interfaceFieldType() const
Return the interface type.
Definition: jumpCyclicAMIFvPatchField.H:118
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54