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