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