surfaceNormalFixedValueFvPatchVectorField.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) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2019 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::surfaceNormalFixedValueFvPatchVectorField
29 
30 Group
31  grpGenericBoundaryConditions grpInletBoundaryConditions
32 
33 Description
34  This boundary condition provides a surface-normal vector boundary condition
35  by its magnitude.
36 
37 Usage
38  \table
39  Property | Description | Required | Default
40  refValue | reference value | yes |
41  ramp | time-based ramping | no |
42  \endtable
43 
44  Example of the boundary condition specification:
45  \verbatim
46  <patchName>
47  {
48  type surfaceNormalFixedValue;
49  refValue uniform -10; // 10 INTO the domain
50  }
51  \endverbatim
52 
53 Note
54  Sign conventions:
55  - the value is positive for outward-pointing vectors
56 
57 See also
58  Foam::fixedValueFvPatchField
59 
60 SourceFiles
61  surfaceNormalFixedValueFvPatchVectorField.C
62 
63 \*---------------------------------------------------------------------------*/
64 
65 #ifndef surfaceNormalFixedValueFvPatchVectorField_H
66 #define surfaceNormalFixedValueFvPatchVectorField_H
67 
68 #include "fvPatchFields.H"
70 #include "Function1.H"
71 
72 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
73 
74 namespace Foam
75 {
76 
77 /*---------------------------------------------------------------------------*\
78  Class surfaceNormalFixedValueFvPatchVectorField Declaration
79 \*---------------------------------------------------------------------------*/
80 
81 class surfaceNormalFixedValueFvPatchVectorField
82 :
83  public fixedValueFvPatchVectorField
84 {
85  // Private Data
86 
87  scalarField refValue_;
88 
89  //- Optional time ramping
90  autoPtr<Function1<scalar>> ramp_;
91 
92 
93 public:
94 
95  //- Runtime type information
96  TypeName("surfaceNormalFixedValue");
97 
98 
99  // Constructors
100 
101  //- Construct from patch and internal field
103  (
104  const fvPatch&,
106  );
107 
108  //- Construct from patch, internal field and dictionary
110  (
111  const fvPatch&,
113  const dictionary&
114  );
115 
116  //- Construct by mapping given
117  // surfaceNormalFixedValueFvPatchVectorField
118  // onto a new patch
120  (
122  const fvPatch&,
124  const fvPatchFieldMapper&
125  );
126 
127  //- Construct as copy
129  (
131  );
132 
133  //- Construct as copy setting internal field reference
135  (
138  );
139 
140  //- Return a clone
141  virtual tmp<fvPatchField<vector>> clone() const
142  {
143  return fvPatchField<vector>::Clone(*this);
144  }
145 
146  //- Clone with an internal field reference
148  (
150  ) const
151  {
152  return fvPatchField<vector>::Clone(*this, iF);
153  }
154 
155 
156  // Member functions
157 
158  // Mapping functions
159 
160  //- Map (and resize as needed) from self given a mapping object
161  virtual void autoMap
162  (
163  const fvPatchFieldMapper&
164  );
165 
166  //- Reverse map the given fvPatchField onto this fvPatchField
167  virtual void rmap
168  (
169  const fvPatchVectorField&,
170  const labelList&
171  );
172 
173 
174  // Evaluation functions
175 
176  //- Update the coefficients associated with the patch field
177  virtual void updateCoeffs();
178 
179 
180  //- Write
181  virtual void write(Ostream&) const;
182 };
183 
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 } // End namespace Foam
188 
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 
191 #endif
192 
193 // ************************************************************************* //
surfaceNormalFixedValueFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
virtual void rmap(const fvPatchVectorField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
This boundary condition provides a surface-normal vector boundary condition by its magnitude...
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
Definition: fvPatchField.H:597
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
A FieldMapper for finite-volume patch fields.
TypeName("surfaceNormalFixedValue")
Runtime type information.
virtual tmp< fvPatchField< vector > > clone() const
Return a clone.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Namespace for OpenFOAM.