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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2017 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::fixedNormalSlipFvPatchField
28 
29 Group
30  grpGenericBoundaryConditions grpWallBoundaryConditions
31 
32 Description
33  This boundary condition sets the patch-normal component to a fixed value.
34 
35 Usage
36  \table
37  Property | Description | Required | Default value
38  fixedValue | fixed value | yes |
39  \endtable
40 
41  Example of the boundary condition specification:
42  \verbatim
43  <patchName>
44  {
45  type fixedNormalSlip;
46  fixedValue uniform 0; // example entry for a scalar field
47  }
48  \endverbatim
49 
50 See also
51  Foam::transformFvPatchField
52 
53 SourceFiles
54  fixedNormalSlipFvPatchField.C
55 
56 \*---------------------------------------------------------------------------*/
57 
58 #ifndef fixedNormalSlipFvPatchField_H
59 #define fixedNormalSlipFvPatchField_H
60 
61 #include "transformFvPatchField.H"
62 
63 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
64 
65 namespace Foam
66 {
67 
68 /*---------------------------------------------------------------------------*\
69  Class fixedNormalSlipFvPatchField Declaration
70 \*---------------------------------------------------------------------------*/
71 
72 template<class Type>
73 class fixedNormalSlipFvPatchField
74 :
75  public transformFvPatchField<Type>
76 {
77  // Private data
78 
79  //- Value the normal component of which the boundary is set to
80  Field<Type> fixedValue_;
81 
82 
83 public:
84 
85  //- Runtime type information
86  TypeName("fixedNormalSlip");
87 
88 
89  // Constructors
90 
91  //- Construct from patch and internal field
93  (
94  const fvPatch&,
96  );
97 
98  //- Construct from patch, internal field and dictionary
100  (
101  const fvPatch&,
103  const dictionary&
104  );
105 
106  //- Construct by mapping given fixedNormalSlipFvPatchField
107  // 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
140  (
142  ) const
143  {
144  return tmp<fvPatchField<Type>>
145  (
146  new fixedNormalSlipFvPatchField<Type>(*this, iF)
147  );
148  }
149 
150 
151  // Member functions
152 
153  // Access
154 
155  //- Return false: this patch field is not altered by assignment
156  virtual bool assignable() const
157  {
158  return false;
159  }
160 
161 
162  // Mapping functions
163 
164  //- Map (and resize as needed) from self given a mapping object
165  virtual void autoMap
166  (
167  const fvPatchFieldMapper&
168  );
169 
170  //- Reverse map the given fvPatchField onto this fvPatchField
171  virtual void rmap
172  (
173  const fvPatchField<Type>&,
174  const labelList&
175  );
176 
177 
178  // Return defining fields
179 
180  virtual Field<Type>& fixedValue()
181  {
182  return fixedValue_;
183  }
184 
185  virtual const Field<Type>& fixedValue() const
186  {
187  return fixedValue_;
188  }
189 
190 
191  // Evaluation functions
192 
193  //- Return gradient at boundary
194  virtual tmp<Field<Type>> snGrad() const;
195 
196  //- Evaluate the patch field
197  virtual void evaluate
198  (
199  const Pstream::commsTypes commsType =
201  );
202 
203  //- Return face-gradient transform diagonal
204  virtual tmp<Field<Type>> snGradTransformDiag() const;
205 
206 
207  //- Write
208  virtual void write(Ostream&) const;
209 
210 
211  // Member operators
212 
213  virtual void operator=(const UList<Type>&) {}
214 
215  virtual void operator=(const fvPatchField<Type>&) {}
216  virtual void operator+=(const fvPatchField<Type>&) {}
217  virtual void operator-=(const fvPatchField<Type>&) {}
218  virtual void operator*=(const fvPatchField<scalar>&) {}
219  virtual void operator/=(const fvPatchField<scalar>&) {}
220 
221  virtual void operator+=(const Field<Type>&) {}
222  virtual void operator-=(const Field<Type>&) {}
223 
224  virtual void operator*=(const Field<scalar>&) {}
225  virtual void operator/=(const Field<scalar>&) {}
226 
227  virtual void operator=(const Type&) {}
228  virtual void operator+=(const Type&) {}
229  virtual void operator-=(const Type&) {}
230  virtual void operator*=(const scalar) {}
231  virtual void operator/=(const scalar) {}
232 };
233 
234 
235 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
236 
237 } // End namespace Foam
238 
239 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
240 
241 #ifdef NoRepository
243 #endif
244 
245 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
246 
247 #endif
248 
249 // ************************************************************************* //
Foam::fvPatchField
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: volSurfaceMapping.H:50
Foam::fixedNormalSlipFvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: fixedNormalSlipFvPatchField.C:182
Foam::UPstream::commsTypes::blocking
Foam::fixedNormalSlipFvPatchField::operator*=
virtual void operator*=(const scalar)
Definition: fixedNormalSlipFvPatchField.H:239
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:115
Foam::fixedNormalSlipFvPatchField::fixedValue
virtual const Field< Type > & fixedValue() const
Definition: fixedNormalSlipFvPatchField.H:194
Foam::fixedNormalSlipFvPatchField::operator-=
virtual void operator-=(const Type &)
Definition: fixedNormalSlipFvPatchField.H:238
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::fixedNormalSlipFvPatchField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: fixedNormalSlipFvPatchField.C:104
Foam::fixedNormalSlipFvPatchField::evaluate
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
Evaluate the patch field.
Definition: fixedNormalSlipFvPatchField.C:145
Foam::fixedNormalSlipFvPatchField::operator/=
virtual void operator/=(const scalar)
Definition: fixedNormalSlipFvPatchField.H:240
Foam::fixedNormalSlipFvPatchField::operator/=
virtual void operator/=(const Field< scalar > &)
Definition: fixedNormalSlipFvPatchField.H:234
Foam::fixedNormalSlipFvPatchField::operator=
virtual void operator=(const Type &)
Definition: fixedNormalSlipFvPatchField.H:236
fixedNormalSlipFvPatchField.C
Foam::fixedNormalSlipFvPatchField::operator-=
virtual void operator-=(const Field< Type > &)
Definition: fixedNormalSlipFvPatchField.H:231
Foam::fixedNormalSlipFvPatchField::fixedValue
virtual Field< Type > & fixedValue()
Definition: fixedNormalSlipFvPatchField.H:189
Foam::Field
Generic templated field type.
Definition: Field.H:63
Foam::fixedNormalSlipFvPatchField::fixedNormalSlipFvPatchField
fixedNormalSlipFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Definition: fixedNormalSlipFvPatchField.C:37
Foam::fixedNormalSlipFvPatchField::operator*=
virtual void operator*=(const Field< scalar > &)
Definition: fixedNormalSlipFvPatchField.H:233
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::fixedNormalSlipFvPatchField::clone
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Definition: fixedNormalSlipFvPatchField.H:132
Foam::fixedNormalSlipFvPatchField::operator*=
virtual void operator*=(const fvPatchField< scalar > &)
Definition: fixedNormalSlipFvPatchField.H:227
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::fixedNormalSlipFvPatchField
This boundary condition sets the patch-normal component to a fixed value.
Definition: fixedNormalSlipFvPatchField.H:82
Foam::fixedNormalSlipFvPatchField::operator+=
virtual void operator+=(const Type &)
Definition: fixedNormalSlipFvPatchField.H:237
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::fixedNormalSlipFvPatchField::snGradTransformDiag
virtual tmp< Field< Type > > snGradTransformDiag() const
Return face-gradient transform diagonal.
Definition: fixedNormalSlipFvPatchField.C:168
Foam::fixedNormalSlipFvPatchField::operator=
virtual void operator=(const fvPatchField< Type > &)
Definition: fixedNormalSlipFvPatchField.H:224
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:69
Foam::fixedNormalSlipFvPatchField::snGrad
virtual tmp< Field< Type > > snGrad() const
Return gradient at boundary.
Definition: fixedNormalSlipFvPatchField.C:131
transformFvPatchField.H
Foam::List< label >
Foam::UList< Type >
Foam::fixedNormalSlipFvPatchField::operator+=
virtual void operator+=(const fvPatchField< Type > &)
Definition: fixedNormalSlipFvPatchField.H:225
Foam::transformFvPatchField
Foam::transformFvPatchField.
Definition: transformFvPatchField.H:54
Foam::fixedNormalSlipFvPatchField::operator=
virtual void operator=(const UList< Type > &)
Definition: fixedNormalSlipFvPatchField.H:222
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::fixedNormalSlipFvPatchField::operator/=
virtual void operator/=(const fvPatchField< scalar > &)
Definition: fixedNormalSlipFvPatchField.H:228
Foam::fixedNormalSlipFvPatchField::operator+=
virtual void operator+=(const Field< Type > &)
Definition: fixedNormalSlipFvPatchField.H:230
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54
Foam::fixedNormalSlipFvPatchField::assignable
virtual bool assignable() const
Return false: this patch field is not altered by assignment.
Definition: fixedNormalSlipFvPatchField.H:165
Foam::fixedNormalSlipFvPatchField::operator-=
virtual void operator-=(const fvPatchField< Type > &)
Definition: fixedNormalSlipFvPatchField.H:226