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 | Copyright (C) 2011-2015 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::rotatingWallVelocityFvPatchVectorField
26 
27 Group
28  grpWallBoundaryConditions grpGenericBoundaryConditions
29 
30 Description
31  This boundary condition provides a rotational velocity condition.
32 
33  \heading Patch usage
34 
35  \table
36  Property | Description | Required | Default value
37  origin | origin of rotation in Cartesian co-ordinates | yes|
38  axis | axis of rotation | yes |
39  omega | angular velocty of the frame [rad/s] | yes |
40  \endtable
41 
42  Example of the boundary condition specification:
43  \verbatim
44  myPatch
45  {
46  type rotatingWallVelocity;
47  origin (0 0 0);
48  axis (0 0 1);
49  omega 100;
50  }
51  \endverbatim
52 
53  The \c omega entry is a DataEntry type, able to describe time varying
54  functions.
55 
56 SeeAlso
57  Foam::DataEntry
58  Foam::fixedValueFvPatchField
59 
60 SourceFiles
61  rotatingWallVelocityFvPatchVectorField.C
62 
63 \*---------------------------------------------------------------------------*/
64 
65 #ifndef rotatingWallVelocityFvPatchVectorField_H
66 #define rotatingWallVelocityFvPatchVectorField_H
67 
69 #include "DataEntry.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
88 
89  //- Axis of the rotation
90  vector axis_;
91 
92  //- Rotational speed
93  autoPtr<DataEntry<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:118
Foam::rotatingWallVelocityFvPatchVectorField::rotatingWallVelocityFvPatchVectorField
rotatingWallVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Definition: rotatingWallVelocityFvPatchVectorField.C:35
Foam::rotatingWallVelocityFvPatchVectorField::origin_
vector origin_
Origin of the rotation.
Definition: rotatingWallVelocityFvPatchVectorField.H:106
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
DataEntry.H
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::rotatingWallVelocityFvPatchVectorField::omega_
autoPtr< DataEntry< scalar > > omega_
Rotational speed.
Definition: rotatingWallVelocityFvPatchVectorField.H:112
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::vector
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:49
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
Foam::rotatingWallVelocityFvPatchVectorField::axis_
vector axis_
Axis of the rotation.
Definition: rotatingWallVelocityFvPatchVectorField.H:109
Foam::Vector< scalar >
fixedValueFvPatchFields.H
Foam::rotatingWallVelocityFvPatchVectorField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: rotatingWallVelocityFvPatchVectorField.C:120
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51
Foam::rotatingWallVelocityFvPatchVectorField::write
virtual void write(Ostream &) const
Write.
Definition: rotatingWallVelocityFvPatchVectorField.C:145