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