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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2017 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::swirlFlowRateInletVelocityFvPatchVectorField
28 
29 Group
30  grpInletBoundaryConditions
31 
32 Description
33  This boundary condition provides a volumetric- OR mass-flow normal vector
34  boundary condition by its magnitude as an integral over its area with a
35  swirl component determined by the angular speed, given in revolutions per
36  minute (RPM)
37 
38  The basis of the patch (volumetric or mass) is determined by the
39  dimensions of the flux, phi. The current density is used to correct the
40  velocity when applying the mass basis.
41 
42 Usage
43  \table
44  Property | Description | Required | Default value
45  phi | flux field name | no | phi
46  rho | density field name | no | rho
47  origin | origin of rotation | no | patch centre
48  axis | axis of rotation | no | -(patch normal)
49  flowRate | flow rate profile | yes |
50  rpm | rotational speed profile | yes |
51  \endtable
52 
53  Example of the boundary condition specification:
54  \verbatim
55  <patchName>
56  {
57  type swirlFlowRateInletVelocity;
58  flowRate constant 0.2;
59  rpm constant 100;
60  }
61  \endverbatim
62 
63 Note
64  - the \c flowRate and \c rpm entries are Function1 types, able to describe
65  time varying functions. The example above gives the usage for supplying
66  constant values.
67  - the value is positive into the domain
68 
69 See also
70  Foam::fixedValueFvPatchField
71  Foam::Function1Types
72 
73 SourceFiles
74  swirlFlowRateInletVelocityFvPatchVectorField.C
75 
76 \*---------------------------------------------------------------------------*/
77 
78 #ifndef swirlFlowRateInletVelocityFvPatchVectorField_H
79 #define swirlFlowRateInletVelocityFvPatchVectorField_H
80 
82 #include "Function1.H"
83 
84 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
85 
86 namespace Foam
87 {
88 /*---------------------------------------------------------------------------*\
89  Class swirlFlowRateInletVelocityFvPatchVectorField Declaration
90 \*---------------------------------------------------------------------------*/
91 
92 class swirlFlowRateInletVelocityFvPatchVectorField
93 :
94  public fixedValueFvPatchVectorField
95 {
96  // Private data
97 
98  //- Name of the flux transporting the field
99  const word phiName_;
100 
101  //- Name of the density field used to normalize the mass flux
102  const word rhoName_;
103 
104  //- Origin of the rotation
105  const vector origin_;
106 
107  //- Axis of the rotation
108  const vector axis_;
109 
110  //- Inlet integral flow rate
111  autoPtr<Function1<scalar>> flowRate_;
112 
113  //- Angular speed in revolutions per minute (RPM)
114  autoPtr<Function1<scalar>> rpm_;
115 
116 
117 public:
118 
119  //- Runtime type information
120  TypeName("swirlFlowRateInletVelocity");
121 
122 
123  // Constructors
124 
125  //- Construct from patch and internal field
127  (
128  const fvPatch&,
130  );
131 
132  //- Construct from patch, internal field and dictionary
134  (
135  const fvPatch&,
137  const dictionary&
138  );
139 
140  //- Construct by mapping given
141  // flowRateInletVelocityFvPatchVectorField
142  // onto a new patch
144  (
146  const fvPatch&,
148  const fvPatchFieldMapper&
149  );
150 
151  //- Construct as copy
153  (
155  );
156 
157  //- Construct and return a clone
158  virtual tmp<fvPatchVectorField> clone() const
159  {
161  (
163  );
164  }
165 
166  //- Construct as copy setting internal field reference
168  (
171  );
172 
173  //- Construct and return a clone setting internal field reference
175  (
177  ) const
178  {
180  (
182  );
183  }
184 
185 
186  // Member functions
187 
188  // Access
189 
190  //- Update the coefficients associated with the patch field
191  virtual void updateCoeffs();
192 
193  //- Write
194  virtual void write(Ostream&) const;
195 };
196 
197 
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 
200 } // End namespace Foam
201 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 #endif
205 
206 // ************************************************************************* //
Foam::swirlFlowRateInletVelocityFvPatchVectorField::swirlFlowRateInletVelocityFvPatchVectorField
swirlFlowRateInletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Definition: swirlFlowRateInletVelocityFvPatchVectorField.C:40
Foam::swirlFlowRateInletVelocityFvPatchVectorField
This boundary condition provides a volumetric- OR mass-flow normal vector boundary condition by its m...
Definition: swirlFlowRateInletVelocityFvPatchVectorField.H:126
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Function1.H
Foam::swirlFlowRateInletVelocityFvPatchVectorField::write
virtual void write(Ostream &) const
Write.
Definition: swirlFlowRateInletVelocityFvPatchVectorField.C:203
Foam::swirlFlowRateInletVelocityFvPatchVectorField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: swirlFlowRateInletVelocityFvPatchVectorField.C:145
Foam::swirlFlowRateInletVelocityFvPatchVectorField::clone
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
Definition: swirlFlowRateInletVelocityFvPatchVectorField.H:192
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::vector
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:51
Foam::swirlFlowRateInletVelocityFvPatchVectorField::TypeName
TypeName("swirlFlowRateInletVelocity")
Runtime type information.
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::Vector< scalar >
fixedValueFvPatchFields.H
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54