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 and return a clone
136  virtual tmp<fvPatchVectorField> clone() const
137  {
139  (
141  );
142  }
143 
144  //- Construct as copy setting internal field reference
146  (
149  );
150 
151  //- Construct and return a clone setting internal field reference
153  (
155  ) const
156  {
158  (
160  );
161  }
162 
163 
164 
165  // Member functions
166 
167  // Access functions
168 
169  //- Return the origin of the rotation
170  const vector& origin() const
171  {
172  return origin_;
173  }
174 
175  //- Return the axis of the rotation
176  const vector& axis() const
177  {
178  return axis_;
179  }
180 
181  //- Return non-const access to the origin of the rotation
182  vector& origin()
183  {
184  return origin_;
185  }
186 
187  //- Return non-const access to the axis of the rotation
188  vector& axis()
189  {
190  return axis_;
191  }
192 
193 
194  //- Update the coefficients associated with the patch field
195  virtual void updateCoeffs();
196 
197  //- Write
198  virtual void write(Ostream&) const;
199 };
200 
201 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 } // End namespace Foam
205 
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 
208 #endif
209 
210 // ************************************************************************* //
Foam::rotatingWallVelocityFvPatchVectorField
This boundary condition provides a rotational velocity condition.
Definition: rotatingWallVelocityFvPatchVectorField.H:99
Foam::rotatingWallVelocityFvPatchVectorField::axis
vector & axis()
Return non-const access to the axis of the rotation.
Definition: rotatingWallVelocityFvPatchVectorField.H:207
Foam::rotatingWallVelocityFvPatchVectorField::TypeName
TypeName("rotatingWallVelocity")
Runtime type information.
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::rotatingWallVelocityFvPatchVectorField::rotatingWallVelocityFvPatchVectorField
rotatingWallVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Definition: rotatingWallVelocityFvPatchVectorField.C:38
Function1.H
Foam::rotatingWallVelocityFvPatchVectorField::clone
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
Definition: rotatingWallVelocityFvPatchVectorField.H:155
Foam::rotatingWallVelocityFvPatchVectorField::axis
const vector & axis() const
Return the axis of the rotation.
Definition: rotatingWallVelocityFvPatchVectorField.H:195
Foam::rotatingWallVelocityFvPatchVectorField::origin
vector & origin()
Return non-const access to the origin of the rotation.
Definition: rotatingWallVelocityFvPatchVectorField.H:201
Foam::rotatingWallVelocityFvPatchVectorField::origin
const vector & origin() const
Return the origin of the rotation.
Definition: rotatingWallVelocityFvPatchVectorField.H:189
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
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::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::Vector< scalar >
fixedValueFvPatchFields.H
Foam::rotatingWallVelocityFvPatchVectorField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: rotatingWallVelocityFvPatchVectorField.C:123
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
Foam::rotatingWallVelocityFvPatchVectorField::write
virtual void write(Ostream &) const
Write.
Definition: rotatingWallVelocityFvPatchVectorField.C:148