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 and return a clone
134  virtual tmp<fvPatchVectorField> clone() const
135  {
137  (
139  );
140  }
141 
142  //- Construct as copy setting internal field reference
144  (
147  );
148 
149  //- Construct and return a clone setting internal field reference
151  (
153  ) const
154  {
156  (
158  (
159  *this,
160  iF
161  )
162  );
163  }
164 
165 
166  // Member functions
167 
168  // Mapping functions
169 
170  //- Map (and resize as needed) from self given a mapping object
171  virtual void autoMap
172  (
173  const fvPatchFieldMapper&
174  );
175 
176  //- Reverse map the given fvPatchField onto this fvPatchField
177  virtual void rmap
178  (
179  const fvPatchVectorField&,
180  const labelList&
181  );
182 
183 
184  // Evaluation functions
185 
186  //- Update the coefficients associated with the patch field
187  virtual void updateCoeffs();
188 
189 
190  //- Write
191  virtual void write(Ostream&) const;
192 };
193 
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 } // End namespace Foam
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 
201 #endif
202 
203 // ************************************************************************* //
Foam::fvPatchField< vector >
Foam::scalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Definition: primitiveFieldsFwd.H:52
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Function1.H
Foam::surfaceNormalFixedValueFvPatchVectorField::write
virtual void write(Ostream &) const
Write.
Definition: surfaceNormalFixedValueFvPatchVectorField.C:172
Foam::surfaceNormalFixedValueFvPatchVectorField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: surfaceNormalFixedValueFvPatchVectorField.C:129
Foam::surfaceNormalFixedValueFvPatchVectorField::clone
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
Definition: surfaceNormalFixedValueFvPatchVectorField.H:148
Foam::surfaceNormalFixedValueFvPatchVectorField::TypeName
TypeName("surfaceNormalFixedValue")
Runtime type information.
Foam::surfaceNormalFixedValueFvPatchVectorField::surfaceNormalFixedValueFvPatchVectorField
surfaceNormalFixedValueFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Definition: surfaceNormalFixedValueFvPatchVectorField.C:38
Foam::Field< scalar >
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::surfaceNormalFixedValueFvPatchVectorField
This boundary condition provides a surface-normal vector boundary condition by its magnitude.
Definition: surfaceNormalFixedValueFvPatchVectorField.H:95
fvPatchFields.H
Foam::List< label >
fixedValueFvPatchFields.H
Foam::surfaceNormalFixedValueFvPatchVectorField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: surfaceNormalFixedValueFvPatchVectorField.C:153
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::surfaceNormalFixedValueFvPatchVectorField::rmap
virtual void rmap(const fvPatchVectorField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: surfaceNormalFixedValueFvPatchVectorField.C:139
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54