partialSlipFvPatchField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011-2012 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 Group
28  grpWallBoundaryConditions grpGenericBoundaryConditions
29 
30 Description
31  This boundary condition provides a partial slip condition. The amount of
32  slip is controlled by a user-supplied field.
33 
34  \heading Patch usage
35 
36  \table
37  Property | Description | Required | Default value
38  valueFraction | fraction od value used for boundary [0-1] | yes |
39  \endtable
40 
41  Example of the boundary condition specification:
42  \verbatim
43  myPatch
44  {
45  type partialSlip;
46  valueFraction uniform 0.1;
47  value uniform 0;
48  }
49  \endverbatim
50 
51 SeeAlso
52  Foam::transformFvPatchField
53 
54 SourceFiles
55  partialSlipFvPatchField.C
56 
57 \*---------------------------------------------------------------------------*/
58 
59 #ifndef partialSlipFvPatchField_H
60 #define partialSlipFvPatchField_H
61 
62 #include "transformFvPatchField.H"
63 
64 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
65 
66 namespace Foam
67 {
68 
69 /*---------------------------------------------------------------------------*\
70  Class partialSlipFvPatchField Declaration
71 \*---------------------------------------------------------------------------*/
72 
73 template<class Type>
74 class partialSlipFvPatchField
75 :
76  public transformFvPatchField<Type>
77 {
78  // Private data
79 
80  //- Fraction (0-1) of value used for boundary condition
82 
83 
84 public:
85 
86  //- Runtime type information
87  TypeName("partialSlip");
88 
89 
90  // Constructors
91 
92  //- Construct from patch and internal field
94  (
95  const fvPatch&,
97  );
98 
99  //- Construct from patch, internal field and dictionary
101  (
102  const fvPatch&,
104  const dictionary&
105  );
106 
107  //- Construct by mapping given partialSlipFvPatchField onto a new patch
109  (
111  const fvPatch&,
113  const fvPatchFieldMapper&
114  );
115 
116  //- Construct as copy
118  (
120  );
121 
122  //- Construct and return a clone
123  virtual tmp<fvPatchField<Type> > clone() const
124  {
125  return tmp<fvPatchField<Type> >
126  (
128  );
129  }
130 
131  //- Construct as copy setting internal field reference
133  (
136  );
137 
138  //- Construct and return a clone setting internal field reference
139  virtual tmp<fvPatchField<Type> > clone
140  (
142  ) const
143  {
144  return tmp<fvPatchField<Type> >
145  (
146  new partialSlipFvPatchField<Type>(*this, iF)
147  );
148  }
149 
150 
151  // Member functions
152 
153  // Mapping functions
154 
155  //- Map (and resize as needed) from self given a mapping object
156  virtual void autoMap
157  (
158  const fvPatchFieldMapper&
159  );
160 
161  //- Reverse map the given fvPatchField onto this fvPatchField
162  virtual void rmap
163  (
164  const fvPatchField<Type>&,
165  const labelList&
166  );
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  }
180 
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=Pstream::blocking
191  );
192 
193  //- Return face-gradient transform diagonal
194  virtual tmp<Field<Type> > snGradTransformDiag() const;
195 
196 
197  //- Write
198  virtual void write(Ostream&) const;
199 
200 
201  // Member operators
202 
203  virtual void operator=(const UList<Type>&) {}
204 
205  virtual void operator=(const fvPatchField<Type>&) {}
206  virtual void operator+=(const fvPatchField<Type>&) {}
207  virtual void operator-=(const fvPatchField<Type>&) {}
208  virtual void operator*=(const fvPatchField<scalar>&) {}
209  virtual void operator/=(const fvPatchField<scalar>&) {}
210 
211  virtual void operator+=(const Field<Type>&) {}
212  virtual void operator-=(const Field<Type>&) {}
213 
214  virtual void operator*=(const Field<scalar>&) {}
215  virtual void operator/=(const Field<scalar>&) {}
216 
217  virtual void operator=(const Type&) {}
218  virtual void operator+=(const Type&) {}
219  virtual void operator-=(const Type&) {}
220  virtual void operator*=(const scalar) {}
221  virtual void operator/=(const scalar) {}
222 };
223 
224 
225 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
226 
227 } // End namespace Foam
228 
229 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
230 
231 #ifdef NoRepository
232 # include "partialSlipFvPatchField.C"
233 #endif
234 
235 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
236 
237 #endif
238 
239 // ************************************************************************* //
Foam::fvPatchField< Type >
Foam::scalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Definition: primitiveFieldsFwd.H:48
Foam::partialSlipFvPatchField::valueFraction
virtual const scalarField & valueFraction() const
Definition: partialSlipFvPatchField.H:185
Foam::partialSlipFvPatchField::valueFraction_
scalarField valueFraction_
Fraction (0-1) of value used for boundary condition.
Definition: partialSlipFvPatchField.H:90
Foam::partialSlipFvPatchField::operator=
virtual void operator=(const Type &)
Definition: partialSlipFvPatchField.H:226
Foam::partialSlipFvPatchField::operator-=
virtual void operator-=(const Type &)
Definition: partialSlipFvPatchField.H:228
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::partialSlipFvPatchField::operator*=
virtual void operator*=(const scalar)
Definition: partialSlipFvPatchField.H:229
Foam::partialSlipFvPatchField::operator-=
virtual void operator-=(const fvPatchField< Type > &)
Definition: partialSlipFvPatchField.H:216
Foam::partialSlipFvPatchField::partialSlipFvPatchField
partialSlipFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Definition: partialSlipFvPatchField.C:33
Foam::partialSlipFvPatchField::operator/=
virtual void operator/=(const fvPatchField< scalar > &)
Definition: partialSlipFvPatchField.H:218
Foam::partialSlipFvPatchField::operator-=
virtual void operator-=(const Field< Type > &)
Definition: partialSlipFvPatchField.H:221
Foam::partialSlipFvPatchField::operator=
virtual void operator=(const UList< Type > &)
Definition: partialSlipFvPatchField.H:212
Foam::partialSlipFvPatchField::operator*=
virtual void operator*=(const fvPatchField< scalar > &)
Definition: partialSlipFvPatchField.H:217
Foam::partialSlipFvPatchField::operator+=
virtual void operator+=(const Field< Type > &)
Definition: partialSlipFvPatchField.H:220
Foam::partialSlipFvPatchField::snGradTransformDiag
virtual tmp< Field< Type > > snGradTransformDiag() const
Return face-gradient transform diagonal.
Definition: partialSlipFvPatchField.C:163
Foam::UPstream::blocking
@ blocking
Definition: UPstream.H:66
Foam::partialSlipFvPatchField::clone
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Definition: partialSlipFvPatchField.H:132
Foam::partialSlipFvPatchField::valueFraction
virtual scalarField & valueFraction()
Definition: partialSlipFvPatchField.H:180
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::partialSlipFvPatchField::operator/=
virtual void operator/=(const scalar)
Definition: partialSlipFvPatchField.H:230
Foam::partialSlipFvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: partialSlipFvPatchField.C:180
Foam::partialSlipFvPatchField::snGrad
virtual tmp< Field< Type > > snGrad() const
Return gradient at boundary.
Definition: partialSlipFvPatchField.C:126
Foam::partialSlipFvPatchField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: partialSlipFvPatchField.C:99
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::partialSlipFvPatchField::TypeName
TypeName("partialSlip")
Runtime type information.
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::partialSlipFvPatchField::operator+=
virtual void operator+=(const Type &)
Definition: partialSlipFvPatchField.H:227
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::partialSlipFvPatchField::operator+=
virtual void operator+=(const fvPatchField< Type > &)
Definition: partialSlipFvPatchField.H:215
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:64
partialSlipFvPatchField.C
transformFvPatchField.H
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::partialSlipFvPatchField::operator=
virtual void operator=(const fvPatchField< Type > &)
Definition: partialSlipFvPatchField.H:214
Foam::UList< Type >
Foam::partialSlipFvPatchField::operator/=
virtual void operator/=(const Field< scalar > &)
Definition: partialSlipFvPatchField.H:224
Foam::transformFvPatchField
Foam::transformFvPatchField.
Definition: transformFvPatchField.H:52
Foam::partialSlipFvPatchField::rmap
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: partialSlipFvPatchField.C:110
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
Foam::partialSlipFvPatchField
This boundary condition provides a partial slip condition. The amount of slip is controlled by a user...
Definition: partialSlipFvPatchField.H:83
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::partialSlipFvPatchField::operator*=
virtual void operator*=(const Field< scalar > &)
Definition: partialSlipFvPatchField.H:223
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51
Foam::partialSlipFvPatchField::evaluate
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::blocking)
Evaluate the patch field.
Definition: partialSlipFvPatchField.C:140