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 
149 
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 
180 
181  // Evaluation functions
182 
183  //- Return gradient at boundary
184  virtual tmp<Field<Type> > snGrad() const;
185 
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>&) {}
212 
213  virtual void operator*=(const Field<scalar>&) {}
214  virtual void operator/=(const Field<scalar>&) {}
215 
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 
223 
224 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
225 
226 } // End namespace Foam
227 
228 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229 
230 #ifdef NoRepository
232 #endif
233 
234 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
235 
236 #endif
237 
238 // ************************************************************************* //
Foam::fvPatchField< Type >
Foam::fixedNormalSlipFvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: fixedNormalSlipFvPatchField.C:178
Foam::fixedNormalSlipFvPatchField::operator*=
virtual void operator*=(const scalar)
Definition: fixedNormalSlipFvPatchField.H:228
Foam::fixedNormalSlipFvPatchField::TypeName
TypeName("fixedNormalSlip")
Runtime type information.
Foam::fixedNormalSlipFvPatchField::rmap
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: fixedNormalSlipFvPatchField.C:111
Foam::fixedNormalSlipFvPatchField::fixedValue
virtual const Field< Type > & fixedValue() const
Definition: fixedNormalSlipFvPatchField.H:184
Foam::fixedNormalSlipFvPatchField::operator-=
virtual void operator-=(const Type &)
Definition: fixedNormalSlipFvPatchField.H:227
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::fixedNormalSlipFvPatchField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: fixedNormalSlipFvPatchField.C:100
Foam::fixedNormalSlipFvPatchField::evaluate
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::blocking)
Evaluate the patch field.
Definition: fixedNormalSlipFvPatchField.C:141
Foam::fixedNormalSlipFvPatchField::operator/=
virtual void operator/=(const scalar)
Definition: fixedNormalSlipFvPatchField.H:229
Foam::fixedNormalSlipFvPatchField::operator/=
virtual void operator/=(const Field< scalar > &)
Definition: fixedNormalSlipFvPatchField.H:223
Foam::fixedNormalSlipFvPatchField::operator=
virtual void operator=(const Type &)
Definition: fixedNormalSlipFvPatchField.H:225
fixedNormalSlipFvPatchField.C
Foam::fixedNormalSlipFvPatchField::operator-=
virtual void operator-=(const Field< Type > &)
Definition: fixedNormalSlipFvPatchField.H:220
Foam::UPstream::blocking
@ blocking
Definition: UPstream.H:66
Foam::fixedNormalSlipFvPatchField::fixedValue
virtual Field< Type > & fixedValue()
Definition: fixedNormalSlipFvPatchField.H:179
Foam::Field< Type >
Foam::fixedNormalSlipFvPatchField::fixedNormalSlipFvPatchField
fixedNormalSlipFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Definition: fixedNormalSlipFvPatchField.C:34
Foam::fixedNormalSlipFvPatchField::operator*=
virtual void operator*=(const Field< scalar > &)
Definition: fixedNormalSlipFvPatchField.H:222
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::fixedNormalSlipFvPatchField::clone
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Definition: fixedNormalSlipFvPatchField.H:131
Foam::fixedNormalSlipFvPatchField::operator*=
virtual void operator*=(const fvPatchField< scalar > &)
Definition: fixedNormalSlipFvPatchField.H:216
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::fixedNormalSlipFvPatchField
This boundary condition sets the patch-normal component to a fixed value.
Definition: fixedNormalSlipFvPatchField.H:81
Foam::fixedNormalSlipFvPatchField::operator+=
virtual void operator+=(const Type &)
Definition: fixedNormalSlipFvPatchField.H:226
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::fixedNormalSlipFvPatchField::snGradTransformDiag
virtual tmp< Field< Type > > snGradTransformDiag() const
Return face-gradient transform diagonal.
Definition: fixedNormalSlipFvPatchField.C:164
Foam::fixedNormalSlipFvPatchField::operator=
virtual void operator=(const fvPatchField< Type > &)
Definition: fixedNormalSlipFvPatchField.H:213
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:64
Foam::fixedNormalSlipFvPatchField::fixedValue_
Field< Type > fixedValue_
Value the normal component of which the boundary is set to.
Definition: fixedNormalSlipFvPatchField.H:88
Foam::fixedNormalSlipFvPatchField::snGrad
virtual tmp< Field< Type > > snGrad() const
Return gradient at boundary.
Definition: fixedNormalSlipFvPatchField.C:127
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::UList< Type >
Foam::fixedNormalSlipFvPatchField::operator+=
virtual void operator+=(const fvPatchField< Type > &)
Definition: fixedNormalSlipFvPatchField.H:214
Foam::transformFvPatchField
Foam::transformFvPatchField.
Definition: transformFvPatchField.H:52
Foam::fixedNormalSlipFvPatchField::operator=
virtual void operator=(const UList< Type > &)
Definition: fixedNormalSlipFvPatchField.H:211
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
Foam::fixedNormalSlipFvPatchField::operator/=
virtual void operator/=(const fvPatchField< scalar > &)
Definition: fixedNormalSlipFvPatchField.H:217
Foam::fixedNormalSlipFvPatchField::operator+=
virtual void operator+=(const Field< Type > &)
Definition: fixedNormalSlipFvPatchField.H:219
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
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::fixedNormalSlipFvPatchField::operator-=
virtual void operator-=(const fvPatchField< Type > &)
Definition: fixedNormalSlipFvPatchField.H:215