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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::swirlFanVelocityFvPatchField
28
29Group
30 grpCoupledBoundaryConditions
31
32Description
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
67Usage
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
114Note
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
121SourceFiles
122 swirlFanVelocityFvPatchField.C
123
124\*---------------------------------------------------------------------------*/
125
126#ifndef swirlFanVelocityFvPatchField_H
127#define swirlFanVelocityFvPatchField_H
128
130#include "Function1.H"
131
132// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133
134namespace Foam
135{
136
137/*---------------------------------------------------------------------------*\
138 Class swirlFanVelocityFvPatchField Declaration
139\*---------------------------------------------------------------------------*/
140
141class 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
184public:
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 (
211 const swirlFanVelocityFvPatchField&,
212 const fvPatch&,
213 const DimensionedField<vector, volMesh>&,
214 const fvPatchFieldMapper&
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// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
This boundary condition provides a jump condition, using the cyclic condition as a base.
A FieldMapper for finite-volume patch fields.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:71
This boundary condition provides a jump condition for U across a cyclic pressure jump condition and a...
virtual tmp< fvPatchField< vector > > clone() const
Construct and return a clone.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
swirlFanVelocityFvPatchField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
virtual tmp< fvPatchField< vector > > clone(const DimensionedField< vector, volMesh > &iF) const
Construct and return a clone setting internal field reference.
TypeName("swirlFanVelocity")
Runtime type information.
A class for managing temporary objects.
Definition: tmp.H:65
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
A class for handling words, derived from Foam::string.
Definition: word.H:68
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73