uniformNormalFixedValueFvPatchVectorField.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) 2019 OpenCFD Ltd.
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::uniformNormalFixedValueFvPatchVectorField
28 
29 Group
30  grpGenericBoundaryConditions grpInletBoundaryConditions
31 
32 Description
33  This boundary condition provides a uniform surface-normal
34  vector boundary condition by its magnitude.
35 
36 Usage
37  \table
38  Property | Description | Required | Default
39  uniformValue | uniform value | yes |
40  ramp | time-based ramping | no |
41  \endtable
42 
43  Example of the boundary condition specification:
44  \verbatim
45  <patchName>
46  {
47  type uniformNormalFixedValue;
48  uniformValue constant -10; // 10 INTO the domain
49  }
50  \endverbatim
51 
52 Note
53  Sign conventions:
54  - the value is positive for outward-pointing vectors
55 
56 See also
57  Foam::Function1Types
58  Foam::fixedValueFvPatchField
59  Foam::surfaceNormalFixedValueFvPatchVectorField
60  Foam::uniformFixedValueFvPatchVectorField
61 
62 SourceFiles
63  uniformNormalFixedValueFvPatchVectorField.C
64 
65 \*---------------------------------------------------------------------------*/
66 
67 #ifndef Foam_uniformNormalFixedValueFvPatchVectorField_H
68 #define Foam_uniformNormalFixedValueFvPatchVectorField_H
69 
70 #include "fvPatchFields.H"
72 #include "PatchFunction1.H"
73 
74 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
75 
76 namespace Foam
77 {
78 
79 /*---------------------------------------------------------------------------*\
80  Class uniformNormalFixedValueFvPatchVectorField Declaration
81 \*---------------------------------------------------------------------------*/
82 
83 class uniformNormalFixedValueFvPatchVectorField
84 :
85  public fixedValueFvPatchVectorField
86 {
87  // Private Data
88 
89  //- Function providing the value
90  autoPtr<PatchFunction1<scalar>> refValueFunc_;
91 
92  //- Optional ramping
94 
95 
96 public:
97 
98  //- Runtime type information
99  TypeName("uniformNormalFixedValue");
100 
101 
102  // Constructors
103 
104  //- Construct from patch and internal field
106  (
107  const fvPatch&,
109  );
110 
111  //- Construct from patch, internal field and dictionary
113  (
114  const fvPatch&,
116  const dictionary&
117  );
118 
119  //- Construct by mapping given
120  // uniformNormalFixedValueFvPatchVectorField
121  // onto a new patch
123  (
125  const fvPatch&,
127  const fvPatchFieldMapper&
128  );
129 
130  //- Construct as copy
132  (
134  );
135 
136  //- Construct and return a clone
137  virtual tmp<fvPatchVectorField> clone() const
138  {
140  (
142  );
143  }
144 
145  //- Construct as copy setting internal field reference
147  (
150  );
151 
152  //- Construct and return a clone setting internal field reference
154  (
156  ) const
157  {
159  (
161  (
162  *this,
163  iF
164  )
165  );
166  }
167 
168 
169  // Member Functions
170 
171  // Mapping Functions
172 
173  //- Map (and resize as needed) from self given a mapping object
174  virtual void autoMap
175  (
176  const fvPatchFieldMapper&
177  );
178 
179  //- Reverse map the given fvPatchField onto this fvPatchField
180  virtual void rmap
181  (
182  const fvPatchVectorField&,
183  const labelList&
184  );
186 
187  // Evaluation Functions
188 
189  //- Update the coefficients associated with the patch field
190  virtual void updateCoeffs();
191 
192 
193  //- Write
194  virtual void write(Ostream& os) const;
195 };
196 
197 
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 
200 } // End namespace Foam
201 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 #endif
205 
206 // ************************************************************************* //
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
TypeName("uniformNormalFixedValue")
Runtime type information.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
This boundary condition provides a uniform surface-normal vector boundary condition by its magnitude...
A FieldMapper for finite-volume patch fields.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
OBJstream os(runTime.globalPath()/outputName)
virtual void rmap(const fvPatchVectorField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: areaFieldsFwd.H:42
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
uniformNormalFixedValueFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Namespace for OpenFOAM.