internalFvPatchField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2021 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::internalFvPatchField
26 
27 Description
28  Constraint fvPatchField to hold values for internal face exposed by
29  sub-setting.
30 
31 Usage
32  Example of the boundary condition specification:
33  \verbatim
34  <patchName>
35  {
36  type internal;
37  }
38  \endverbatim
39 
40 SourceFiles
41  internalFvPatchField.C
42 
43 \*---------------------------------------------------------------------------*/
44 
45 #ifndef internalFvPatchField_H
46 #define internalFvPatchField_H
47 
48 #include "fvPatchField.H"
49 #include "internalFvPatch.H"
50 
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 
53 namespace Foam
54 {
55 
56 /*---------------------------------------------------------------------------*\
57  Class internalFvPatchField Declaration
58 \*---------------------------------------------------------------------------*/
59 
60 template<class Type>
62 :
63  public fvPatchField<Type>
64 {
65 
66 public:
67 
68  //- Runtime type information
69  TypeName(internalFvPatch::typeName_());
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
83  (
84  const fvPatch&,
86  const dictionary&
87  );
88 
89  //- Construct by mapping given internalFvPatchField onto a new patch
91  (
93  const fvPatch&,
95  const fvPatchFieldMapper&
96  );
97 
98  //- Disallow copy without setting internal field reference
100 
101  //- Copy constructor setting internal field reference
103  (
106  );
107 
108  //- Construct and return a clone setting internal field reference
110  (
112  ) const
113  {
114  return tmp<fvPatchField<Type>>
115  (
116  new internalFvPatchField<Type>(*this, iF)
117  );
118  }
119 
120 
121  // Member Functions
122 
123  // Evaluation functions
124 
125  //- Return gradient at boundary
126  virtual tmp<Field<Type>> snGrad() const
127  {
128  return tmp<Field<Type>>
129  (
130  new Field<Type>(this->size(), Zero)
131  );
132  }
133 
134  //- Evaluate the patch field
135  virtual void evaluate
136  (
137  const Pstream::commsTypes commsType =
139  );
140 
141  //- Return the matrix diagonal coefficients corresponding to the
142  // evaluation of the value of this patchField with given weights
144  (
145  const tmp<scalarField>&
146  ) const;
147 
148  //- Return the matrix source coefficients corresponding to the
149  // evaluation of the value of this patchField with given weights
151  (
152  const tmp<scalarField>&
153  ) const;
154 
155  //- Return the matrix diagonal coefficients corresponding to the
156  // evaluation of the gradient of this patchField
157  virtual tmp<Field<Type>> gradientInternalCoeffs() const;
158 
159  //- Return the matrix source coefficients corresponding to the
160  // evaluation of the gradient of this patchField
161  virtual tmp<Field<Type>> gradientBoundaryCoeffs() const;
162 };
163 
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 } // End namespace Foam
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 #ifdef NoRepository
172  #include "internalFvPatchField.C"
173 #endif
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 #endif
178 
179 // ************************************************************************* //
virtual tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
TypeName(internalFvPatch::typeName_())
Runtime type information.
commsTypes
Types of communications.
Definition: UPstream.H:64
internalFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:62
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:66
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the.
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
Evaluate the patch field.
Pre-declare SubField and related Field type.
Definition: Field.H:56
Foam::fvPatchFieldMapper.
static const zero Zero
Definition: zero.H:97
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the.
virtual tmp< Field< Type > > snGrad() const
Return gradient at boundary.
virtual tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A class for managing temporary objects.
Definition: PtrList.H:53
label size() const
Return the number of elements in the UList.
Definition: ListI.H:171
tmp< fvPatchField< Type > > clone() const
Disallow clone without setting internal field reference.
Definition: fvPatchField.H:199
Namespace for OpenFOAM.
Constraint fvPatchField to hold values for internal face exposed by sub-setting.