FreeFOAM The Cross-Platform CFD Toolkit
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) 1991-2010 OpenCFD Ltd.
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 Description
28  Foam::rotatingWallVelocityFvPatchVectorField
29 
30 SourceFiles
31  rotatingWallVelocityFvPatchVectorField.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef rotatingWallVelocityFvPatchVectorField_H
36 #define rotatingWallVelocityFvPatchVectorField_H
37 
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class rotatingWallVelocityFvPatch Declaration
47 \*---------------------------------------------------------------------------*/
48 
50 :
51  public fixedValueFvPatchVectorField
52 {
53  // Private data
54 
55  //- Origin of the rotation
56  vector origin_;
57 
58  //- Axis of the rotation
59  vector axis_;
60 
61  //- Rotational speed
62  scalar omega_;
63 
64 
65 public:
66 
67  //- Runtime type information
68  TypeName("rotatingWallVelocity");
69 
70 
71  // Constructors
72 
73  //- Construct from patch and internal field
75  (
76  const fvPatch&,
78  );
79 
80  //- Construct from patch, internal field and dictionary
82  (
83  const fvPatch&,
85  const dictionary&
86  );
87 
88  //- Construct by mapping given rotatingWallVelocityFvPatchVectorField
89  // onto a new patch
91  (
93  const fvPatch&,
95  const fvPatchFieldMapper&
96  );
97 
98  //- Construct as copy
100  (
102  );
103 
104  //- Construct and return a clone
106  {
108  (
110  );
111  }
112 
113  //- Construct as copy setting internal field reference
115  (
118  );
119 
120  //- Construct and return a clone setting internal field reference
122  (
124  ) const
125  {
127  (
129  );
130  }
131 
132 
133 
134  // Member functions
135 
136  // Access functions
137 
138  //- Return the origin of the rotation
139  const vector& origin() const
140  {
141  return origin_;
142  }
143 
144  //- Return the axis of the rotation
145  const vector& axis() const
146  {
147  return axis_;
148  }
149 
150  //- Return the rotational speed
151  const scalar& omega() const
152  {
153  return omega_;
154  }
155 
156  //- Return non-const access to the origin of the rotation
158  {
159  return origin_;
160  }
161 
162  //- Return non-const access to the axis of the rotation
164  {
165  return axis_;
166  }
167 
168  //- Return non-const access to the rotational speed
169  scalar& omega()
170  {
171  return omega_;
172  }
173 
174 
175  //- Update the coefficients associated with the patch field
176  virtual void updateCoeffs();
177 
178  //- Write
179  virtual void write(Ostream&) const;
180 };
181 
182 
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 
185 } // End namespace Foam
186 
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 
189 #endif
190 
191 // ************************ vim: set sw=4 sts=4 et: ************************ //