ibSwirlFlowRateInletVelocityFvPatchVectorField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | foam-extend: Open Source CFD
4  \\ / O peration | Version: 3.2
5  \\ / A nd | Web: http://www.foam-extend.org
6  \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
8 License
9  This file is part of foam-extend.
10 
11  foam-extend 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 3 of the License, or (at your
14  option) any later version.
15 
16  foam-extend is distributed in the hope that it will be useful, but
17  WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  General Public License for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::ibSwirlFlowRateInletVelocityFvPatchVectorField
26 
27 Description
28  Describes a volumetric/mass flow normal vector boundary condition by its
29  magnitude as an integral over its area with a swirl component determined
30  by the RPM
31 
32  The basis of the patch (volumetric or mass) is determined by the
33  dimensions of the flux, phi.
34  The current density is used to correct the velocity when applying the
35  mass basis.
36 
37  The boundary condition is sensitised to work only on live IB cells
38 
39  Example of the boundary condition specification:
40  \verbatim
41  inlet
42  {
43  type ibSwirlFlowRateInletVelocity;
44  flowRate 0.2; // Volumetric/mass flow rate [m3/s or kg/s]
45  rpm 100;
46  }
47  \endverbatim
48 
49 Note
50  - The value is positive inwards
51 
52 SourceFiles
53  ibSwirlFlowRateInletVelocityFvPatchVectorField.C
54 
55 \*---------------------------------------------------------------------------*/
56 
57 #ifndef ibSwirlFlowRateInletVelocityFvPatchVectorField_H
58 #define ibSwirlFlowRateInletVelocityFvPatchVectorField_H
59 
61 
62 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
63 
64 namespace Foam
65 {
66 /*---------------------------------------------------------------------------*\
67  Class ibSwirlFlowRateInletVelocityFvPatchVectorField Declaration
68 \*---------------------------------------------------------------------------*/
69 
71 :
72  public fixedValueFvPatchVectorField
73 {
74  // Private data
75 
76  //- Inlet integral flow rate
77  const scalar flowRate_;
78 
79  //- Name of the flux transporting the field
80  const word phiName_;
81 
82  //- Name of the density field used to normalize the mass flux
83  const word rhoName_;
84 
85  //- RPM
86  const scalar rpm_;
87 
88  // Derived parameters
89 
90  //- Total area of inlet patch
91  scalar totArea_;
92 
93  //- Average centre
95 
96  //- Average normal
98 
99 
100  // Private member functions
101 
102  //- Calculate geometrical characteristics of the patch
103  void calcGeom();
104 
105 
106 public:
107 
108  //- Runtime type information
109  TypeName("ibSwirlFlowRateInletVelocity");
110 
111 
112  // Constructors
113 
114  //- Construct from patch and internal field
116  (
117  const fvPatch&,
119  );
120 
121  //- Construct from patch, internal field and dictionary
123  (
124  const fvPatch&,
126  const dictionary&
127  );
128 
129  //- Construct by mapping given
130  // flowRateInletVelocityFvPatchVectorField
131  // onto a new patch
133  (
135  const fvPatch&,
137  const fvPatchFieldMapper&
138  );
139 
140  //- Construct as copy
142  (
144  );
145 
146  //- Construct and return a clone
147  virtual tmp<fvPatchVectorField> clone() const
148  {
150  (
152  );
153  }
154 
155  //- Construct as copy setting internal field reference
157  (
160  );
161 
162  //- Construct and return a clone setting internal field reference
164  (
166  ) const
167  {
169  (
171  );
172  }
173 
174 
175  // Member functions
176 
177  // Access
178 
179  //- Return the flux
180  scalar flowRate() const
181  {
182  return flowRate_;
183  }
184 
185 
186  //- Update the coefficients associated with the patch field
187  virtual void updateCoeffs();
188 
189  //- Write
190  virtual void write(Ostream&) const;
191 };
192 
193 
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 } // End namespace Foam
197 
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 
200 #endif
201 
202 // ************************************************************************* //
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::ibSwirlFlowRateInletVelocityFvPatchVectorField::ibSwirlFlowRateInletVelocityFvPatchVectorField
ibSwirlFlowRateInletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Definition: ibSwirlFlowRateInletVelocityFvPatchVectorField.C:38
Foam::ibSwirlFlowRateInletVelocityFvPatchVectorField::totArea_
scalar totArea_
Total area of inlet patch.
Definition: ibSwirlFlowRateInletVelocityFvPatchVectorField.H:90
Foam::ibSwirlFlowRateInletVelocityFvPatchVectorField::write
virtual void write(Ostream &) const
Write.
Definition: ibSwirlFlowRateInletVelocityFvPatchVectorField.C:200
Foam::ibSwirlFlowRateInletVelocityFvPatchVectorField::clone
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
Definition: ibSwirlFlowRateInletVelocityFvPatchVectorField.H:146
Foam::ibSwirlFlowRateInletVelocityFvPatchVectorField::TypeName
TypeName("ibSwirlFlowRateInletVelocity")
Runtime type information.
Foam::ibSwirlFlowRateInletVelocityFvPatchVectorField::flowRate
scalar flowRate() const
Return the flux.
Definition: ibSwirlFlowRateInletVelocityFvPatchVectorField.H:179
Foam::ibSwirlFlowRateInletVelocityFvPatchVectorField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: ibSwirlFlowRateInletVelocityFvPatchVectorField.C:143
Foam::ibSwirlFlowRateInletVelocityFvPatchVectorField::avgCenter_
vector avgCenter_
Average centre.
Definition: ibSwirlFlowRateInletVelocityFvPatchVectorField.H:93
Foam::ibSwirlFlowRateInletVelocityFvPatchVectorField::phiName_
const word phiName_
Name of the flux transporting the field.
Definition: ibSwirlFlowRateInletVelocityFvPatchVectorField.H:79
Foam::ibSwirlFlowRateInletVelocityFvPatchVectorField::calcGeom
void calcGeom()
Calculate geometrical characteristics of the patch.
Definition: ibSwirlFlowRateInletVelocityFvPatchVectorField.C:129
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::ibSwirlFlowRateInletVelocityFvPatchVectorField::avgNormal_
vector avgNormal_
Average normal.
Definition: ibSwirlFlowRateInletVelocityFvPatchVectorField.H:96
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::ibSwirlFlowRateInletVelocityFvPatchVectorField
Describes a volumetric/mass flow normal vector boundary condition by its magnitude as an integral ove...
Definition: ibSwirlFlowRateInletVelocityFvPatchVectorField.H:69
Foam::Vector< scalar >
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::ibSwirlFlowRateInletVelocityFvPatchVectorField::flowRate_
const scalar flowRate_
Inlet integral flow rate.
Definition: ibSwirlFlowRateInletVelocityFvPatchVectorField.H:76
Foam::ibSwirlFlowRateInletVelocityFvPatchVectorField::rhoName_
const word rhoName_
Name of the density field used to normalize the mass flux.
Definition: ibSwirlFlowRateInletVelocityFvPatchVectorField.H:82
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51
Foam::ibSwirlFlowRateInletVelocityFvPatchVectorField::rpm_
const scalar rpm_
RPM.
Definition: ibSwirlFlowRateInletVelocityFvPatchVectorField.H:85