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 -------------------------------------------------------------------------------
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::fixedNormalSlipFvPatchField
29 
30 Group
31  grpGenericBoundaryConditions grpWallBoundaryConditions
32 
33 Description
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 
39 Usage
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 
70 See also
71  Foam::transformFvPatchField
72 
73 SourceFiles
74  fixedNormalSlipFvPatchField.C
75  fixedNormalSlipFvPatchFields.C
76 
77 \*---------------------------------------------------------------------------*/
78 
79 #ifndef fixedNormalSlipFvPatchField_H
80 #define fixedNormalSlipFvPatchField_H
81 
82 #include "transformFvPatchField.H"
83 
84 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
85 
86 namespace Foam
87 {
88 
89 /*---------------------------------------------------------------------------*\
90  Class fixedNormalSlipFvPatchField Declaration
91 \*---------------------------------------------------------------------------*/
92 
93 template<class Type>
94 class 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 
111 public:
112 
113  //- Runtime type information
114  TypeName("fixedNormalSlip");
115 
116 
117  // Constructors
118 
119  //- Construct from patch and internal field
121  (
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&,
141  const fvPatchFieldMapper&
142  );
143 
144  //- Construct as copy
146  (
148  );
149 
150  //- Construct and return a clone
151  virtual tmp<fvPatchField<Type>> clone() const
152  {
153  return tmp<fvPatchField<Type>>
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  {
172  return tmp<fvPatchField<Type>>
173  (
174  new fixedNormalSlipFvPatchField<Type>(*this, iF)
175  );
176  }
177 
178 
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  }
194 
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 
217 
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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
267 
268 #ifdef NoRepository
270 #endif
271 
272 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
273 
274 #endif
275 
276 // ************************************************************************* //
Foam::fvPatchField
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: volSurfaceMapping.H:51
Foam::fixedNormalSlipFvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: fixedNormalSlipFvPatchField.C:186
Foam::fixedNormalSlipFvPatchField::operator*=
virtual void operator*=(const scalar)
Definition: fixedNormalSlipFvPatchField.H:284
Foam::fixedNormalSlipFvPatchField::TypeName
TypeName("fixedNormalSlip")
Runtime type information.
Foam::fixedNormalSlipFvPatchField::fixedValue
virtual const Field< Type > & fixedValue() const
User-defined input field (const field)
Definition: fixedNormalSlipFvPatchField.H:223
Foam::fixedNormalSlipFvPatchField::operator-=
virtual void operator-=(const Type &)
Definition: fixedNormalSlipFvPatchField.H:283
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::fixedNormalSlipFvPatchField::autoMap
virtual void autoMap(const fvPatchFieldMapper &m)
Map (and resize as needed) from self given a mapping object.
Definition: fixedNormalSlipFvPatchField.C:108
Foam::fixedNormalSlipFvPatchField::evaluate
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
Evaluate the patch field.
Definition: fixedNormalSlipFvPatchField.C:149
Foam::fixedNormalSlipFvPatchField::operator/=
virtual void operator/=(const scalar)
Definition: fixedNormalSlipFvPatchField.H:285
Foam::fixedNormalSlipFvPatchField::operator/=
virtual void operator/=(const Field< scalar > &)
Definition: fixedNormalSlipFvPatchField.H:279
Foam::fixedNormalSlipFvPatchField::operator=
virtual void operator=(const Type &)
Definition: fixedNormalSlipFvPatchField.H:281
fixedNormalSlipFvPatchField.C
Foam::fixedNormalSlipFvPatchField::operator-=
virtual void operator-=(const Field< Type > &)
Definition: fixedNormalSlipFvPatchField.H:276
Foam::fixedNormalSlipFvPatchField::fixedValue
virtual Field< Type > & fixedValue()
User-defined input field (modifiable field)
Definition: fixedNormalSlipFvPatchField.H:217
Foam::Field
Generic templated field type.
Definition: Field.H:63
Foam::fixedNormalSlipFvPatchField::fixedNormalSlipFvPatchField
fixedNormalSlipFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Definition: fixedNormalSlipFvPatchField.C:36
Foam::fixedNormalSlipFvPatchField::operator*=
virtual void operator*=(const Field< scalar > &)
Definition: fixedNormalSlipFvPatchField.H:278
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::fixedNormalSlipFvPatchField::clone
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Definition: fixedNormalSlipFvPatchField.H:178
Foam::fixedNormalSlipFvPatchField::operator*=
virtual void operator*=(const fvPatchField< scalar > &)
Definition: fixedNormalSlipFvPatchField.H:272
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::fixedNormalSlipFvPatchField
This boundary condition sets the patch-normal component to the field (vector or tensor) to the patch-...
Definition: fixedNormalSlipFvPatchField.H:121
Foam::fixedNormalSlipFvPatchField::operator+=
virtual void operator+=(const Type &)
Definition: fixedNormalSlipFvPatchField.H:282
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::fixedNormalSlipFvPatchField::snGradTransformDiag
virtual tmp< Field< Type > > snGradTransformDiag() const
Return face-gradient transform diagonal.
Definition: fixedNormalSlipFvPatchField.C:172
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:69
Foam::fixedNormalSlipFvPatchField::operator=
virtual void operator=(const fvPatchField< Type > &)
Definition: fixedNormalSlipFvPatchField.H:269
Foam::fixedNormalSlipFvPatchField::snGrad
virtual tmp< Field< Type > > snGrad() const
Return gradient at boundary.
Definition: fixedNormalSlipFvPatchField.C:135
transformFvPatchField.H
Foam::List< label >
Foam::UList< Type >
Foam::fixedNormalSlipFvPatchField::operator+=
virtual void operator+=(const fvPatchField< Type > &)
Definition: fixedNormalSlipFvPatchField.H:270
Foam::transformFvPatchField
Foam::transformFvPatchField.
Definition: transformFvPatchField.H:54
Foam::fixedNormalSlipFvPatchField::operator=
virtual void operator=(const UList< Type > &)
Definition: fixedNormalSlipFvPatchField.H:267
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::fixedNormalSlipFvPatchField::operator/=
virtual void operator/=(const fvPatchField< scalar > &)
Definition: fixedNormalSlipFvPatchField.H:273
Foam::fixedNormalSlipFvPatchField::operator+=
virtual void operator+=(const Field< Type > &)
Definition: fixedNormalSlipFvPatchField.H:275
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::fixedNormalSlipFvPatchField::rmap
virtual void rmap(const fvPatchField< Type > &ptf, const labelList &addr)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: fixedNormalSlipFvPatchField.C:119
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54
Foam::fixedNormalSlipFvPatchField::assignable
virtual bool assignable() const
This patch field is not altered by assignment.
Definition: fixedNormalSlipFvPatchField.H:211
Foam::UPstream::commsTypes::blocking
Foam::fixedNormalSlipFvPatchField::operator-=
virtual void operator-=(const fvPatchField< Type > &)
Definition: fixedNormalSlipFvPatchField.H:271