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