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-2020 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  //- Disallow copy without setting internal field reference
114 
115  //- Copy constructor setting internal field reference
117  (
120  );
121 
122  //- Construct and return a clone setting internal field reference
124  (
126  ) const
127  {
128  return tmp<fvPatchField<Type>>
129  (
130  new partialSlipFvPatchField<Type>(*this, iF)
131  );
132  }
134 
135  // Member Functions
136 
137  // Attributes
138 
139  //- Return false: this patch field is not altered by assignment
140  virtual bool assignable() const
141  {
142  return false;
143  }
144 
145 
146  // Mapping functions
147 
148  //- Map (and resize as needed) from self given a mapping object
149  // Used to update fields following mesh topology change
150  virtual void autoMap(const fvPatchFieldMapper&);
151 
152  //- Reverse map the given fvPatchField onto this fvPatchField
153  // Used to reconstruct fields
154  virtual void rmap(const fvPatchField<Type>&, const labelList&);
155 
156 
157  // Return defining fields
158 
159  virtual scalarField& valueFraction()
160  {
161  return valueFraction_;
162  }
163 
164  virtual const scalarField& valueFraction() const
165  {
166  return valueFraction_;
167  }
169 
170  // Evaluation functions
171 
172  //- Return gradient at boundary
173  virtual tmp<Field<Type>> snGrad() const;
174 
175  //- Evaluate the patch field
176  virtual void evaluate
177  (
178  const Pstream::commsTypes commsType =
180  );
181 
182  //- Return face-gradient transform diagonal
183  virtual tmp<Field<Type>> snGradTransformDiag() const;
184 
185 
186  //- Write
187  virtual void write(Ostream&) const;
188 
189 
190  // Member Operators
191 
192  virtual void operator=(const UList<Type>&) {}
193 
194  virtual void operator=(const fvPatchField<Type>&) {}
195  virtual void operator+=(const fvPatchField<Type>&) {}
196  virtual void operator-=(const fvPatchField<Type>&) {}
197  virtual void operator*=(const fvPatchField<scalar>&) {}
198  virtual void operator/=(const fvPatchField<scalar>&) {}
199 
200  virtual void operator+=(const Field<Type>&) {}
201  virtual void operator-=(const Field<Type>&) {}
202 
203  virtual void operator*=(const Field<scalar>&) {}
204  virtual void operator/=(const Field<scalar>&) {}
206  virtual void operator=(const Type&) {}
207  virtual void operator+=(const Type&) {}
208  virtual void operator-=(const Type&) {}
209  virtual void operator*=(const scalar) {}
210  virtual void operator/=(const scalar) {}
211 };
214 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216 } // End namespace Foam
218 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
220 #ifdef NoRepository
221  #include "partialSlipFvPatchField.C"
222 #endif
223 
224 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
225 
226 #endif
227 
228 // ************************************************************************* //
virtual void operator*=(const fvPatchField< scalar > &)
This boundary condition provides a partial slip condition. The amount of slip is controlled by a user...
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:156
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:62
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 > &)
tmp< fvPatchField< Type > > clone() const
Disallow clone without setting internal field reference.
Definition: fvPatchField.H:199
virtual void operator/=(const fvPatchField< scalar > &)
virtual void write(Ostream &) const
Write.
Namespace for OpenFOAM.