rotatingWallVelocityFvPatchVectorField.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-2016 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::rotatingWallVelocityFvPatchVectorField
28 
29 Group
30  grpWallBoundaryConditions grpGenericBoundaryConditions
31 
32 Description
33  This boundary condition provides a rotational velocity condition.
34 
35 Usage
36  \table
37  Property | Description | Required | Default value
38  origin | origin of rotation in Cartesian coordinates | yes|
39  axis | axis of rotation | yes |
40  omega | angular velocty of the frame [rad/s] | yes |
41  \endtable
42 
43  Example of the boundary condition specification:
44  \verbatim
45  <patchName>
46  {
47  type rotatingWallVelocity;
48  origin (0 0 0);
49  axis (0 0 1);
50  omega 100;
51  }
52  \endverbatim
53 
54  The \c omega entry is a Function1 of time, see Foam::Function1Types.
55 
56 See also
57  Foam::fixedValueFvPatchField
58  Foam::Function1Types
59 
60 SourceFiles
61  rotatingWallVelocityFvPatchVectorField.C
62 
63 \*---------------------------------------------------------------------------*/
64 
65 #ifndef rotatingWallVelocityFvPatchVectorField_H
66 #define rotatingWallVelocityFvPatchVectorField_H
67 
69 #include "Function1.H"
70 
71 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
72 
73 namespace Foam
74 {
75 
76 /*---------------------------------------------------------------------------*\
77  Class rotatingWallVelocityFvPatchVectorField Declaration
78 \*---------------------------------------------------------------------------*/
79 
80 class rotatingWallVelocityFvPatchVectorField
81 :
82  public fixedValueFvPatchVectorField
83 {
84  // Private data
85 
86  //- Origin of the rotation
87  vector origin_;
88 
89  //- Axis of the rotation
90  vector axis_;
91 
92  //- Rotational speed
93  autoPtr<Function1<scalar>> omega_;
94 
95 
96 public:
97 
98  //- Runtime type information
99  TypeName("rotatingWallVelocity");
100 
101 
102  // Constructors
103 
104  //- Construct from patch and internal field
106  (
107  const fvPatch&,
109  );
110 
111  //- Construct from patch, internal field and dictionary
113  (
114  const fvPatch&,
116  const dictionary&
117  );
118 
119  //- Construct by mapping given rotatingWallVelocityFvPatchVectorField
120  // onto a new patch
122  (
124  const fvPatch&,
126  const fvPatchFieldMapper&
127  );
128 
129  //- Construct as copy
131  (
133  );
134 
135  //- Construct as copy setting internal field reference
137  (
140  );
141 
142  //- Return a clone
143  virtual tmp<fvPatchField<vector>> clone() const
144  {
145  return fvPatchField<vector>::Clone(*this);
146  }
147 
148  //- Clone with an internal field reference
150  (
152  ) const
153  {
154  return fvPatchField<vector>::Clone(*this, iF);
155  }
156 
157 
158  // Member functions
159 
160  // Access functions
161 
162  //- Return the origin of the rotation
163  const vector& origin() const
164  {
165  return origin_;
166  }
167 
168  //- Return the axis of the rotation
169  const vector& axis() const
170  {
171  return axis_;
172  }
173 
174  //- Return non-const access to the origin of the rotation
175  vector& origin()
176  {
177  return origin_;
178  }
180  //- Return non-const access to the axis of the rotation
181  vector& axis()
182  {
183  return axis_;
184  }
185 
186 
187  //- Update the coefficients associated with the patch field
188  virtual void updateCoeffs();
189 
190  //- Write
191  virtual void write(Ostream&) const;
192 };
193 
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 } // End namespace Foam
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 
201 #endif
202 
203 // ************************************************************************* //
rotatingWallVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
const vector & origin() const
Return the origin of the rotation.
TypeName("rotatingWallVelocity")
Runtime type information.
This boundary condition provides a rotational velocity condition.
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
Definition: fvPatchField.H:597
A FieldMapper for finite-volume patch fields.
Vector< scalar > vector
Definition: vector.H:57
virtual tmp< fvPatchField< vector > > clone() const
Return a clone.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
const vector & axis() const
Return the axis of the rotation.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Namespace for OpenFOAM.