swirlFlowRateInletVelocityFvPatchVectorField.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) 2011-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::swirlFlowRateInletVelocityFvPatchVectorField
26 
27 Group
28  grpInletBoundaryConditions
29 
30 Description
31  This boundary condition provides a volumetric- OR mass-flow normal vector
32  boundary condition by its magnitude as an integral over its area with a
33  swirl component determined by the angular speed, given in revolutions per
34  minute (RPM)
35 
36  The basis of the patch (volumetric or mass) is determined by the
37  dimensions of the flux, phi. The current density is used to correct the
38  velocity when applying the mass basis.
39 
40 Usage
41  \table
42  Property | Description | Required | Default value
43  phi | flux field name | no | phi
44  rho | density field name | no | rho
45  origin | origin of rotation | no | patch centre
46  axis | axis of rotation | no | -patch normal
47  flowRate | flow rate profile | yes |
48  rpm | rotational speed profile | yes |
49  \endtable
50 
51  Example of the boundary condition specification:
52  \verbatim
53  <patchName>
54  {
55  type swirlFlowRateInletVelocity;
56  flowRate constant 0.2;
57  rpm constant 100;
58  }
59  \endverbatim
60 
61 Note
62  - the \c flowRate and \c rpm entries are Function1 types, able to describe
63  time varying functions. The example above gives the usage for supplying
64  constant values.
65  - the value is positive into the domain
66 
67 See also
68  Foam::fixedValueFvPatchField
69  Foam::Function1Types
70 
71 SourceFiles
72  swirlFlowRateInletVelocityFvPatchVectorField.C
73 
74 \*---------------------------------------------------------------------------*/
75 
76 #ifndef swirlFlowRateInletVelocityFvPatchVectorField_H
77 #define swirlFlowRateInletVelocityFvPatchVectorField_H
78 
80 #include "Function1.H"
81 
82 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
83 
84 namespace Foam
85 {
86 /*---------------------------------------------------------------------------*\
87  Class swirlFlowRateInletVelocityFvPatchVectorField Declaration
88 \*---------------------------------------------------------------------------*/
89 
90 class swirlFlowRateInletVelocityFvPatchVectorField
91 :
92  public fixedValueFvPatchVectorField
93 {
94  // Private data
95 
96  //- Name of the flux transporting the field
97  const word phiName_;
98 
99  //- Name of the density field used to normalize the mass flux
100  const word rhoName_;
101 
102  //- Origin of the rotation
103  const vector origin_;
104 
105  //- Axis of the rotation
106  const vector axis_;
107 
108  //- Inlet integral flow rate
109  autoPtr<Function1<scalar>> flowRate_;
110 
111  //- Angular speed in revolutions per minute (RPM)
112  autoPtr<Function1<scalar>> rpm_;
113 
114 
115 public:
116 
117  //- Runtime type information
118  TypeName("swirlFlowRateInletVelocity");
119 
120 
121  // Constructors
122 
123  //- Construct from patch and internal field
125  (
126  const fvPatch&,
128  );
129 
130  //- Construct from patch, internal field and dictionary
132  (
133  const fvPatch&,
135  const dictionary&
136  );
137 
138  //- Construct by mapping given
139  // flowRateInletVelocityFvPatchVectorField
140  // onto a new patch
142  (
144  const fvPatch&,
146  const fvPatchFieldMapper&
147  );
148 
149  //- Construct as copy
151  (
153  );
154 
155  //- Construct and return a clone
156  virtual tmp<fvPatchVectorField> clone() const
157  {
159  (
161  );
162  }
163 
164  //- Construct as copy setting internal field reference
166  (
169  );
170 
171  //- Construct and return a clone setting internal field reference
173  (
175  ) const
176  {
178  (
180  );
181  }
182 
183 
184  // Member functions
185 
186  // Access
187 
188  //- Update the coefficients associated with the patch field
189  virtual void updateCoeffs();
191  //- Write
192  virtual void write(Ostream&) const;
193 };
194 
195 
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 
198 } // End namespace Foam
199 
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201 
202 #endif
203 
204 // ************************************************************************* //
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
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
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:49
TypeName("swirlFlowRateInletVelocity")
Runtime type information.
swirlFlowRateInletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
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...
A class for managing temporary objects.
Definition: PtrList.H:53
This boundary condition provides a volumetric- OR mass-flow normal vector boundary condition by its m...
Namespace for OpenFOAM.