Merge branch 'master' of ssh://git.code.sf.net/p/foam-extend/foam-extend-3.2
[foam-extend-3.2.git] / src / finiteVolume / fields / fvPatchFields / derived / movingRotatingWallVelocity / movingRotatingWallVelocityFvPatchVectorField.H
blob6eabca87783c1db95fa28b7427de5b6fe4a88450
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | foam-extend: Open Source CFD
4    \\    /   O peration     | Version:     3.2
5     \\  /    A nd           | Web:         http://www.foam-extend.org
6      \\/     M anipulation  | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
8 License
9     This file is part of foam-extend.
11     foam-extend is free software: you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation, either version 3 of the License, or (at your
14     option) any later version.
16     foam-extend is distributed in the hope that it will be useful, but
17     WITHOUT ANY WARRANTY; without even the implied warranty of
18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19     General Public License for more details.
21     You should have received a copy of the GNU General Public License
22     along with foam-extend.  If not, see <http://www.gnu.org/licenses/>.
24 Class
25     movingRotatingWallVelocityFvPatchVectorField
27 Description
28     movingRotatingWallVelocityFvPatchVectorField
30 Author
31     Hrvoje Jasak, Wikki Ltd.  All rights reserved.
33 SourceFiles
34     movingRotatingWallVelocityFvPatchVectorField.C
36 \*---------------------------------------------------------------------------*/
38 #ifndef movingRotatingWallVelocityFvPatchVectorField_H
39 #define movingRotatingWallVelocityFvPatchVectorField_H
41 #include "fvPatchFields.H"
42 #include "fixedValueFvPatchFields.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 namespace Foam
49 /*---------------------------------------------------------------------------*\
50          Class movingRotatingWallVelocityFvPatchVectorField Declaration
51 \*---------------------------------------------------------------------------*/
53 class movingRotatingWallVelocityFvPatchVectorField
55     public fixedValueFvPatchVectorField
57     // Private data
59         //- Centre of rotation
60         point centre_;
62         //- Rotation axis
63         vector axis_;
65         //- Rotational speed in rpm
66         scalar rpm_;
69 public:
71     //- Runtime type information
72     TypeName("movingRotatingWallVelocity");
75     // Constructors
77         //- Construct from patch and internal field
78         movingRotatingWallVelocityFvPatchVectorField
79         (
80             const fvPatch&,
81             const DimensionedField<vector, volMesh>&
82         );
84         //- Construct from components
85         movingRotatingWallVelocityFvPatchVectorField
86         (
87             const fvPatch&,
88             const DimensionedField<vector, volMesh>&,
89             const point& centre,
90             const vector& axis,
91             const scalar rpm
92         );
94         //- Construct from patch, internal field and dictionary
95         movingRotatingWallVelocityFvPatchVectorField
96         (
97             const fvPatch&,
98             const DimensionedField<vector, volMesh>&,
99             const dictionary&
100         );
102         //- Construct by mapping given
103         //  movingRotatingWallVelocityFvPatchVectorField
104         //  onto a new patch
105         movingRotatingWallVelocityFvPatchVectorField
106         (
107             const movingRotatingWallVelocityFvPatchVectorField&,
108             const fvPatch&,
109             const DimensionedField<vector, volMesh>&,
110             const fvPatchFieldMapper&
111         );
113         //- Construct as copy
114         movingRotatingWallVelocityFvPatchVectorField
115         (
116             const movingRotatingWallVelocityFvPatchVectorField&
117         );
119         //- Construct and return a clone
120         virtual tmp<fvPatchVectorField> clone() const
121         {
122             return tmp<fvPatchVectorField>
123             (
124                 new movingRotatingWallVelocityFvPatchVectorField(*this)
125             );
126         }
128         //- Construct as copy setting internal field reference
129         movingRotatingWallVelocityFvPatchVectorField
130         (
131             const movingRotatingWallVelocityFvPatchVectorField&,
132             const DimensionedField<vector, volMesh>&
133         );
135         //- Construct and return a clone setting internal field reference
136         virtual tmp<fvPatchVectorField> clone
137         (
138             const DimensionedField<vector, volMesh>& iF
139         ) const
140         {
141             return tmp<fvPatchVectorField>
142             (
143                 new movingRotatingWallVelocityFvPatchVectorField(*this, iF)
144             );
145         }
149     // Member functions
151         // Access
153             //- Return centre of rotation
154             const point& centre() const
155             {
156                 return centre_;
157             }
159             //- Return axis of rotation
160             const vector& axis() const
161             {
162                 return axis_;
163             }
165             //- Return rpm
166             scalar rpm() const
167             {
168                 return rpm_;
169             }
172         // Edit
174             //- Return access to centre of rotation
175             point& centre()
176             {
177                 return centre_;
178             }
180             //- Return access to axis of rotation
181             vector& axis()
182             {
183                 return axis_;
184             }
186             //- Return access to rpm
187             scalar& rpm()
188             {
189                 return rpm_;
190             }
193         //- Update the coefficients associated with the patch field
194         virtual void updateCoeffs();
196         //- Write
197         virtual void write(Ostream&) const;
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 } // End namespace Foam
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 #endif
209 // ************************************************************************* //