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-2020 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  //- Disallow copy without setting internal field reference
113  (
115  ) = delete;
116 
117  //- Copy constructor setting internal field reference
119  (
122  );
123 
124  //- Construct and return a clone setting internal field reference
126  (
128  ) const
129  {
130  return tmp<fvPatchField<Type>>
131  (
132  new fixedNormalSlipFvPatchField<Type>(*this, iF)
133  );
134  }
136 
137  // Member Functions
138 
139  // Access
140 
141  //- Return false: this patch field is not altered by assignment
142  virtual bool assignable() const
143  {
144  return false;
145  }
146 
147 
148  // Mapping functions
149 
150  //- Map (and resize as needed) from self given a mapping object
151  // Used to update fields following mesh topology change
152  virtual void autoMap(const fvPatchFieldMapper&);
153 
154  //- Reverse map the given fvPatchField onto this fvPatchField
155  // Used to reconstruct fields
156  virtual void rmap(const fvPatchField<Type>&, const labelList&);
157 
158 
159  // Return defining fields
160 
161  virtual Field<Type>& fixedValue()
162  {
163  return fixedValue_;
164  }
165 
166  virtual const Field<Type>& fixedValue() const
167  {
168  return fixedValue_;
169  }
171 
172  // Evaluation functions
173 
174  //- Return gradient at boundary
175  virtual tmp<Field<Type>> snGrad() const;
176 
177  //- Evaluate the patch field
178  virtual void evaluate
179  (
180  const Pstream::commsTypes commsType =
182  );
183 
184  //- Return face-gradient transform diagonal
185  virtual tmp<Field<Type>> snGradTransformDiag() const;
186 
187 
188  //- Write
189  virtual void write(Ostream&) const;
190 
191 
192  // Member Operators
193 
194  virtual void operator=(const UList<Type>&) {}
195 
196  virtual void operator=(const fvPatchField<Type>&) {}
197  virtual void operator+=(const fvPatchField<Type>&) {}
198  virtual void operator-=(const fvPatchField<Type>&) {}
199  virtual void operator*=(const fvPatchField<scalar>&) {}
200  virtual void operator/=(const fvPatchField<scalar>&) {}
201 
202  virtual void operator+=(const Field<Type>&) {}
203  virtual void operator-=(const Field<Type>&) {}
204 
205  virtual void operator*=(const Field<scalar>&) {}
206  virtual void operator/=(const Field<scalar>&) {}
208  virtual void operator=(const Type&) {}
209  virtual void operator+=(const Type&) {}
210  virtual void operator-=(const Type&) {}
211  virtual void operator*=(const scalar) {}
212  virtual void operator/=(const scalar) {}
213 };
216 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
218 } // End namespace Foam
220 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
222 #ifdef NoRepository
224 #endif
225 
226 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
227 
228 #endif
229 
230 // ************************************************************************* //
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:156
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:62
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 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.
tmp< fvPatchField< Type > > clone() const
Disallow clone without setting internal field reference.
Definition: fvPatchField.H:199
Namespace for OpenFOAM.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.