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