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 fieldMapper&
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(const fvPatchField<Type>&, const fieldMapper&);
155 
156  //- Reset the fvPatchField to the given fvPatchField
157  // Used for mesh to mesh mapping
158  virtual void reset(const fvPatchField<Type>&);
159 
160 
161  // Return defining fields
162 
163  virtual scalarField& valueFraction()
164  {
165  return valueFraction_;
166  }
167 
168  virtual const scalarField& valueFraction() const
169  {
170  return valueFraction_;
171  }
172 
173 
174  // Evaluation functions
175 
176  //- Return gradient at boundary
177  virtual tmp<Field<Type>> snGrad() const;
178 
179  //- Evaluate the patch field
180  virtual void evaluate
181  (
182  const Pstream::commsTypes commsType =
184  );
185 
186  //- Return face-gradient transform diagonal
187  virtual tmp<Field<Type>> snGradTransformDiag() const;
188 
189 
190  //- Write
191  virtual void write(Ostream&) const;
192 
193 
194  // Member Operators
195 
196  virtual void operator=(const UList<Type>&) {}
197 
198  virtual void operator=(const fvPatchField<Type>&) {}
199  virtual void operator+=(const fvPatchField<Type>&) {}
200  virtual void operator-=(const fvPatchField<Type>&) {}
201  virtual void operator*=(const fvPatchField<scalar>&) {}
202  virtual void operator/=(const fvPatchField<scalar>&) {}
203 
204  virtual void operator+=(const Field<Type>&) {}
205  virtual void operator-=(const Field<Type>&) {}
206 
207  virtual void operator*=(const Field<scalar>&) {}
208  virtual void operator/=(const Field<scalar>&) {}
209 
210  virtual void operator=(const Type&) {}
211  virtual void operator+=(const Type&) {}
212  virtual void operator-=(const Type&) {}
213  virtual void operator*=(const scalar) {}
214  virtual void operator/=(const scalar) {}
215 };
216 
217 
218 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
219 
220 } // End namespace Foam
221 
222 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
223 
224 #ifdef NoRepository
225  #include "partialSlipFvPatchField.C"
226 #endif
227 
228 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229 
230 #endif
231 
232 // ************************************************************************* //
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:162
Abstract base class for field mapping.
Definition: fieldMapper.H:48
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:88
tmp< fvPatchField< Type > > clone() const
Disallow clone without setting internal field reference.
Definition: fvPatchField.H:204
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 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()
virtual void map(const fvPatchField< Type > &, const fieldMapper &)
Map the given fvPatchField onto this fvPatchField.
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.