swirlInletVelocityFvPatchVectorField.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) 2017 OpenFOAM Foundation
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::swirlInletVelocityFvPatchVectorField
28 
29 Group
30  grpInletBoundaryConditions
31 
32 Description
33  This boundary condition describes an inlet vector boundary condition in
34  swirl coordinates given a central axis, central point, axial, radial and
35  tangential velocity profiles.
36 
37 Usage
38  \table
39  Property | Description | Required | Default value
40  axis | Axis of rotation | yes |
41  origin |Origin of rotation | yes |
42  axialVelocity | Axial velocity profile [m/s] | yes |
43  radialVelocity | Radial velocity profile [m/s] | yes |
44  tangentialVelocity | tangential velocity profile [m/s] | yes |
45  \endtable
46 
47  Example of the boundary condition specification:
48  \verbatim
49  <patchName>
50  {
51  type swirlInletVelocity;
52  axis (0 0 1);
53  origin (0 0 0);
54  axialVelocity constant 30;
55  radialVelocity constant 10;
56  tangentialVelocity constant 100;
57  }
58  \endverbatim
59 
60 Note
61  The \c axialVelocity, \c radialVelocity and \c tangentialVelocity entries
62  are Function1 types, able to describe time varying functions. The example
63  above gives the usage for supplying constant values.
64 
65 See also
66  Foam::fixedValueFvPatchField
67  Foam::Function1Types
68 
69 SourceFiles
70  swirlInletVelocityFvPatchVectorField.C
71 
72 \*---------------------------------------------------------------------------*/
73 
74 #ifndef swirlInletVelocityFvPatchVectorField_H
75 #define swirlInletVelocityFvPatchVectorField_H
76 
78 #include "Function1.H"
79 
80 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
81 
82 namespace Foam
83 {
84 /*---------------------------------------------------------------------------*\
85  Class swirlInletVelocityFvPatchVectorField Declaration
86 \*---------------------------------------------------------------------------*/
87 
88 class swirlInletVelocityFvPatchVectorField
89 :
90  public fixedValueFvPatchVectorField
91 {
92  // Private data
93 
94  //- Origin of the rotation
95  const vector origin_;
96 
97  //- Axis of the rotation
98  const vector axis_;
99 
100  //- Axial velocity
101  autoPtr<Function1<scalar>> axialVelocity_;
102 
103  //- Radial velocity
104  autoPtr<Function1<scalar>> radialVelocity_;
105 
106  //- Tangential velocity
107  autoPtr<Function1<scalar>> tangentialVelocity_;
108 
109 
110 public:
111 
112  //- Runtime type information
113  TypeName("swirlInletVelocity");
114 
115 
116  // Constructors
117 
118  //- Construct from patch and internal field
120  (
121  const fvPatch&,
123  );
124 
125  //- Construct from patch, internal field and dictionary
127  (
128  const fvPatch&,
130  const dictionary&
131  );
132 
133  //- Construct by mapping given
134  // flowRateInletVelocityFvPatchVectorField
135  // onto a new patch
137  (
139  const fvPatch&,
141  const fvPatchFieldMapper&
142  );
143 
144  //- Construct as copy
146  (
148  );
149 
150  //- Construct and return a clone
151  virtual tmp<fvPatchVectorField> clone() const
152  {
154  (
156  );
157  }
158 
159  //- Construct as copy setting internal field reference
161  (
164  );
165 
166  //- Construct and return a clone setting internal field reference
168  (
170  ) const
171  {
173  (
175  );
176  }
177 
178 
179  // Member functions
180 
181  //- Update the coefficients associated with the patch field
182  virtual void updateCoeffs();
183 
184  //- Write
185  virtual void write(Ostream&) const;
186 };
187 
188 
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 
191 } // End namespace Foam
192 
193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 
195 #endif
196 
197 // ************************************************************************* //
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Function1.H
Foam::swirlInletVelocityFvPatchVectorField::clone
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
Definition: swirlInletVelocityFvPatchVectorField.H:180
Foam::swirlInletVelocityFvPatchVectorField::write
virtual void write(Ostream &) const
Write.
Definition: swirlInletVelocityFvPatchVectorField.C:154
Foam::swirlInletVelocityFvPatchVectorField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: swirlInletVelocityFvPatchVectorField.C:124
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::swirlInletVelocityFvPatchVectorField
This boundary condition describes an inlet vector boundary condition in swirl coordinates given a cen...
Definition: swirlInletVelocityFvPatchVectorField.H:117
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::vector
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:51
Foam::swirlInletVelocityFvPatchVectorField::swirlInletVelocityFvPatchVectorField
swirlInletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Definition: swirlInletVelocityFvPatchVectorField.C:36
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::swirlInletVelocityFvPatchVectorField::TypeName
TypeName("swirlInletVelocity")
Runtime type information.
Foam::Vector< scalar >
fixedValueFvPatchFields.H
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54