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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2017 OpenFOAM Foundation
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::swirlFlowRateInletVelocityFvPatchVectorField
28
29Group
30 grpInletBoundaryConditions
31
32Description
33 This boundary condition provides a volumetric- OR mass-flow normal vector
34 boundary condition by its magnitude as an integral over its area with a
35 swirl component determined by the angular speed, given in revolutions per
36 minute (RPM)
37
38 The basis of the patch (volumetric or mass) is determined by the
39 dimensions of the flux, phi. The current density is used to correct the
40 velocity when applying the mass basis.
41
42Usage
43 \table
44 Property | Description | Required | Default value
45 phi | flux field name | no | phi
46 rho | density field name | no | rho
47 origin | origin of rotation | no | patch centre
48 axis | axis of rotation | no | -(patch normal)
49 flowRate | flow rate profile | yes |
50 rpm | rotational speed profile | yes |
51 \endtable
52
53 Example of the boundary condition specification:
54 \verbatim
55 <patchName>
56 {
57 type swirlFlowRateInletVelocity;
58 flowRate constant 0.2;
59 rpm constant 100;
60 }
61 \endverbatim
62
63Note
64 - the \c flowRate and \c rpm entries are Function1 types, able to describe
65 time varying functions. The example above gives the usage for supplying
66 constant values.
67 - the value is positive into the domain
68
69See also
70 Foam::fixedValueFvPatchField
71 Foam::Function1Types
72
73SourceFiles
74 swirlFlowRateInletVelocityFvPatchVectorField.C
75
76\*---------------------------------------------------------------------------*/
77
78#ifndef swirlFlowRateInletVelocityFvPatchVectorField_H
79#define swirlFlowRateInletVelocityFvPatchVectorField_H
80
82#include "Function1.H"
83
84// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
85
86namespace Foam
87{
88/*---------------------------------------------------------------------------*\
89 Class swirlFlowRateInletVelocityFvPatchVectorField Declaration
90\*---------------------------------------------------------------------------*/
91
92class swirlFlowRateInletVelocityFvPatchVectorField
93:
94 public fixedValueFvPatchVectorField
95{
96 // Private data
97
98 //- Name of the flux transporting the field
99 const word phiName_;
100
101 //- Name of the density field used to normalize the mass flux
102 const word rhoName_;
103
104 //- Origin of the rotation
105 const vector origin_;
106
107 //- Axis of the rotation
108 const vector axis_;
109
110 //- Inlet integral flow rate
111 autoPtr<Function1<scalar>> flowRate_;
112
113 //- Angular speed in revolutions per minute (RPM)
114 autoPtr<Function1<scalar>> rpm_;
115
116
117public:
118
119 //- Runtime type information
120 TypeName("swirlFlowRateInletVelocity");
121
122
123 // Constructors
124
125 //- Construct from patch and internal field
127 (
128 const fvPatch&,
130 );
131
132 //- Construct from patch, internal field and dictionary
134 (
135 const fvPatch&,
137 const dictionary&
138 );
139
140 //- Construct by mapping given
141 // flowRateInletVelocityFvPatchVectorField
142 // onto a new patch
144 (
146 const fvPatch&,
148 const fvPatchFieldMapper&
149 );
150
151 //- Construct as copy
153 (
155 );
156
157 //- Construct and return a clone
158 virtual tmp<fvPatchVectorField> clone() const
159 {
161 (
163 );
164 }
165
166 //- Construct as copy setting internal field reference
168 (
171 );
172
173 //- Construct and return a clone setting internal field reference
175 (
177 ) const
178 {
180 (
182 );
183 }
184
185
186 // Member functions
187
188 // Access
189
190 //- Update the coefficients associated with the patch field
191 virtual void updateCoeffs();
193 //- Write
194 virtual void write(Ostream&) const;
195};
196
197
198// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199
200} // End namespace Foam
201
202// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203
204#endif
205
206// ************************************************************************* //
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
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 volumetric- OR mass-flow normal vector boundary condition by its m...
virtual tmp< fvPatchVectorField > clone(const DimensionedField< vector, volMesh > &iF) const
Construct and return a clone setting internal field reference.
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
TypeName("swirlFlowRateInletVelocity")
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
Namespace for OpenFOAM.
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73