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-2016 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  flowRate | flow rate profile | yes |
46  rpm | rotational speed profile | yes |
47  \endtable
48 
49  Example of the boundary condition specification:
50  \verbatim
51  <patchName>
52  {
53  type swirlFlowRateInletVelocity;
54  flowRate constant 0.2;
55  rpm constant 100;
56  }
57  \endverbatim
58 
59 Note
60  - the \c flowRate and \c rpm entries are Function1 types, able to describe
61  time varying functions. The example above gives the usage for supplying
62  constant values.
63  - the value is positive into the domain
64 
65 See also
66  Foam::fixedValueFvPatchField
67  Foam::Function1Types
68 
69 SourceFiles
70  swirlFlowRateInletVelocityFvPatchVectorField.C
71 
72 \*---------------------------------------------------------------------------*/
73 
74 #ifndef swirlFlowRateInletVelocityFvPatchVectorField_H
75 #define swirlFlowRateInletVelocityFvPatchVectorField_H
76 
78 #include "Function1.H"
79 
80 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
81 
82 namespace Foam
83 {
84 /*---------------------------------------------------------------------------*\
85  Class swirlFlowRateInletVelocityFvPatchVectorField Declaration
86 \*---------------------------------------------------------------------------*/
87 
88 class swirlFlowRateInletVelocityFvPatchVectorField
89 :
90  public fixedValueFvPatchVectorField
91 {
92  // Private data
93 
94  //- Name of the flux transporting the field
95  const word phiName_;
96 
97  //- Name of the density field used to normalize the mass flux
98  const word rhoName_;
99 
100  //- Inlet integral flow rate
101  autoPtr<Function1<scalar>> flowRate_;
102 
103  //- Angular speed in revolutions per minute (RPM)
104  autoPtr<Function1<scalar>> rpm_;
105 
106 
107 public:
108 
109  //- Runtime type information
110  TypeName("swirlFlowRateInletVelocity");
111 
113  // Constructors
114 
115  //- Construct from patch and internal field
117  (
118  const fvPatch&,
120  );
121 
122  //- Construct from patch, internal field and dictionary
124  (
125  const fvPatch&,
127  const dictionary&
128  );
129 
130  //- Construct by mapping given
131  // flowRateInletVelocityFvPatchVectorField
132  // onto a new patch
134  (
136  const fvPatch&,
138  const fvPatchFieldMapper&
139  );
140 
141  //- Construct as copy
143  (
145  );
146 
147  //- Construct and return a clone
148  virtual tmp<fvPatchVectorField> clone() const
149  {
151  (
153  );
154  }
155 
156  //- Construct as copy setting internal field reference
158  (
161  );
162 
163  //- Construct and return a clone setting internal field reference
165  (
167  ) const
168  {
170  (
172  );
173  }
174 
175 
176  // Member functions
177 
178  // Access
179 
180  //- Update the coefficients associated with the patch field
181  virtual void updateCoeffs();
182 
183  //- Write
184  virtual void write(Ostream&) const;
185 };
186 
187 
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 } // End namespace Foam
191 
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 
194 #endif
195 
196 // ************************************************************************* //
virtual void updateCoeffs()
Update the coefficients associated with the patch 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
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
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
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:54
This boundary condition provides a volumetric- OR mass-flow normal vector boundary condition by its m...
Namespace for OpenFOAM.