FreeFOAM The Cross-Platform CFD Toolkit
rotatingPressureInletOutletVelocityFvPatchVectorField.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::rotatingPressureInletOutletVelocityFvPatchVectorField
26 
27 Description
28  Velocity inlet/outlet boundary condition in a rotating frame
29  for patches where the pressure is specified. zero-gradient is applied for
30  outflow (as defined by the flux) and for inflow the velocity is obtained
31  from the flux with a direction normal to the patch faces.
32 
33 SourceFiles
34  rotatingPressureInletOutletVelocityFvPatchVectorField.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef rotatingPressureInletOutletVelocityFvPatchVectorField_H
39 #define rotatingPressureInletOutletVelocityFvPatchVectorField_H
40 
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class rotatingPressureInletOutletVelocityFvPatch Declaration
51 \*---------------------------------------------------------------------------*/
52 
54 :
56 {
57  // Private data
58 
59  //- Angular velocity of the frame
60  vector omega_;
61 
62 
63  // Private member functions
64 
65  //- Calculate the tangentialVelocity from omega
66  void calcTangentialVelocity();
67 
68 
69 public:
70 
71  //- Runtime type information
72  TypeName("rotatingPressureInletOutletVelocity");
73 
74 
75  // Constructors
76 
77  //- Construct from patch and internal field
79  (
80  const fvPatch&,
82  );
83 
84  //- Construct from patch, internal field and dictionary
86  (
87  const fvPatch&,
89  const dictionary&
90  );
91 
92  //- Construct by mapping given
93  // rotatingPressureInletOutletVelocityFvPatchVectorField
94  // onto a new patch
96  (
98  const fvPatch&,
100  const fvPatchFieldMapper&
101  );
102 
103  //- Construct as copy
105  (
107  );
108 
109  //- Construct and return a clone
111  {
113  (
115  );
116  }
117 
118  //- Construct as copy setting internal field reference
120  (
123  );
124 
125  //- Construct and return a clone setting internal field reference
127  (
129  ) const
130  {
132  (
134  (
135  *this,
136  iF
137  )
138  );
139  }
140 
141 
142  // Member functions
143 
144  // Access
145 
146  //- Return the angular velocity of rotation
147  const vector& omega() const
148  {
149  return omega_;
150  }
151 
152  //- Reset the angular velocity of rotation
153  // and update the tangentialVelocity
154  void setOmega(const vector& omega)
155  {
156  omega_ = omega;
157  calcTangentialVelocity();
158  }
159 
160 
161  //- Write
162  virtual void write(Ostream&) const;
163 };
164 
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 } // End namespace Foam
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 #endif
173 
174 // ************************ vim: set sw=4 sts=4 et: ************************ //