Loading...
Searching...
No Matches
zeroGradientFvPatchField.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-2017 OpenFOAM Foundation
9 Copyright (C) 2025 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::zeroGradientFvPatchField
29
30Group
31 grpGenericBoundaryConditions
32
33Description
34 This boundary condition applies a zero-gradient condition from the patch
35 internal field onto the patch faces.
36
37Usage
38 Example of the boundary condition specification:
39 \verbatim
40 <patchName>
41 {
42 type zeroGradient;
43 }
44 \endverbatim
45
46SourceFiles
47 zeroGradientFvPatchField.C
48
49\*---------------------------------------------------------------------------*/
50
51#ifndef Foam_zeroGradientFvPatchField_H
52#define Foam_zeroGradientFvPatchField_H
53
54#include "fvPatchField.H"
55
56// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57
58namespace Foam
59{
60
61/*---------------------------------------------------------------------------*\
62 Class zeroGradientFvPatchField Declaration
63\*---------------------------------------------------------------------------*/
64
65template<class Type>
67:
68 public fvPatchField<Type>
69{
70public:
71
72 //- Runtime type information
73 TypeName("zeroGradient"); // fieldTypes::zeroGradientTypeName_()
74
75
76 // Constructors
77
78 //- Construct from patch and internal field
80 (
81 const fvPatch&,
83 );
84
85 //- Construct from patch, internal field and dictionary
87 (
88 const fvPatch&,
90 const dictionary&
91 );
92
93 //- Construct by mapping the given zeroGradient patch field
94 //- onto a new patch
96 (
98 const fvPatch&,
100 const fvPatchFieldMapper&
101 );
102
103 //- Construct as copy
105 (
107 );
108
109 //- Construct as copy setting internal field reference
111 (
114 );
115
116 //- Return a clone
118 {
119 return fvPatchField<Type>::Clone(*this);
120 }
121
122 //- Clone with an internal field reference
124 (
126 ) const
127 {
128 return fvPatchField<Type>::Clone(*this, iF);
129 }
130
131
132 // Member Functions
133
134 // Evaluation Functions
135
136 //- Return patch-normal gradient
137 virtual tmp<Field<Type>> snGrad() const
138 {
139 // zero-gradient
140 return tmp<Field<Type>>::New(this->size(), Foam::zero{});
141 }
142
143 //- Retrieve patch-normal gradient [contiguous storage]
144 virtual void snGrad(UList<Type>& result) const
145 {
146 // zero-gradient
147 result = Foam::zero{};
148 }
149
150 //- Evaluate the patch field
151 virtual void evaluate
152 (
153 const Pstream::commsTypes commsType =
155 );
156
157 //- Return the matrix diagonal coefficients corresponding to the
158 //- evaluation of the value of this patchField with given weights
160 (
161 const tmp<scalarField>&
162 ) const;
163
164 //- Return the matrix source coefficients corresponding to the
165 //- evaluation of the value of this patchField with given weights
167 (
168 const tmp<scalarField>&
169 ) const;
170
171 //- Return the matrix diagonal coefficients corresponding to the
172 //- evaluation of the gradient of this patchField
174
175 //- Return the matrix source coefficients corresponding to the
176 //- evaluation of the gradient of this patchField
178};
179
180
181// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182
183} // End namespace Foam
184
185// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186
187#ifdef NoRepository
189#endif
190
191// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192
193#endif
194
195// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition UList.H:89
void size(const label n)
Definition UList.H:118
commsTypes
Communications types.
Definition UPstream.H:81
@ buffered
"buffered" : (MPI_Bsend, MPI_Recv)
Definition UPstream.H:82
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
A FieldMapper for finite-volume patch fields.
static tmp< fvPatchField< Type > > New(const word &patchFieldType, const fvPatch &, const DimensionedField< Type, volMesh > &)
Return a pointer to a new patchField created on freestore given.
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
fvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition fvPatch.H:71
A class for managing temporary objects.
Definition tmp.H:75
virtual tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the evaluation of the gradient of this patch...
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the evaluation of the value of this patchFie...
zeroGradientFvPatchField(const zeroGradientFvPatchField< Type > &, const DimensionedField< Type, volMesh > &)
Construct as copy setting internal field reference.
TypeName("zeroGradient")
Runtime type information.
virtual tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the evaluation of the gradient of this patchFi...
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 evaluation of the value of this patchField...
zeroGradientFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
virtual void snGrad(UList< Type > &result) const
Retrieve patch-normal gradient [contiguous storage].
virtual tmp< fvPatchField< Type > > clone() const
Return a clone.
zeroGradientFvPatchField(const zeroGradientFvPatchField< Type > &)
Construct as copy.
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::buffered)
Evaluate the patch field.
virtual tmp< fvPatchField< Type > > clone(const DimensionedField< Type, volMesh > &iF) const
Clone with an internal field reference.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition zero.H:58
Namespace for OpenFOAM.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68