FreeFOAM The Cross-Platform CFD Toolkit
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) 1991-2010 OpenCFD Ltd.
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  Foam::partialSlipFvPatchField
29 
30 SourceFiles
31  partialSlipFvPatchField.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef partialSlipFvPatchField_H
36 #define partialSlipFvPatchField_H
37 
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class partialSlipFvPatch Declaration
47 \*---------------------------------------------------------------------------*/
48 
49 template<class Type>
51 :
52  public transformFvPatchField<Type>
53 {
54  // Private data
55 
56  //- Fraction (0-1) of value used for boundary condition
57  scalarField valueFraction_;
58 
59 
60 public:
61 
62  //- Runtime type information
63  TypeName("partialSlip");
64 
65 
66  // Constructors
67 
68  //- Construct from patch and internal field
70  (
71  const fvPatch&,
73  );
74 
75  //- Construct from patch, internal field and dictionary
77  (
78  const fvPatch&,
80  const dictionary&
81  );
82 
83  //- Construct by mapping given partialSlipFvPatchField onto a new patch
85  (
87  const fvPatch&,
89  const fvPatchFieldMapper&
90  );
91 
92  //- Construct as copy
94  (
96  );
97 
98  //- Construct and return a clone
99  virtual tmp<fvPatchField<Type> > clone() const
100  {
101  return tmp<fvPatchField<Type> >
102  (
104  );
105  }
106 
107  //- Construct as copy setting internal field reference
109  (
112  );
113 
114  //- Construct and return a clone setting internal field reference
115  virtual tmp<fvPatchField<Type> > clone
116  (
118  ) const
119  {
120  return tmp<fvPatchField<Type> >
121  (
122  new partialSlipFvPatchField<Type>(*this, iF)
123  );
124  }
125 
126 
127  // Member functions
128 
129  // Mapping functions
130 
131  //- Map (and resize as needed) from self given a mapping object
132  virtual void autoMap
133  (
134  const fvPatchFieldMapper&
135  );
136 
137  //- Reverse map the given fvPatchField onto this fvPatchField
138  virtual void rmap
139  (
140  const fvPatchField<Type>&,
141  const labelList&
142  );
143 
144 
145  // Return defining fields
146 
148  {
149  return valueFraction_;
150  }
151 
152  virtual const scalarField& valueFraction() const
153  {
154  return valueFraction_;
155  }
156 
157 
158  // Evaluation functions
159 
160  //- Return gradient at boundary
161  virtual tmp<Field<Type> > snGrad() const;
162 
163  //- Evaluate the patch field
164  virtual void evaluate
165  (
166  const Pstream::commsTypes commsType=Pstream::blocking
167  );
168 
169  //- Return face-gradient transform diagonal
170  virtual tmp<Field<Type> > snGradTransformDiag() const;
171 
172 
173  //- Write
174  virtual void write(Ostream&) const;
175 
176 
177  // Member operators
178 
179  virtual void operator=(const UList<Type>&) {}
180 
181  virtual void operator=(const fvPatchField<Type>&) {}
182  virtual void operator+=(const fvPatchField<Type>&) {}
183  virtual void operator-=(const fvPatchField<Type>&) {}
184  virtual void operator*=(const fvPatchField<scalar>&) {}
185  virtual void operator/=(const fvPatchField<scalar>&) {}
186 
187  virtual void operator+=(const Field<Type>&) {}
188  virtual void operator-=(const Field<Type>&) {}
189 
190  virtual void operator*=(const Field<scalar>&) {}
191  virtual void operator/=(const Field<scalar>&) {}
192 
193  virtual void operator=(const Type&) {}
194  virtual void operator+=(const Type&) {}
195  virtual void operator-=(const Type&) {}
196  virtual void operator*=(const scalar) {}
197  virtual void operator/=(const scalar) {}
198 };
199 
200 
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 
203 } // End namespace Foam
204 
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 
207 #ifdef NoRepository
209 #endif
210 
211 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212 
213 #endif
214 
215 // ************************ vim: set sw=4 sts=4 et: ************************ //