swirlFanVelocityFvPatchField.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) 2018-2022 OpenCFD Ltd.
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::swirlFanVelocityFvPatchField
28 
29 Group
30  grpCoupledBoundaryConditions
31 
32 Description
33  This boundary condition provides a jump condition for \c U across a
34  cyclic pressure jump condition and applies a transformation to \c U.
35 
36  The U-jump is specified with a swirl component as follows:
37  \verbatim
38  Utan = deltaP/rEff/fanEff/(rpm*pi/30.0);
39 
40  where
41 
42  deltaP : pressure drop across the cyclic.
43  rEff : effective radius
44  fanEff : fan efficiency coefficient
45  rpm : RPM of the fan
46  \endverbatim
47 
48  Alternatively an inner and outer radii can be used instead of \c rEff.
49  The \c Utan is as follow for \c r > \c rInner and \c r < \c rOuter
50  \verbatim
51  Utan = deltaP/r/fanEff/(rpm/pi/30.0);
52 
53  where
54 
55  r : p - origin, p is the face center
56  \endverbatim
57 
58  Outside \c rInner and \c rOuter, \c Utan=0. The input for this mode is:
59  \verbatim
60  useRealRadius true;
61  rInner 0.005;
62  rOuter 0.01;
63  \endverbatim
64 
65  The radial velocity is zero in the present model.
66 
67 Usage
68  Example of the boundary condition specification:
69  \verbatim
70  <patchName>
71  {
72  // Mandatory entries
73  type swirlFanVelocity;
74  patchType cyclic;
75  rpm <Function1>;
76 
77  // Optional entries
78  phi <word>;
79  p <word>;
80  rho <word>;
81  origin <vector>;
82  fanEff <scalar>;
83  rEff <scalar>;
84  rInner <scalar>;
85  rOuter <scalar>;
86  useRealRadius <bool>;
87 
88  // Inherited entries
89  ...
90  }
91  \endverbatim
92 
93  where the entries mean:
94  \table
95  Property | Description | Type | Reqd | Deflt
96  type | Type name: swirlFanVelocity | word | yes | -
97  patchType | Underlying patch type: cyclic | word | yes | -
98  rpm | RPM of the fan | Function1<scalar> | yes | -
99  phi | Name of flux field | word | no | phi
100  rho | Name of density field | word | no | rho
101  p | Name of pressure field | word | no | p
102  origin | Fan centre | vector | no | calculated
103  fanEff | Fan efficiency | scalar | no | 1
104  rEff | Effective radius | scalar | no | 0
105  rInner | Inner radius | scalar | no | 0
106  rOuter | Outer radius | scalar | no | 0
107  useRealRadius| Flag to use inner/outer radii | bool | no | false
108  \endtable
109 
110  The inherited entries are elaborated in:
111  - \link fixedJumpFvPatchField.H \endlink
112  - \link Function1.H \endlink
113 
114 Note
115  - Negative \c rpm will reverse the input tangential direction.
116  - This boundary condition needs to be used with a pressure-jump (e.g. fan)
117  condition with a non-zero dp, otherwise no swirl will be applied (dp=0).
118  - Please ensure physical and complementary set-ups for the pressure-jump
119  and \c swirlFanVelocity boundary conditions.
120 
121 SourceFiles
122  swirlFanVelocityFvPatchField.C
123 
124 \*---------------------------------------------------------------------------*/
125 
126 #ifndef swirlFanVelocityFvPatchField_H
127 #define swirlFanVelocityFvPatchField_H
128 
129 #include "fixedJumpFvPatchField.H"
130 #include "Function1.H"
131 
132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133 
134 namespace Foam
135 {
136 
137 /*---------------------------------------------------------------------------*\
138  Class swirlFanVelocityFvPatchField Declaration
139 \*---------------------------------------------------------------------------*/
140 
141 class swirlFanVelocityFvPatchField
142 :
143  public fixedJumpFvPatchField<vector>
144 {
145  // Private data
146 
147  //- Name of the flux field
148  const word phiName_;
149 
150  //- Name of the pressure field
151  const word pName_;
152 
153  //- Name of the rho field
154  const word rhoName_;
155 
156  //- Origin of the rotation
157  const vector origin_;
158 
159  //- Fan rpm
160  autoPtr<Function1<scalar>> rpm_;
161 
162  //- Fan efficiency
163  scalar fanEff_;
164 
165  //- Effective fan radius
166  scalar rEff_;
167 
168  //- Inner radius
169  scalar rInner_;
170 
171  //- Outer radius
172  scalar rOuter_;
173 
174  //- Switch to use effective radius or inner and outer radius
175  bool useRealRadius_;
176 
177 
178  // Private Member Functions
179 
180  //- Calculate the fan pressure jump
181  void calcFanJump();
182 
183 
184 public:
185 
186  //- Runtime type information
187  TypeName("swirlFanVelocity");
188 
189 
190  // Constructors
191 
192  //- Construct from patch and internal field
194  (
195  const fvPatch&,
196  const DimensionedField<vector, volMesh>&
197  );
198 
199  //- Construct from patch, internal field and dictionary
201  (
202  const fvPatch&,
203  const DimensionedField<vector, volMesh>&,
204  const dictionary&
205  );
206 
207  //- Construct by mapping given swirlFanVelocityFvPatchField
208  //- onto a new patch
210  (
212  const fvPatch&,
213  const DimensionedField<vector, volMesh>&,
215  );
216 
217  //- Construct as copy
219  (
221  );
222 
223  //- Construct and return a clone
224  virtual tmp<fvPatchField<vector>> clone() const
225  {
227  (
229  );
230  }
231 
232  //- Construct as copy setting internal field reference
234  (
237  );
238 
239  //- Construct and return a clone setting internal field reference
241  (
243  ) const
244  {
246  (
247  new swirlFanVelocityFvPatchField(*this, iF)
248  );
249  }
250 
251 
252  // Member functions
253 
254  //- Update the coefficients associated with the patch field
255  virtual void updateCoeffs();
256 
257  //- Write
258  virtual void write(Ostream& os) const;
259 };
260 
261 
262 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
263 
264 } // End namespace Foam
265 
266 #endif
267 
268 // ************************************************************************* //
This boundary condition provides a jump condition for U across a cyclic pressure jump condition and a...
TypeName("swirlFanVelocity")
Runtime type information.
A FieldMapper for finite-volume patch fields.
Vector< scalar > vector
Definition: vector.H:57
virtual tmp< fvPatchField< vector > > clone() const
Construct and return a clone.
swirlFanVelocityFvPatchField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
OBJstream os(runTime.globalPath()/outputName)
virtual void write(Ostream &os) const
Write.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: areaFieldsFwd.H:42
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Namespace for OpenFOAM.