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-2022 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  //- 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  }
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>&) {}
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 };
218 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
220 } // End namespace Foam
222 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
224 #ifdef NoRepository
225  #include "partialSlipFvPatchField.C"
226 #endif
227 
228 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229 
230 #endif
231 
232 // ************************************************************************* //
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:63
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.
virtual void reset(const fvPatchField< Type > &)
Reset the fvPatchField to the given fvPatchField.
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.