fixedNormalSlipFvPatchField.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) 2021 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::fixedNormalSlipFvPatchField
29
30Group
31 grpGenericBoundaryConditions grpWallBoundaryConditions
32
33Description
34 This boundary condition sets the patch-normal component to the field (vector
35 or tensor) to the patch-normal component of a user specified field.
36 The tangential component is treated as slip, i.e. copied from the internal
37 field.
38
39Usage
40 Example of the boundary condition specification:
41 \verbatim
42 <patchName>
43 {
44 // Mandatory entries (unmodifiable)
45 type fixedNormalSlip;
46 fixedValue uniform (1 0 0); // example entry for a vector field
47
48 // Optional entries
49 writeValue false;
50
51 // Mandatory/Optional (inherited) entries
52 ...
53 }
54 \endverbatim
55
56 where the entries mean:
57 \table
58 Property | Description | Type | Reqd | Deflt
59 type | Type name: fixedNormalSlip | word | yes | -
60 fixedValue | User-defined value the normal component of which <!--
61 --> the boundary is set to <!--
62 --> | vectorField/tensorField | yes | -
63 writeValue | Output patch values (eg, ParaView) | bool | no | false
64 \endtable
65
66 The inherited entries are elaborated in:
67 - \link transformFvPatchField.H \endlink
68 - \link fvPatchField.H \endlink
69
70See also
71 Foam::transformFvPatchField
72
73SourceFiles
74 fixedNormalSlipFvPatchField.C
75 fixedNormalSlipFvPatchFields.C
76
77\*---------------------------------------------------------------------------*/
78
79#ifndef fixedNormalSlipFvPatchField_H
80#define fixedNormalSlipFvPatchField_H
81
83
84// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
85
86namespace Foam
87{
88
89/*---------------------------------------------------------------------------*\
90 Class fixedNormalSlipFvPatchField Declaration
91\*---------------------------------------------------------------------------*/
92
93template<class Type>
94class fixedNormalSlipFvPatchField
95:
96 public transformFvPatchField<Type>
97{
98 //- The parent boundary condition type
99 typedef transformFvPatchField<Type> parent_bctype;
100
101
102 // Private Data
103
104 //- Value the normal component of which the boundary is set to
105 Field<Type> fixedValue_;
106
107 //- Flag to output patch values (e.g. for ParaView)
108 bool writeValue_;
109
110
111public:
112
113 //- Runtime type information
114 TypeName("fixedNormalSlip");
115
116
117 // Constructors
118
119 //- Construct from patch and internal field
122 const fvPatch&,
124 );
125
126 //- Construct from patch, internal field and dictionary
128 (
129 const fvPatch&,
131 const dictionary&
132 );
133
134 //- Construct by mapping given fixedNormalSlipFvPatchField
135 //- onto a new patch
137 (
139 const fvPatch&,
142 );
143
144 //- Construct as copy
146 (
148 );
149
150 //- Construct and return a clone
151 virtual tmp<fvPatchField<Type>> clone() const
152 {
154 (
156 );
157 }
158
159 //- Construct as copy setting internal field reference
161 (
164 );
165
166 //- Construct and return a clone setting internal field reference
168 (
170 ) const
171 {
173 (
175 );
176 }
177
179 // Member Functions
180
181 // Access
182
183 //- This patch field is not altered by assignment
184 virtual bool assignable() const
185 {
186 return false;
187 }
188
189 //- User-defined input field (modifiable field)
190 virtual Field<Type>& fixedValue()
191 {
192 return fixedValue_;
193 }
195 //- User-defined input field (const field)
196 virtual const Field<Type>& fixedValue() const
197 {
198 return fixedValue_;
199 }
200
201
202 // Mapping
203
204 //- Map (and resize as needed) from self given a mapping object
205 virtual void autoMap
206 (
207 const fvPatchFieldMapper& m
208 );
209
210 //- Reverse map the given fvPatchField onto this fvPatchField
211 virtual void rmap
212 (
213 const fvPatchField<Type>& ptf,
214 const labelList& addr
215 );
216
218 // Evaluation
219
220 //- Return gradient at boundary
221 virtual tmp<Field<Type>> snGrad() const;
222
223 //- Evaluate the patch field
224 virtual void evaluate
225 (
226 const Pstream::commsTypes commsType =
228 );
229
230 //- Return face-gradient transform diagonal
231 virtual tmp<Field<Type>> snGradTransformDiag() const;
232
233
234 //- Write
235 virtual void write(Ostream&) const;
236
237
238 // Member Operators
239
240 virtual void operator=(const UList<Type>&) {}
241
242 virtual void operator=(const fvPatchField<Type>&) {}
243 virtual void operator+=(const fvPatchField<Type>&) {}
244 virtual void operator-=(const fvPatchField<Type>&) {}
245 virtual void operator*=(const fvPatchField<scalar>&) {}
246 virtual void operator/=(const fvPatchField<scalar>&) {}
247
248 virtual void operator+=(const Field<Type>&) {}
249 virtual void operator-=(const Field<Type>&) {}
250
251 virtual void operator*=(const Field<scalar>&) {}
252 virtual void operator/=(const Field<scalar>&) {}
253
254 virtual void operator=(const Type&) {}
255 virtual void operator+=(const Type&) {}
256 virtual void operator-=(const Type&) {}
257 virtual void operator*=(const scalar) {}
258 virtual void operator/=(const scalar) {}
259};
260
261
262// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
263
264} // End namespace Foam
265
266// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
268#ifdef NoRepository
270#endif
272// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
274#endif
276// ************************************************************************* //
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 Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
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:94
commsTypes
Types of communications.
Definition: UPstream.H:67
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
This boundary condition sets the patch-normal component to the field (vector or tensor) to the patch-...
virtual void operator/=(const Field< scalar > &)
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
Evaluate the patch field.
virtual const Field< Type > & fixedValue() const
User-defined input field (const field)
fixedNormalSlipFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
virtual void operator+=(const Field< Type > &)
virtual void operator*=(const Field< scalar > &)
virtual void operator+=(const fvPatchField< Type > &)
virtual tmp< Field< Type > > snGrad() const
Return gradient at boundary.
virtual void operator/=(const fvPatchField< scalar > &)
virtual void rmap(const fvPatchField< Type > &ptf, const labelList &addr)
Reverse map the given fvPatchField onto this fvPatchField.
virtual void operator=(const fvPatchField< Type > &)
virtual void autoMap(const fvPatchFieldMapper &m)
Map (and resize as needed) from self given a mapping object.
virtual void operator*=(const fvPatchField< scalar > &)
virtual void operator-=(const fvPatchField< Type > &)
virtual void operator=(const UList< Type > &)
virtual Field< Type > & fixedValue()
User-defined input field (modifiable field)
TypeName("fixedNormalSlip")
Runtime type information.
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
virtual bool assignable() const
This patch field is not altered by assignment.
virtual tmp< Field< Type > > snGradTransformDiag() const
Return face-gradient transform diagonal.
virtual void operator-=(const Field< Type > &)
virtual tmp< fvPatchField< Type > > clone(const DimensionedField< Type, volMesh > &iF) const
Construct and return a clone setting internal field reference.
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
A class for managing temporary objects.
Definition: tmp.H:65
Foam::transformFvPatchField.
Namespace for OpenFOAM.
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73