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 as copy setting internal field reference
138  (
141  );
142 
143  //- Return a clone
144  virtual tmp<fvPatchField<vector>> clone() const
145  {
146  return fvPatchField<vector>::Clone(*this);
147  }
148 
149  //- Clone with an internal field reference
151  (
153  ) const
154  {
155  return fvPatchField<vector>::Clone(*this, iF);
156  }
157 
158 
159  // Member Functions
160 
161  // Mapping Functions
162 
163  //- Map (and resize as needed) from self given a mapping object
164  virtual void autoMap
165  (
166  const fvPatchFieldMapper&
167  );
168 
169  //- Reverse map the given fvPatchField onto this fvPatchField
170  virtual void rmap
171  (
172  const fvPatchVectorField&,
173  const labelList&
174  );
175 
176 
177  // Evaluation Functions
178 
179  //- Update the coefficients associated with the patch field
180  virtual void updateCoeffs();
181 
183  //- Write
184  virtual void write(Ostream& os) const;
185 };
186 
187 
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 
190 } // End namespace Foam
191 
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 
194 #endif
195 
196 // ************************************************************************* //
fvPatchField< vector > fvPatchVectorField
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.
This boundary condition provides a uniform surface-normal vector boundary condition by its magnitude...
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
Definition: fvPatchField.H:597
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.
virtual tmp< fvPatchField< vector > > clone() const
Return a clone.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
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.