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-2023 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 protected:
81 
82  // Protected functions
83 
84  //- Construct from patch and internal field
86  (
87  const fvPatch&,
89  );
90 
91 
92 public:
93 
94  //- Runtime type information
95  TypeName("partialSlip");
96 
97 
98  // Constructors
99 
100  //- Construct from patch, internal field and dictionary
102  (
103  const fvPatch&,
105  const dictionary&
106  );
107 
108  //- Construct by mapping given partialSlipFvPatchField onto a new patch
110  (
112  const fvPatch&,
114  const fvPatchFieldMapper&
115  );
116 
117  //- Disallow copy without setting internal field reference
119 
120  //- Copy constructor setting internal field reference
122  (
125  );
126 
127  //- Construct and return a clone setting internal field reference
129  (
131  ) const
132  {
133  return tmp<fvPatchField<Type>>
134  (
135  new partialSlipFvPatchField<Type>(*this, iF)
136  );
137  }
138 
139 
140  // Member Functions
141 
142  // Attributes
143 
144  //- Return false: this patch field is not altered by assignment
145  virtual bool assignable() const
146  {
147  return false;
148  }
149 
150 
151  // Mapping functions
152 
153  //- Map the given fvPatchField onto this fvPatchField
154  virtual void map
155  (
156  const fvPatchField<Type>&,
157  const fvPatchFieldMapper&
158  );
159 
160  //- Reset the fvPatchField to the given fvPatchField
161  // Used for mesh to mesh mapping
162  virtual void reset(const fvPatchField<Type>&);
163 
164 
165  // Return defining fields
166 
167  virtual scalarField& valueFraction()
168  {
169  return valueFraction_;
170  }
171 
172  virtual const scalarField& valueFraction() const
173  {
174  return valueFraction_;
175  }
176 
177 
178  // Evaluation functions
179 
180  //- Return gradient at boundary
181  virtual tmp<Field<Type>> snGrad() const;
182 
183  //- Evaluate the patch field
184  virtual void evaluate
185  (
186  const Pstream::commsTypes commsType =
188  );
189 
190  //- Return face-gradient transform diagonal
191  virtual tmp<Field<Type>> snGradTransformDiag() const;
192 
193 
194  //- Write
195  virtual void write(Ostream&) const;
196 
197 
198  // Member Operators
199 
200  virtual void operator=(const UList<Type>&) {}
201 
202  virtual void operator=(const fvPatchField<Type>&) {}
203  virtual void operator+=(const fvPatchField<Type>&) {}
204  virtual void operator-=(const fvPatchField<Type>&) {}
205  virtual void operator*=(const fvPatchField<scalar>&) {}
206  virtual void operator/=(const fvPatchField<scalar>&) {}
207 
208  virtual void operator+=(const Field<Type>&) {}
209  virtual void operator-=(const Field<Type>&) {}
210 
211  virtual void operator*=(const Field<scalar>&) {}
212  virtual void operator/=(const Field<scalar>&) {}
213 
214  virtual void operator=(const Type&) {}
215  virtual void operator+=(const Type&) {}
216  virtual void operator-=(const Type&) {}
217  virtual void operator*=(const scalar) {}
218  virtual void operator/=(const scalar) {}
219 };
220 
221 
222 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
223 
224 } // End namespace Foam
225 
226 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
227 
228 #ifdef NoRepository
229  #include "partialSlipFvPatchField.C"
230 #endif
231 
232 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
233 
234 #endif
235 
236 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
commsTypes
Types of communications.
Definition: UPstream.H:65
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Foam::fvPatchFieldMapper.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:87
tmp< fvPatchField< Type > > clone() const
Disallow clone without setting internal field reference.
Definition: fvPatchField.H:203
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:64
This boundary condition provides a partial slip condition. The amount of slip is controlled by a user...
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
Evaluate the patch field.
virtual void write(Ostream &) const
Write.
partialSlipFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
virtual void operator+=(const fvPatchField< Type > &)
virtual tmp< Field< Type > > snGrad() const
Return gradient at boundary.
virtual void operator/=(const fvPatchField< scalar > &)
virtual void operator*=(const fvPatchField< scalar > &)
virtual void operator-=(const fvPatchField< Type > &)
virtual void operator=(const UList< Type > &)
virtual void reset(const fvPatchField< Type > &)
Reset the fvPatchField to the given fvPatchField.
virtual void map(const fvPatchField< Type > &, const fvPatchFieldMapper &)
Map the given fvPatchField onto this fvPatchField.
virtual bool assignable() const
Return false: this patch field is not altered by assignment.
virtual tmp< Field< Type > > snGradTransformDiag() const
Return face-gradient transform diagonal.
virtual scalarField & valueFraction()
TypeName("partialSlip")
Runtime type information.
A class for managing temporary objects.
Definition: tmp.H:55
Namespace for OpenFOAM.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.