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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::rotatingWallVelocityFvPatchVectorField
28
29Group
30 grpWallBoundaryConditions grpGenericBoundaryConditions
31
32Description
33 This boundary condition provides a rotational velocity condition.
34
35Usage
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
56See also
57 Foam::fixedValueFvPatchField
58 Foam::Function1Types
59
60SourceFiles
61 rotatingWallVelocityFvPatchVectorField.C
62
63\*---------------------------------------------------------------------------*/
64
65#ifndef rotatingWallVelocityFvPatchVectorField_H
66#define rotatingWallVelocityFvPatchVectorField_H
67
69#include "Function1.H"
70
71// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
72
73namespace Foam
74{
75
76/*---------------------------------------------------------------------------*\
77 Class rotatingWallVelocityFvPatchVectorField Declaration
78\*---------------------------------------------------------------------------*/
79
80class 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
96public:
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 );
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
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()
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
202// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203
204} // End namespace Foam
205
206// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208#endif
209
210// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A FieldMapper for finite-volume patch fields.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:71
This boundary condition provides a rotational velocity condition.
const vector & origin() const
Return the origin of the rotation.
const vector & axis() const
Return the axis of the rotation.
vector & origin()
Return non-const access to the origin of the rotation.
virtual tmp< fvPatchVectorField > clone(const DimensionedField< vector, volMesh > &iF) const
Construct and return a clone setting internal field reference.
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
TypeName("rotatingWallVelocity")
Runtime type information.
vector & axis()
Return non-const access to the axis of the rotation.
A class for managing temporary objects.
Definition: tmp.H:65
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
Namespace for OpenFOAM.
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73