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-2023 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  }
135 
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 the given fvPatchField onto this fvPatchField
151  virtual void map
152  (
153  const fvPatchField<Type>&,
154  const fvPatchFieldMapper&
155  );
156 
157  //- Reset the fvPatchField to the given fvPatchField
158  // Used for mesh to mesh mapping
159  virtual void reset(const fvPatchField<Type>&);
160 
161 
162  // Return defining fields
163 
164  virtual Field<Type>& fixedValue()
165  {
166  return fixedValue_;
167  }
168 
169  virtual const Field<Type>& fixedValue() const
170  {
171  return fixedValue_;
172  }
173 
174 
175  // Evaluation functions
176 
177  //- Return gradient at boundary
178  virtual tmp<Field<Type>> snGrad() const;
179 
180  //- Evaluate the patch field
181  virtual void evaluate
182  (
183  const Pstream::commsTypes commsType =
185  );
186 
187  //- Return face-gradient transform diagonal
188  virtual tmp<Field<Type>> snGradTransformDiag() const;
189 
190 
191  //- Write
192  virtual void write(Ostream&) const;
193 
194 
195  // Member Operators
196 
197  virtual void operator=(const UList<Type>&) {}
198 
199  virtual void operator=(const fvPatchField<Type>&) {}
200  virtual void operator+=(const fvPatchField<Type>&) {}
201  virtual void operator-=(const fvPatchField<Type>&) {}
202  virtual void operator*=(const fvPatchField<scalar>&) {}
203  virtual void operator/=(const fvPatchField<scalar>&) {}
204 
205  virtual void operator+=(const Field<Type>&) {}
206  virtual void operator-=(const Field<Type>&) {}
207 
208  virtual void operator*=(const Field<scalar>&) {}
209  virtual void operator/=(const Field<scalar>&) {}
210 
211  virtual void operator=(const Type&) {}
212  virtual void operator+=(const Type&) {}
213  virtual void operator-=(const Type&) {}
214  virtual void operator*=(const scalar) {}
215  virtual void operator/=(const scalar) {}
216 };
217 
218 
219 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
220 
221 } // End namespace Foam
222 
223 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
224 
225 #ifdef NoRepository
227 #endif
228 
229 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
230 
231 #endif
232 
233 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Pre-declare SubField and related Field type.
Definition: Field.H:82
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
commsTypes
Types of communications.
Definition: UPstream.H:65
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
This boundary condition sets the patch-normal component to a fixed value.
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
Evaluate the patch field.
virtual void write(Ostream &) const
Write.
fixedNormalSlipFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
virtual void operator+=(const fvPatchField< Type > &)
virtual tmp< Field< Type > > snGrad() const
Return gradient at boundary.
virtual void operator/=(const fvPatchField< scalar > &)
virtual void operator*=(const fvPatchField< scalar > &)
virtual void operator-=(const fvPatchField< Type > &)
virtual void operator=(const UList< Type > &)
virtual void reset(const fvPatchField< Type > &)
Reset the fvPatchField to the given fvPatchField.
virtual void map(const fvPatchField< Type > &, const fvPatchFieldMapper &)
Map the given fvPatchField onto this fvPatchField.
TypeName("fixedNormalSlip")
Runtime type information.
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.
Foam::fvPatchFieldMapper.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:87
tmp< fvPatchField< Type > > clone() const
Disallow clone without setting internal field reference.
Definition: fvPatchField.H:203
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:64
A class for managing temporary objects.
Definition: tmp.H:55
Namespace for OpenFOAM.