fixedNormalSlipFvPatchField.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::fixedNormalSlipFvPatchField
26 
27 Group
28  grpGenericBoundaryConditions grpWallBoundaryConditions
29 
30 Description
31  This boundary condition sets the patch-normal component to a fixed value.
32 
33  \heading Patch usage
34 
35  \table
36  Property | Description | Required | Default value
37  fixedValue | fixed value | yes |
38  \endtable
39 
40  Example of the boundary condition specification:
41  \verbatim
42  myPatch
43  {
44  type fixedNormalSlip;
45  fixedValue uniform 0; // example entry for a scalar field
46  }
47  \endverbatim
48 
49 SeeAlso
50  Foam::transformFvPatchField
51 
52 SourceFiles
53  fixedNormalSlipFvPatchField.C
54 
55 \*---------------------------------------------------------------------------*/
56 
57 #ifndef fixedNormalSlipFvPatchField_H
58 #define fixedNormalSlipFvPatchField_H
59 
60 #include "transformFvPatchField.H"
61 
62 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
63 
64 namespace Foam
65 {
66 
67 /*---------------------------------------------------------------------------*\
68  Class fixedNormalSlipFvPatchField Declaration
69 \*---------------------------------------------------------------------------*/
70 
71 template<class Type>
72 class fixedNormalSlipFvPatchField
73 :
74  public transformFvPatchField<Type>
75 {
76  // Private data
77 
78  //- Value the normal component of which the boundary is set to
79  Field<Type> fixedValue_;
80 
81 
82 public:
83 
84  //- Runtime type information
85  TypeName("fixedNormalSlip");
86 
87 
88  // Constructors
89 
90  //- Construct from patch and internal field
92  (
93  const fvPatch&,
95  );
96 
97  //- Construct from patch, internal field and dictionary
99  (
100  const fvPatch&,
102  const dictionary&
103  );
104 
105  //- Construct by mapping given fixedNormalSlipFvPatchField
106  // onto a new patch
108  (
110  const fvPatch&,
112  const fvPatchFieldMapper&
113  );
114 
115  //- Construct as copy
117  (
119  );
120 
121  //- Construct and return a clone
122  virtual tmp<fvPatchField<Type> > clone() const
123  {
124  return tmp<fvPatchField<Type> >
125  (
127  );
128  }
129 
130  //- Construct as copy setting internal field reference
132  (
135  );
136 
137  //- Construct and return a clone setting internal field reference
138  virtual tmp<fvPatchField<Type> > clone
139  (
141  ) const
142  {
143  return tmp<fvPatchField<Type> >
144  (
145  new fixedNormalSlipFvPatchField<Type>(*this, iF)
146  );
147  }
148 
150  // Member functions
151 
152  // Mapping functions
153 
154  //- Map (and resize as needed) from self given a mapping object
155  virtual void autoMap
156  (
157  const fvPatchFieldMapper&
158  );
159 
160  //- Reverse map the given fvPatchField onto this fvPatchField
161  virtual void rmap
162  (
163  const fvPatchField<Type>&,
164  const labelList&
165  );
166 
167 
168  // Return defining fields
169 
170  virtual Field<Type>& fixedValue()
171  {
172  return fixedValue_;
173  }
174 
175  virtual const Field<Type>& fixedValue() const
176  {
177  return fixedValue_;
178  }
179 
181  // Evaluation functions
182 
183  //- Return gradient at boundary
184  virtual tmp<Field<Type> > snGrad() const;
186  //- Evaluate the patch field
187  virtual void evaluate
188  (
189  const Pstream::commsTypes commsType=Pstream::blocking
190  );
191 
192  //- Return face-gradient transform diagonal
193  virtual tmp<Field<Type> > snGradTransformDiag() const;
194 
195 
196  //- Write
197  virtual void write(Ostream&) const;
198 
199 
200  // Member operators
201 
202  virtual void operator=(const UList<Type>&) {}
203 
204  virtual void operator=(const fvPatchField<Type>&) {}
205  virtual void operator+=(const fvPatchField<Type>&) {}
206  virtual void operator-=(const fvPatchField<Type>&) {}
207  virtual void operator*=(const fvPatchField<scalar>&) {}
208  virtual void operator/=(const fvPatchField<scalar>&) {}
209 
210  virtual void operator+=(const Field<Type>&) {}
211  virtual void operator-=(const Field<Type>&) {}
213  virtual void operator*=(const Field<scalar>&) {}
214  virtual void operator/=(const Field<scalar>&) {}
216  virtual void operator=(const Type&) {}
217  virtual void operator+=(const Type&) {}
218  virtual void operator-=(const Type&) {}
219  virtual void operator*=(const scalar) {}
220  virtual void operator/=(const scalar) {}
221 };
222 
224 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
225 
226 } // End namespace Foam
228 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
230 #ifdef NoRepository
232 #endif
233 
234 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
235 
236 #endif
237 
238 // ************************************************************************* //
virtual void operator=(const UList< Type > &)
A class for managing temporary objects.
Definition: PtrList.H:90
virtual tmp< Field< Type > > snGrad() const
Return gradient at boundary.
virtual void operator/=(const fvPatchField< scalar > &)
virtual void operator-=(const fvPatchField< Type > &)
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
List< label > labelList
A List of labels.
Definition: labelList.H:56
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:66
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::blocking)
Evaluate the patch field.
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
virtual void write(Ostream &) const
Write.
virtual void operator*=(const fvPatchField< scalar > &)
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
fixedNormalSlipFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:138
commsTypes
Types of communications.
Definition: UPstream.H:65
This boundary condition sets the patch-normal component to a fixed value.
Pre-declare SubField and related Field type.
Definition: Field.H:58
virtual void operator+=(const fvPatchField< Type > &)
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:62
TypeName("fixedNormalSlip")
Runtime type information.
virtual tmp< Field< Type > > snGradTransformDiag() const
Return face-gradient transform diagonal.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Foam::fvPatchFieldMapper.