All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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-2019 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  //- Copy constructor
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  //- Copy constructor 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  // Used to update fields following mesh topology change
161  virtual void autoMap(const fvPatchFieldMapper&);
162 
163  //- Reverse map the given fvPatchField onto this fvPatchField
164  // Used to reconstruct fields
165  virtual void rmap(const fvPatchField<Type>&, const labelList&);
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  }
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 =
191  );
192 
193  //- Return face-gradient transform diagonal
194  virtual tmp<Field<Type>> snGradTransformDiag() const;
195 
196 
197  //- Write
198  virtual void write(Ostream&) const;
199 
200 
201  // Member Operators
202 
203  virtual void operator=(const UList<Type>&) {}
204 
205  virtual void operator=(const fvPatchField<Type>&) {}
206  virtual void operator+=(const fvPatchField<Type>&) {}
207  virtual void operator-=(const fvPatchField<Type>&) {}
208  virtual void operator*=(const fvPatchField<scalar>&) {}
209  virtual void operator/=(const fvPatchField<scalar>&) {}
210 
211  virtual void operator+=(const Field<Type>&) {}
212  virtual void operator-=(const Field<Type>&) {}
213 
214  virtual void operator*=(const Field<scalar>&) {}
215  virtual void operator/=(const Field<scalar>&) {}
217  virtual void operator=(const Type&) {}
218  virtual void operator+=(const Type&) {}
219  virtual void operator-=(const Type&) {}
220  virtual void operator*=(const scalar) {}
221  virtual void operator/=(const scalar) {}
222 };
225 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
227 } // End namespace Foam
229 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
231 #ifdef NoRepository
233 #endif
234 
235 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
236 
237 #endif
238 
239 // ************************************************************************* //
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:158
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:56
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:54
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.