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 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::partialSlipFvPatchField
28 
29 Group
30  grpWallBoundaryConditions grpGenericBoundaryConditions
31 
32 Description
33  This boundary condition provides a partial slip condition. The amount of
34  slip is controlled by a user-supplied field.
35 
36 Usage
37  \table
38  Property | Description | Required | Default value
39  refValue | Reference value at zero slip | no | 0
40  valueFraction | Fraction of refValue used for boundary [0-1] | yes |
41  \endtable
42 
43  Example of the boundary condition specification:
44  \verbatim
45  <patchName>
46  {
47  type partialSlip;
48  refValue uniform 0.001;
49  valueFraction uniform 0.1;
50  value uniform 0;
51  }
52  \endverbatim
53 
54 See also
55  Foam::transformFvPatchField
56 
57 SourceFiles
58  partialSlipFvPatchField.C
59 
60 \*---------------------------------------------------------------------------*/
61 
62 #ifndef partialSlipFvPatchField_H
63 #define partialSlipFvPatchField_H
64 
65 #include "transformFvPatchField.H"
66 
67 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
68 
69 namespace Foam
70 {
71 
72 /*---------------------------------------------------------------------------*\
73  Class partialSlipFvPatchField Declaration
74 \*---------------------------------------------------------------------------*/
75 
76 template<class Type>
77 class partialSlipFvPatchField
78 :
79  public transformFvPatchField<Type>
80 {
81  // Private data
82 
83  //- Reference value
84  Field<Type> refValue_;
85 
86  //- Fraction (0-1) of value used for boundary condition
87  scalarField valueFraction_;
88 
89 
90 public:
91 
92  //- Runtime type information
93  TypeName("partialSlip");
94 
95 
96  // Constructors
97 
98  //- Construct from patch and internal field
100  (
101  const fvPatch&,
103  );
104 
105  //- Construct from patch, internal field and dictionary
107  (
108  const fvPatch&,
110  const dictionary&
111  );
112 
113  //- Construct by mapping given partialSlipFvPatchField onto a new patch
115  (
117  const fvPatch&,
119  const fvPatchFieldMapper&
120  );
121 
122  //- Construct as copy
124  (
126  );
127 
128  //- Construct and return a clone
129  virtual tmp<fvPatchField<Type>> clone() const
130  {
131  return tmp<fvPatchField<Type>>
132  (
134  );
135  }
136 
137  //- Construct as copy setting internal field reference
139  (
142  );
143 
144  //- Construct and return a clone setting internal field reference
146  (
148  ) const
149  {
150  return tmp<fvPatchField<Type>>
151  (
152  new partialSlipFvPatchField<Type>(*this, iF)
153  );
154  }
155 
156 
157  // Member functions
158 
159  // Attributes
160 
161  //- Return false: this patch field is not altered by assignment
162  virtual bool assignable() const
163  {
164  return false;
165  }
166 
167 
168  // Mapping functions
169 
170  //- Map (and resize as needed) from self given a mapping object
171  virtual void autoMap
172  (
173  const fvPatchFieldMapper&
174  );
175 
176  //- Reverse map the given fvPatchField onto this fvPatchField
177  virtual void rmap
178  (
179  const fvPatchField<Type>&,
180  const labelList&
181  );
182 
183 
184  // Return defining fields
185 
186  virtual Field<Type>& refValue()
187  {
188  return refValue_;
189  }
190 
191  virtual const Field<Type>& refValue() const
192  {
193  return refValue_;
194  }
195 
196  virtual scalarField& valueFraction()
197  {
198  return valueFraction_;
199  }
200 
201  virtual const scalarField& valueFraction() const
202  {
203  return valueFraction_;
204  }
205 
206 
207  // Evaluation functions
208 
209  //- Return gradient at boundary
210  virtual tmp<Field<Type>> snGrad() const;
211 
212  //- Evaluate the patch field
213  virtual void evaluate
214  (
215  const Pstream::commsTypes commsType =
217  );
218 
219  //- Return face-gradient transform diagonal
220  virtual tmp<Field<Type>> snGradTransformDiag() const;
221 
222 
223  //- Write
224  virtual void write(Ostream&) const;
225 
226 
227  // Member operators
228 
229  virtual void operator=(const UList<Type>&) {}
230 
231  virtual void operator=(const fvPatchField<Type>&) {}
232  virtual void operator+=(const fvPatchField<Type>&) {}
233  virtual void operator-=(const fvPatchField<Type>&) {}
234  virtual void operator*=(const fvPatchField<scalar>&) {}
235  virtual void operator/=(const fvPatchField<scalar>&) {}
236 
237  virtual void operator+=(const Field<Type>&) {}
238  virtual void operator-=(const Field<Type>&) {}
239 
240  virtual void operator*=(const Field<scalar>&) {}
241  virtual void operator/=(const Field<scalar>&) {}
242 
243  virtual void operator=(const Type&) {}
244  virtual void operator+=(const Type&) {}
245  virtual void operator-=(const Type&) {}
246  virtual void operator*=(const scalar) {}
247  virtual void operator/=(const scalar) {}
248 };
249 
250 
251 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
252 
253 } // End namespace Foam
254 
255 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
256 
257 #ifdef NoRepository
259 #endif
260 
261 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
262 
263 #endif
264 
265 // ************************************************************************* //
Foam::fvPatchField
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: volSurfaceMapping.H:50
Foam::UPstream::commsTypes::blocking
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:215
Foam::partialSlipFvPatchField::operator=
virtual void operator=(const Type &)
Definition: partialSlipFvPatchField.H:257
Foam::partialSlipFvPatchField::operator-=
virtual void operator-=(const Type &)
Definition: partialSlipFvPatchField.H:259
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::partialSlipFvPatchField::operator*=
virtual void operator*=(const scalar)
Definition: partialSlipFvPatchField.H:260
Foam::partialSlipFvPatchField::operator-=
virtual void operator-=(const fvPatchField< Type > &)
Definition: partialSlipFvPatchField.H:247
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:249
Foam::partialSlipFvPatchField::refValue
virtual Field< Type > & refValue()
Definition: partialSlipFvPatchField.H:200
Foam::partialSlipFvPatchField::operator-=
virtual void operator-=(const Field< Type > &)
Definition: partialSlipFvPatchField.H:252
Foam::partialSlipFvPatchField::operator=
virtual void operator=(const UList< Type > &)
Definition: partialSlipFvPatchField.H:243
Foam::partialSlipFvPatchField::operator*=
virtual void operator*=(const fvPatchField< scalar > &)
Definition: partialSlipFvPatchField.H:248
Foam::partialSlipFvPatchField::operator+=
virtual void operator+=(const Field< Type > &)
Definition: partialSlipFvPatchField.H:251
Foam::partialSlipFvPatchField::snGradTransformDiag
virtual tmp< Field< Type > > snGradTransformDiag() const
Return face-gradient transform diagonal.
Definition: partialSlipFvPatchField.C:184
Foam::partialSlipFvPatchField::clone
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Definition: partialSlipFvPatchField.H:143
Foam::partialSlipFvPatchField::valueFraction
virtual scalarField & valueFraction()
Definition: partialSlipFvPatchField.H:210
Foam::Field
Generic templated field type.
Definition: Field.H:63
Foam::partialSlipFvPatchField::operator/=
virtual void operator/=(const scalar)
Definition: partialSlipFvPatchField.H:261
Foam::partialSlipFvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: partialSlipFvPatchField.C:201
Foam::partialSlipFvPatchField::snGrad
virtual tmp< Field< Type > > snGrad() const
Return gradient at boundary.
Definition: partialSlipFvPatchField.C:144
Foam::partialSlipFvPatchField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: partialSlipFvPatchField.C:115
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:121
Foam::partialSlipFvPatchField::operator+=
virtual void operator+=(const Type &)
Definition: partialSlipFvPatchField.H:258
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::partialSlipFvPatchField::operator+=
virtual void operator+=(const fvPatchField< Type > &)
Definition: partialSlipFvPatchField.H:246
Foam::partialSlipFvPatchField::evaluate
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
Evaluate the patch field.
Definition: partialSlipFvPatchField.C:159
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:245
Foam::UList< Type >
Foam::partialSlipFvPatchField::operator/=
virtual void operator/=(const Field< scalar > &)
Definition: partialSlipFvPatchField.H:255
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:127
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:91
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:205
Foam::partialSlipFvPatchField::assignable
virtual bool assignable() const
Return false: this patch field is not altered by assignment.
Definition: partialSlipFvPatchField.H:176
Foam::partialSlipFvPatchField::operator*=
virtual void operator*=(const Field< scalar > &)
Definition: partialSlipFvPatchField.H:254
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54