fixedNormalSlipFvPatchField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2018 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 Description
28  This boundary condition sets the patch-normal component to a fixed value.
29 
30 Usage
31  \table
32  Property | Description | Required | Default value
33  fixedValue | fixed value | yes |
34  \endtable
35 
36  Example of the boundary condition specification:
37  \verbatim
38  <patchName>
39  {
40  type fixedNormalSlip;
41  fixedValue uniform 0; // example entry for a scalar field
42  }
43  \endverbatim
44 
45 See also
46  Foam::transformFvPatchField
47 
48 SourceFiles
49  fixedNormalSlipFvPatchField.C
50 
51 \*---------------------------------------------------------------------------*/
52 
53 #ifndef fixedNormalSlipFvPatchField_H
54 #define fixedNormalSlipFvPatchField_H
55 
56 #include "transformFvPatchField.H"
57 
58 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
59 
60 namespace Foam
61 {
62 
63 /*---------------------------------------------------------------------------*\
64  Class fixedNormalSlipFvPatchField Declaration
65 \*---------------------------------------------------------------------------*/
66 
67 template<class Type>
68 class fixedNormalSlipFvPatchField
69 :
70  public transformFvPatchField<Type>
71 {
72  // Private data
73 
74  //- Value the normal component of which the boundary is set to
75  Field<Type> fixedValue_;
76 
77 
78 public:
79 
80  //- Runtime type information
81  TypeName("fixedNormalSlip");
82 
83 
84  // Constructors
85 
86  //- Construct from patch and internal field
88  (
89  const fvPatch&,
91  );
92 
93  //- Construct from patch, internal field and dictionary
95  (
96  const fvPatch&,
98  const dictionary&
99  );
100 
101  //- Construct by mapping given fixedNormalSlipFvPatchField
102  // onto a new patch
104  (
106  const fvPatch&,
108  const fvPatchFieldMapper&
109  );
110 
111  //- Construct as copy
113  (
115  );
116 
117  //- Construct and return a clone
118  virtual tmp<fvPatchField<Type>> clone() const
119  {
120  return tmp<fvPatchField<Type>>
121  (
123  );
124  }
125 
126  //- Construct as copy setting internal field reference
128  (
131  );
132 
133  //- Construct and return a clone setting internal field reference
135  (
137  ) const
138  {
139  return tmp<fvPatchField<Type>>
140  (
141  new fixedNormalSlipFvPatchField<Type>(*this, iF)
142  );
143  }
145 
146  // Member functions
147 
148  // Access
149 
150  //- Return false: this patch field is not altered by assignment
151  virtual bool assignable() const
152  {
153  return false;
154  }
155 
156 
157  // Mapping functions
158 
159  //- Map (and resize as needed) from self given a mapping object
160  virtual void autoMap
161  (
162  const fvPatchFieldMapper&
163  );
164 
165  //- Reverse map the given fvPatchField onto this fvPatchField
166  virtual void rmap
167  (
168  const fvPatchField<Type>&,
169  const labelList&
170  );
171 
172 
173  // Return defining fields
174 
175  virtual Field<Type>& fixedValue()
176  {
177  return fixedValue_;
178  }
179 
180  virtual const Field<Type>& fixedValue() const
181  {
182  return fixedValue_;
183  }
185 
186  // Evaluation functions
187 
188  //- Return gradient at boundary
189  virtual tmp<Field<Type>> snGrad() const;
190 
191  //- Evaluate the patch field
192  virtual void evaluate
193  (
194  const Pstream::commsTypes commsType =
196  );
197 
198  //- Return face-gradient transform diagonal
199  virtual tmp<Field<Type>> snGradTransformDiag() const;
200 
201 
202  //- Write
203  virtual void write(Ostream&) const;
204 
205 
206  // Member operators
207 
208  virtual void operator=(const UList<Type>&) {}
209 
210  virtual void operator=(const fvPatchField<Type>&) {}
211  virtual void operator+=(const fvPatchField<Type>&) {}
212  virtual void operator-=(const fvPatchField<Type>&) {}
213  virtual void operator*=(const fvPatchField<scalar>&) {}
214  virtual void operator/=(const fvPatchField<scalar>&) {}
215 
216  virtual void operator+=(const Field<Type>&) {}
217  virtual void operator-=(const Field<Type>&) {}
218 
219  virtual void operator*=(const Field<scalar>&) {}
220  virtual void operator/=(const Field<scalar>&) {}
222  virtual void operator=(const Type&) {}
223  virtual void operator+=(const Type&) {}
224  virtual void operator-=(const Type&) {}
225  virtual void operator*=(const scalar) {}
226  virtual void operator/=(const scalar) {}
227 };
230 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
232 } // End namespace Foam
234 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
236 #ifdef NoRepository
238 #endif
239 
240 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
241 
242 #endif
243 
244 // ************************************************************************* //
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.