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-2023 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::Function1s
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 normalise 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, 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  // Access
168 
169  //- Update the coefficients associated with the patch field
170  virtual void updateCoeffs();
171 
172  //- Write
173  virtual void write(Ostream&) const;
174 };
175 
176 
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 
179 } // End namespace Foam
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 #endif
184 
185 // ************************************************************************* //
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:160
Foam::fvPatchFieldMapper.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:64
This boundary condition provides a volumetric- OR mass-flow normal vector boundary condition by its m...
virtual tmp< fvPatchVectorField > clone(const DimensionedField< vector, volMesh > &iF) const
Construct and return a clone setting internal field reference.
swirlFlowRateInletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
TypeName("swirlFlowRateInletVelocity")
Runtime type information.
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