partialSlipFvPatchField.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::partialSlipFvPatchField
29 
30 Group
31  grpWallBoundaryConditions grpGenericBoundaryConditions
32 
33 Description
34  This boundary condition provides a partial slip condition. The amount of
35  slip is controlled by a user-supplied field.
36 
37 Usage
38  \table
39  Property | Description | Reqd | Default
40  type | Type name: partialSlip | yes | -
41  refValue | Reference value at zero slip | no | 0
42  valueFraction | Fraction of refValue used for boundary [0-1] | yes |
43  writeValue | Output patch value (eg, ParaView) | no | false
44  \endtable
45 
46  Example of the boundary condition specification:
47  \verbatim
48  <patchName>
49  {
50  type partialSlip;
51  refValue uniform 0.001;
52  valueFraction uniform 0.1;
53  value uniform 0;
54  }
55  \endverbatim
56 
57 See also
58  Foam::transformFvPatchField
59 
60 SourceFiles
61  partialSlipFvPatchField.C
62 
63 \*---------------------------------------------------------------------------*/
64 
65 #ifndef partialSlipFvPatchField_H
66 #define partialSlipFvPatchField_H
67 
68 #include "transformFvPatchField.H"
69 
70 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
71 
72 namespace Foam
73 {
74 
75 /*---------------------------------------------------------------------------*\
76  Class partialSlipFvPatchField Declaration
77 \*---------------------------------------------------------------------------*/
78 
79 template<class Type>
80 class partialSlipFvPatchField
81 :
82  public transformFvPatchField<Type>
83 {
84  //- The parent boundary condition type
85  typedef transformFvPatchField<Type> parent_bctype;
86 
87 
88  // Private Data
89 
90  //- Reference value
91  Field<Type> refValue_;
92 
93  //- Fraction (0-1) of value used for boundary condition
94  scalarField valueFraction_;
95 
96  //- Flag to output patch values (e.g. for ParaView)
97  bool writeValue_;
98 
99 
100 public:
101 
102  //- Runtime type information
103  TypeName("partialSlip");
104 
105 
106  // Constructors
107 
108  //- Construct from patch and internal field
110  (
111  const fvPatch&,
113  );
114 
115  //- Construct from patch, internal field and dictionary
117  (
118  const fvPatch&,
120  const dictionary&
121  );
122 
123  //- Construct by mapping given partialSlipFvPatchField onto a new patch
125  (
127  const fvPatch&,
129  const fvPatchFieldMapper&
130  );
131 
132  //- Construct as copy
134  (
136  );
137 
138  //- Construct and return a clone
139  virtual tmp<fvPatchField<Type>> clone() const
140  {
141  return tmp<fvPatchField<Type>>
142  (
144  );
145  }
146 
147  //- Construct as copy setting internal field reference
149  (
152  );
153 
154  //- Construct and return a clone setting internal field reference
156  (
158  ) const
159  {
160  return tmp<fvPatchField<Type>>
161  (
162  new partialSlipFvPatchField<Type>(*this, iF)
163  );
164  }
165 
166 
167  // Member Functions
168 
169  // Access/attributes
170 
171  //- This patch field is not altered by assignment
172  virtual bool assignable() const
173  {
174  return false;
175  }
176 
177  virtual Field<Type>& refValue()
178  {
179  return refValue_;
180  }
181 
182  virtual const Field<Type>& refValue() const
183  {
184  return refValue_;
185  }
186 
187  virtual scalarField& valueFraction()
188  {
189  return valueFraction_;
190  }
191 
192  virtual const scalarField& valueFraction() const
193  {
194  return valueFraction_;
195  }
196 
197 
198  // Mapping
199 
200  //- Map (and resize as needed) from self given a mapping object
201  virtual void autoMap
202  (
203  const fvPatchFieldMapper&
204  );
205 
206  //- Reverse map the given fvPatchField onto this fvPatchField
207  virtual void rmap
208  (
209  const fvPatchField<Type>&,
210  const labelList&
211  );
212 
213 
214  // Evaluation
215 
216  //- Return gradient at boundary
217  virtual tmp<Field<Type>> snGrad() const;
218 
219  //- Evaluate the patch field
220  virtual void evaluate
221  (
222  const Pstream::commsTypes commsType =
224  );
225 
226  //- Return face-gradient transform diagonal
227  virtual tmp<Field<Type>> snGradTransformDiag() const;
228 
229 
230  //- Write
231  virtual void write(Ostream&) const;
232 
233 
234  // Member Operators
235 
236  virtual void operator=(const UList<Type>&) {}
237 
238  virtual void operator=(const fvPatchField<Type>&) {}
239  virtual void operator+=(const fvPatchField<Type>&) {}
240  virtual void operator-=(const fvPatchField<Type>&) {}
241  virtual void operator*=(const fvPatchField<scalar>&) {}
242  virtual void operator/=(const fvPatchField<scalar>&) {}
243 
244  virtual void operator+=(const Field<Type>&) {}
245  virtual void operator-=(const Field<Type>&) {}
246 
247  virtual void operator*=(const Field<scalar>&) {}
248  virtual void operator/=(const Field<scalar>&) {}
249 
250  virtual void operator=(const Type&) {}
251  virtual void operator+=(const Type&) {}
252  virtual void operator-=(const Type&) {}
253  virtual void operator*=(const scalar) {}
254  virtual void operator/=(const scalar) {}
255 };
256 
257 
258 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
259 
260 } // End namespace Foam
261 
262 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
263 
264 #ifdef NoRepository
266 #endif
267 
268 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
269 
270 #endif
271 
272 // ************************************************************************* //
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::scalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Definition: primitiveFieldsFwd.H:52
Foam::partialSlipFvPatchField::valueFraction
virtual const scalarField & valueFraction() const
Definition: partialSlipFvPatchField.H:216
Foam::partialSlipFvPatchField::operator=
virtual void operator=(const Type &)
Definition: partialSlipFvPatchField.H:274
Foam::partialSlipFvPatchField::operator-=
virtual void operator-=(const Type &)
Definition: partialSlipFvPatchField.H:276
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::partialSlipFvPatchField::operator*=
virtual void operator*=(const scalar)
Definition: partialSlipFvPatchField.H:277
Foam::partialSlipFvPatchField::operator-=
virtual void operator-=(const fvPatchField< Type > &)
Definition: partialSlipFvPatchField.H:264
Foam::partialSlipFvPatchField::partialSlipFvPatchField
partialSlipFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Definition: partialSlipFvPatchField.C:36
Foam::partialSlipFvPatchField::operator/=
virtual void operator/=(const fvPatchField< scalar > &)
Definition: partialSlipFvPatchField.H:266
Foam::partialSlipFvPatchField::refValue
virtual Field< Type > & refValue()
Definition: partialSlipFvPatchField.H:201
Foam::partialSlipFvPatchField::operator-=
virtual void operator-=(const Field< Type > &)
Definition: partialSlipFvPatchField.H:269
Foam::partialSlipFvPatchField::operator=
virtual void operator=(const UList< Type > &)
Definition: partialSlipFvPatchField.H:260
Foam::partialSlipFvPatchField::operator*=
virtual void operator*=(const fvPatchField< scalar > &)
Definition: partialSlipFvPatchField.H:265
Foam::partialSlipFvPatchField::operator+=
virtual void operator+=(const Field< Type > &)
Definition: partialSlipFvPatchField.H:268
Foam::partialSlipFvPatchField::snGradTransformDiag
virtual tmp< Field< Type > > snGradTransformDiag() const
Return face-gradient transform diagonal.
Definition: partialSlipFvPatchField.C:189
Foam::partialSlipFvPatchField::clone
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Definition: partialSlipFvPatchField.H:163
Foam::partialSlipFvPatchField::valueFraction
virtual scalarField & valueFraction()
Definition: partialSlipFvPatchField.H:211
Foam::Field
Generic templated field type.
Definition: Field.H:63
Foam::partialSlipFvPatchField::operator/=
virtual void operator/=(const scalar)
Definition: partialSlipFvPatchField.H:278
Foam::partialSlipFvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: partialSlipFvPatchField.C:206
Foam::partialSlipFvPatchField::snGrad
virtual tmp< Field< Type > > snGrad() const
Return gradient at boundary.
Definition: partialSlipFvPatchField.C:149
Foam::partialSlipFvPatchField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: partialSlipFvPatchField.C:120
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::partialSlipFvPatchField::TypeName
TypeName("partialSlip")
Runtime type information.
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::partialSlipFvPatchField::operator+=
virtual void operator+=(const Type &)
Definition: partialSlipFvPatchField.H:275
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::partialSlipFvPatchField::operator+=
virtual void operator+=(const fvPatchField< Type > &)
Definition: partialSlipFvPatchField.H:263
Foam::partialSlipFvPatchField::evaluate
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
Evaluate the patch field.
Definition: partialSlipFvPatchField.C:164
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:69
partialSlipFvPatchField.C
transformFvPatchField.H
Foam::List< label >
Foam::partialSlipFvPatchField::operator=
virtual void operator=(const fvPatchField< Type > &)
Definition: partialSlipFvPatchField.H:262
Foam::UList< Type >
Foam::partialSlipFvPatchField::operator/=
virtual void operator/=(const Field< scalar > &)
Definition: partialSlipFvPatchField.H:272
Foam::transformFvPatchField
Foam::transformFvPatchField.
Definition: transformFvPatchField.H:54
Foam::partialSlipFvPatchField::rmap
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: partialSlipFvPatchField.C:132
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::partialSlipFvPatchField
This boundary condition provides a partial slip condition. The amount of slip is controlled by a user...
Definition: partialSlipFvPatchField.H:104
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::partialSlipFvPatchField::refValue
virtual const Field< Type > & refValue() const
Definition: partialSlipFvPatchField.H:206
Foam::partialSlipFvPatchField::assignable
virtual bool assignable() const
This patch field is not altered by assignment.
Definition: partialSlipFvPatchField.H:196
Foam::partialSlipFvPatchField::operator*=
virtual void operator*=(const Field< scalar > &)
Definition: partialSlipFvPatchField.H:271
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::UPstream::commsTypes::blocking