All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
partialSlipFvPatchField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2019 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 Description
28  This boundary condition provides a partial slip condition. The amount of
29  slip is controlled by a user-supplied field.
30 
31 Usage
32  \table
33  Property | Description | Required | Default value
34  valueFraction | fraction of value used for boundary [0-1] | yes |
35  \endtable
36 
37  Example of the boundary condition specification:
38  \verbatim
39  <patchName>
40  {
41  type partialSlip;
42  valueFraction uniform 0.1;
43  value uniform 0;
44  }
45  \endverbatim
46 
47 See also
48  Foam::transformFvPatchField
49 
50 SourceFiles
51  partialSlipFvPatchField.C
52 
53 \*---------------------------------------------------------------------------*/
54 
55 #ifndef partialSlipFvPatchField_H
56 #define partialSlipFvPatchField_H
57 
58 #include "transformFvPatchField.H"
59 
60 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
61 
62 namespace Foam
63 {
64 
65 /*---------------------------------------------------------------------------*\
66  Class partialSlipFvPatchField Declaration
67 \*---------------------------------------------------------------------------*/
68 
69 template<class Type>
70 class partialSlipFvPatchField
71 :
72  public transformFvPatchField<Type>
73 {
74  // Private Data
75 
76  //- Fraction (0-1) of value used for boundary condition
77  scalarField valueFraction_;
78 
79 
80 public:
81 
82  //- Runtime type information
83  TypeName("partialSlip");
84 
85 
86  // Constructors
87 
88  //- Construct from patch and internal field
90  (
91  const fvPatch&,
93  );
94 
95  //- Construct from patch, internal field and dictionary
97  (
98  const fvPatch&,
100  const dictionary&
101  );
102 
103  //- Construct by mapping given partialSlipFvPatchField onto a new patch
105  (
107  const fvPatch&,
109  const fvPatchFieldMapper&
110  );
111 
112  //- Copy constructor
114  (
116  );
117 
118  //- Construct and return a clone
119  virtual tmp<fvPatchField<Type>> clone() const
120  {
121  return tmp<fvPatchField<Type>>
122  (
124  );
125  }
126 
127  //- Copy constructor setting internal field reference
129  (
132  );
133 
134  //- Construct and return a clone setting internal field reference
136  (
138  ) const
139  {
140  return tmp<fvPatchField<Type>>
141  (
142  new partialSlipFvPatchField<Type>(*this, iF)
143  );
144  }
146 
147  // Member Functions
148 
149  // Attributes
150 
151  //- Return false: this patch field is not altered by assignment
152  virtual bool assignable() const
153  {
154  return false;
155  }
156 
157 
158  // Mapping functions
159 
160  //- Map (and resize as needed) from self given a mapping object
161  // Used to update fields following mesh topology change
162  virtual void autoMap(const fvPatchFieldMapper&);
163 
164  //- Reverse map the given fvPatchField onto this fvPatchField
165  // Used to reconstruct fields
166  virtual void rmap(const fvPatchField<Type>&, const labelList&);
167 
168 
169  // Return defining fields
170 
171  virtual scalarField& valueFraction()
172  {
173  return valueFraction_;
174  }
175 
176  virtual const scalarField& valueFraction() const
177  {
178  return valueFraction_;
179  }
181 
182  // Evaluation functions
183 
184  //- Return gradient at boundary
185  virtual tmp<Field<Type>> snGrad() const;
186 
187  //- Evaluate the patch field
188  virtual void evaluate
189  (
190  const Pstream::commsTypes commsType =
192  );
193 
194  //- Return face-gradient transform diagonal
195  virtual tmp<Field<Type>> snGradTransformDiag() const;
196 
197 
198  //- Write
199  virtual void write(Ostream&) const;
200 
201 
202  // Member Operators
203 
204  virtual void operator=(const UList<Type>&) {}
205 
206  virtual void operator=(const fvPatchField<Type>&) {}
207  virtual void operator+=(const fvPatchField<Type>&) {}
208  virtual void operator-=(const fvPatchField<Type>&) {}
209  virtual void operator*=(const fvPatchField<scalar>&) {}
210  virtual void operator/=(const fvPatchField<scalar>&) {}
211 
212  virtual void operator+=(const Field<Type>&) {}
213  virtual void operator-=(const Field<Type>&) {}
214 
215  virtual void operator*=(const Field<scalar>&) {}
216  virtual void operator/=(const Field<scalar>&) {}
218  virtual void operator=(const Type&) {}
219  virtual void operator+=(const Type&) {}
220  virtual void operator-=(const Type&) {}
221  virtual void operator*=(const scalar) {}
222  virtual void operator/=(const scalar) {}
223 };
226 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
228 } // End namespace Foam
230 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
232 #ifdef NoRepository
233  #include "partialSlipFvPatchField.C"
234 #endif
235 
236 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
237 
238 #endif
239 
240 // ************************************************************************* //
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:158
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:54
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.