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-2012 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  \heading Patch usage
41 
42  \table
43  Property | Description | Required | Default value
44  phi | flux field name | no | phi
45  rho | density field name | no | rho
46  flowRate | flow rate profile | yes |
47  rpm | rotational speed profile | yes |
48  \endtable
49 
50  Example of the boundary condition specification:
51  \verbatim
52  myPatch
53  {
54  type swirlFlowRateInletVelocity;
55  flowRate constant 0.2;
56  rpm constant 100;
57  }
58  \endverbatim
59 
60 Note
61  - the \c flowRate and \c rpm entries are DataEntry types, able to describe
62  time varying functions. The example above gives the usage for supplying
63  constant values.
64  - the value is positive into the domain
65 
66 SeeAlso
67  Foam::fixedValueFvPatchField
68 
69 SourceFiles
70  swirlFlowRateInletVelocityFvPatchVectorField.C
71 
72 \*---------------------------------------------------------------------------*/
73 
74 #ifndef swirlFlowRateInletVelocityFvPatchVectorField_H
75 #define swirlFlowRateInletVelocityFvPatchVectorField_H
76 
78 #include "DataEntry.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<DataEntry<scalar> > flowRate_;
102 
103  //- Angular speed in revolutions per minute (RPM)
104  autoPtr<DataEntry<scalar> > rpm_;
105 
106 
107 public:
108 
109  //- Runtime type information
110  TypeName("swirlFlowRateInletVelocity");
111 
112 
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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 
190 } // End namespace Foam
191 
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 
194 #endif
195 
196 // ************************************************************************* //
Foam::swirlFlowRateInletVelocityFvPatchVectorField::rpm_
autoPtr< DataEntry< scalar > > rpm_
Angular speed in revolutions per minute (RPM)
Definition: swirlFlowRateInletVelocityFvPatchVectorField.H:128
Foam::swirlFlowRateInletVelocityFvPatchVectorField::swirlFlowRateInletVelocityFvPatchVectorField
swirlFlowRateInletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Definition: swirlFlowRateInletVelocityFvPatchVectorField.C:37
Foam::swirlFlowRateInletVelocityFvPatchVectorField
This boundary condition provides a volumetric- OR mass-flow normal vector boundary condition by its m...
Definition: swirlFlowRateInletVelocityFvPatchVectorField.H:112
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::swirlFlowRateInletVelocityFvPatchVectorField::write
virtual void write(Ostream &) const
Write.
Definition: swirlFlowRateInletVelocityFvPatchVectorField.C:171
Foam::swirlFlowRateInletVelocityFvPatchVectorField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: swirlFlowRateInletVelocityFvPatchVectorField.C:114
Foam::swirlFlowRateInletVelocityFvPatchVectorField::clone
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
Definition: swirlFlowRateInletVelocityFvPatchVectorField.H:172
DataEntry.H
Foam::swirlFlowRateInletVelocityFvPatchVectorField::phiName_
const word phiName_
Name of the flux transporting the field.
Definition: swirlFlowRateInletVelocityFvPatchVectorField.H:119
Foam::swirlFlowRateInletVelocityFvPatchVectorField::flowRate_
autoPtr< DataEntry< scalar > > flowRate_
Inlet integral flow rate.
Definition: swirlFlowRateInletVelocityFvPatchVectorField.H:125
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::swirlFlowRateInletVelocityFvPatchVectorField::TypeName
TypeName("swirlFlowRateInletVelocity")
Runtime type information.
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
Foam::swirlFlowRateInletVelocityFvPatchVectorField::rhoName_
const word rhoName_
Name of the density field used to normalize the mass flux.
Definition: swirlFlowRateInletVelocityFvPatchVectorField.H:122
fixedValueFvPatchFields.H
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51