FreeFOAM The Cross-Platform CFD Toolkit
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) 2010-2010 OpenCFD Ltd.
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 the
13  Free Software Foundation; either version 2 of the License, or (at your
14  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, write to the Free Software Foundation,
23  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 
25 Class
26  Foam::swirlFlowRateInletVelocityFvPatchVectorField
27 
28 Description
29  Describes a volumetric/mass flow normal vector boundary condition by its
30  magnitude as an integral over its area with a swirl component determined
31  by the RPM
32 
33  The basis of the patch (volumetric or mass) is determined by the
34  dimensions of the flux, phi.
35  The current density is used to correct the velocity when applying the
36  mass basis.
37 
38  Example of the boundary condition specification:
39  @verbatim
40  inlet
41  {
42  type swirlFlowRateInletVelocity;
43  flowRate 0.2; // Volumetric/mass flow rate [m3/s or kg/s]
44  rpm 100;
45  }
46  @endverbatim
47 
48 Note
49  - The value is positive inwards
50 
51 SourceFiles
52  swirlFlowRateInletVelocityFvPatchVectorField.C
53 
54 \*---------------------------------------------------------------------------*/
55 
56 #ifndef swirlFlowRateInletVelocityFvPatchVectorField_H
57 #define swirlFlowRateInletVelocityFvPatchVectorField_H
58 
60 
61 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
62 
63 namespace Foam
64 {
65 /*---------------------------------------------------------------------------*\
66  Class swirlFlowRateInletVelocityFvPatchVectorField Declaration
67 \*---------------------------------------------------------------------------*/
68 
70 :
71  public fixedValueFvPatchVectorField
72 {
73  // Private data
74 
75  //- Inlet integral flow rate
76  const scalar flowRate_;
77 
78  //- Name of the flux transporting the field
79  const word phiName_;
80 
81  //- Name of the density field used to normalize the mass flux
82  const word rhoName_;
83 
84  //- RPM
85  const scalar rpm_;
86 
87 
88 public:
89 
90  //- Runtime type information
91  TypeName("swirlFlowRateInletVelocity");
92 
93 
94  // Constructors
95 
96  //- Construct from patch and internal field
98  (
99  const fvPatch&,
101  );
102 
103  //- Construct from patch, internal field and dictionary
105  (
106  const fvPatch&,
108  const dictionary&
109  );
110 
111  //- Construct by mapping given
112  // flowRateInletVelocityFvPatchVectorField
113  // onto a new patch
115  (
117  const fvPatch&,
119  const fvPatchFieldMapper&
120  );
121 
122  //- Construct as copy
124  (
126  );
127 
128  //- Construct and return a clone
130  {
132  (
134  );
135  }
136 
137  //- Construct as copy setting internal field reference
139  (
142  );
143 
144  //- Construct and return a clone setting internal field reference
146  (
148  ) const
149  {
151  (
153  );
154  }
155 
156 
157  // Member functions
158 
159  // Access
160 
161  //- Return the flux
162  scalar flowRate() const
163  {
164  return flowRate_;
165  }
166 
167 
168  //- Update the coefficients associated with the patch field
169  virtual void updateCoeffs();
170 
171  //- Write
172  virtual void write(Ostream&) const;
173 
174 };
175 
176 
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 
179 } // End namespace Foam
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 #endif
184 
185 // ************************************************************************* //