swirlInletVelocityFvPatchVectorField.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) 2017-2020 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::swirlInletVelocityFvPatchVectorField
26 
27 Description
28  This boundary condition describes an inlet vector boundary condition in
29  swirl co-ordinates given a central axis, central point, axial, radial and
30  tangential velocity profiles.
31 
32 Usage
33  \table
34  Property | Description | Required | Default value
35  axis | Axis of rotation | yes |
36  origin | Origin of rotation | yes |
37  axialVelocity | Axial velocity profile [m/s] | yes |
38  radialVelocity | Radial velocity profile [m/s] | yes |
39  tangentialVelocity | tangential velocity profile [m/s] | yes |
40  \endtable
41 
42  Example of the boundary condition specification:
43  \verbatim
44  <patchName>
45  {
46  type swirlInletVelocity;
47  axis (0 0 1);
48  origin (0 0 0);
49  axialVelocity constant 30;
50  radialVelocity constant 10;
51  tangentialVelocity constant 100;
52  }
53  \endverbatim
54 
55 Note
56  The \c axialVelocity, \c radialVelocity and \c tangentialVelocity entries
57  are Function1 types, able to describe time varying functions. The example
58  above gives the usage for supplying constant values.
59 
60 See also
61  Foam::fixedValueFvPatchField
62  Foam::Function1s
63 
64 SourceFiles
65  swirlInletVelocityFvPatchVectorField.C
66 
67 \*---------------------------------------------------------------------------*/
68 
69 #ifndef swirlInletVelocityFvPatchVectorField_H
70 #define swirlInletVelocityFvPatchVectorField_H
71 
73 #include "Function1.H"
74 
75 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
76 
77 namespace Foam
78 {
79 /*---------------------------------------------------------------------------*\
80  Class swirlInletVelocityFvPatchVectorField Declaration
81 \*---------------------------------------------------------------------------*/
82 
83 class swirlInletVelocityFvPatchVectorField
84 :
85  public fixedValueFvPatchVectorField
86 {
87  // Private Data
88 
89  //- Origin of the rotation
90  const vector origin_;
91 
92  //- Axis of the rotation
93  const vector axis_;
94 
95  //- Axial velocity
96  autoPtr<Function1<scalar>> axialVelocity_;
97 
98  //- Radial velocity
99  autoPtr<Function1<scalar>> radialVelocity_;
100 
101  //- Tangential velocity
102  autoPtr<Function1<scalar>> tangentialVelocity_;
103 
104 
105 public:
106 
107  //- Runtime type information
108  TypeName("swirlInletVelocity");
109 
110 
111  // Constructors
113  //- Construct from patch and internal field
115  (
116  const fvPatch&,
118  );
119 
120  //- Construct from patch, internal field and dictionary
122  (
123  const fvPatch&,
125  const dictionary&
126  );
127 
128  //- Construct by mapping given
129  // flowRateInletVelocityFvPatchVectorField
130  // onto a new patch
132  (
134  const fvPatch&,
136  const fvPatchFieldMapper&
137  );
138 
139  //- Disallow copy without setting internal field reference
141  (
143  ) = delete;
144 
145  //- Copy constructor setting internal field reference
147  (
150  );
151 
152  //- Construct and return a clone setting internal field reference
154  (
156  ) const
157  {
159  (
161  );
162  }
163 
164 
165  // Member Functions
166 
167  //- Update the coefficients associated with the patch field
168  virtual void updateCoeffs();
169 
170  //- Write
171  virtual void write(Ostream&) const;
172 };
173 
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 } // End namespace Foam
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 #endif
182 
183 // ************************************************************************* //
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
swirlInletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:62
This boundary condition describes an inlet vector boundary condition in swirl co-ordinates given a ce...
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:49
Foam::fvPatchFieldMapper.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
TypeName("swirlInletVelocity")
Runtime type information.
virtual tmp< fvPatchVectorField > clone(const DimensionedField< vector, volMesh > &iF) const
Construct and return a clone setting internal field reference.
A class for managing temporary objects.
Definition: PtrList.H:53
Namespace for OpenFOAM.