coupledFvPatchField.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::coupledFvPatchField
29
30Group
31 grpCoupledBoundaryConditions
32
33Description
34 Abstract base class for coupled patches.
35
36SourceFiles
37 coupledFvPatchField.C
38
39\*---------------------------------------------------------------------------*/
40
41#ifndef coupledFvPatchField_H
42#define coupledFvPatchField_H
43
44#include "LduInterfaceField.H"
45#include "fvPatchField.H"
46#include "coupledFvPatch.H"
47
48// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49
50namespace Foam
51{
52
53/*---------------------------------------------------------------------------*\
54 Class coupledFvPatch Declaration
55\*---------------------------------------------------------------------------*/
56
57template<class Type>
59:
60 public LduInterfaceField<Type>,
61 public fvPatchField<Type>
62{
63
64public:
65
66 //- Runtime type information
67 TypeName(coupledFvPatch::typeName_());
68
69
70 // Constructors
71
72 //- Construct from patch and internal field
74 (
75 const fvPatch&,
77 );
78
79 //- Construct from patch and internal field and patch field
81 (
82 const fvPatch&,
84 const Field<Type>&
85 );
86
87 //- Construct from patch, internal field and dictionary
89 (
90 const fvPatch&,
92 const dictionary&,
93 const bool valueRequired=true
94 );
95
96 //- Construct by mapping the given coupledFvPatchField onto a new patch
98 (
100 const fvPatch&,
102 const fvPatchFieldMapper&
103 );
104
105 //- Construct as copy
107 (
109 );
110
111 //- Construct and return a clone
112 virtual tmp<fvPatchField<Type>> clone() const = 0;
113
114 //- Construct as copy setting internal field reference
116 (
119 );
120
121 //- Construct and return a clone
123 (
125 ) const = 0;
126
127
128 // Member functions
129
130 // Access
131
132 //- Return true if this patch field is derived from
133 // coupledFvPatchField<Type>.
134 virtual bool coupled() const
135 {
136 return true;
137 }
138
139 //- Return neighbour field of internal field
140 virtual tmp<Field<Type>> patchNeighbourField() const = 0;
141
142
143 // Evaluation functions
144
145 //- Return patch-normal gradient
146 virtual tmp<Field<Type>> snGrad
147 (
148 const scalarField& deltaCoeffs
149 ) const;
150
151 //- Return patch-normal gradient
152 virtual tmp<Field<Type>> snGrad() const
153 {
155 return *this;
156 }
157
158 //- Initialise the evaluation of the patch field
159 virtual void initEvaluate
160 (
161 const Pstream::commsTypes commsType
162 );
163
164 //- Evaluate the patch field
165 virtual void evaluate
166 (
167 const Pstream::commsTypes commsType
168 );
169
170 //- Return the matrix diagonal coefficients corresponding to the
171 // evaluation of the value of this patchField with given weights
173 (
174 const tmp<scalarField>&
175 ) const;
176
177 //- Return the matrix source coefficients corresponding to the
178 // evaluation of the value of this patchField with given weights
180 (
181 const tmp<scalarField>&
182 ) const;
183
184 //- Return the matrix diagonal coefficients corresponding to the
185 // evaluation of the gradient of this patchField
187 (
188 const scalarField& deltaCoeffs
189 ) const;
190
191 //- Return the matrix diagonal coefficients corresponding to the
192 // evaluation of the gradient of this patchField
194
195 //- Return the matrix source coefficients corresponding to the
196 // evaluation of the gradient of this patchField
198 (
199 const scalarField& deltaCoeffs
200 ) const;
201
202 //- Return the matrix source coefficients corresponding to the
203 // evaluation of the gradient of this patchField
205
206
207 // Coupled interface functionality
208
209 //- Update result field based on interface functionality
210 virtual void updateInterfaceMatrix
211 (
212 solveScalarField& result,
213 const bool add,
214 const lduAddressing& lduAddr,
215 const label patchId,
216 const solveScalarField& psiInternal,
217 const scalarField& coeffs,
218 const direction,
219 const Pstream::commsTypes commsType
220 ) const = 0;
221
222 //- Update result field based on interface functionality
223 virtual void updateInterfaceMatrix
224 (
226 const bool add,
227 const lduAddressing& lduAddr,
228 const label patchId,
229 const Field<Type>&,
230 const scalarField&,
231 const Pstream::commsTypes commsType
232 ) const = 0;
233
234
235 //- Write
236 virtual void write(Ostream&) const;
237};
238
239
240// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
241
242} // End namespace Foam
243
244// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
245
246#ifdef NoRepository
247 #include "coupledFvPatchField.C"
248#endif
249
250// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
251
252#endif
253
254// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic templated field type.
Definition: Field.H:82
An abstract base class for implicitly-coupled interface fields e.g. processor and cyclic patch fields...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
commsTypes
Types of communications.
Definition: UPstream.H:67
Abstract base class for coupled patches.
virtual void updateInterfaceMatrix(solveScalarField &result, const bool add, const lduAddressing &lduAddr, const label patchId, const solveScalarField &psiInternal, const scalarField &coeffs, const direction, const Pstream::commsTypes commsType) const =0
Update result field based on interface functionality.
virtual void updateInterfaceMatrix(Field< Type > &, const bool add, const lduAddressing &lduAddr, const label patchId, const Field< Type > &, const scalarField &, const Pstream::commsTypes commsType) const =0
Update result field based on interface functionality.
virtual tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the.
virtual bool coupled() const
Return true if this patch field is derived from.
TypeName(coupledFvPatch::typeName_())
Runtime type information.
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the.
virtual tmp< fvPatchField< Type > > clone(const DimensionedField< Type, volMesh > &) const =0
Construct and return a clone.
virtual void initEvaluate(const Pstream::commsTypes commsType)
Initialise the evaluation of the patch field.
virtual tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the.
virtual tmp< Field< Type > > snGrad() const
Return patch-normal gradient.
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the.
virtual void evaluate(const Pstream::commsTypes commsType)
Evaluate the patch field.
virtual tmp< fvPatchField< Type > > clone() const =0
Construct and return a clone.
virtual tmp< Field< Type > > patchNeighbourField() const =0
Return neighbour field of internal field.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A FieldMapper for finite-volume patch fields.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:82
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 class for managing temporary objects.
Definition: tmp.H:65
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:517
label patchId(-1)
Namespace for OpenFOAM.
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
uint8_t direction
Definition: direction.H:56
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73