rotatingPressureInletOutletVelocityFvPatchVectorField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2023 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::rotatingPressureInletOutletVelocityFvPatchVectorField
26 
27 Description
28  This velocity inlet/outlet boundary condition is applied to patches in a
29  rotating frame where the pressure is specified. A zero-gradient is applied
30  for outflow (as defined by the flux); for inflow, the velocity is obtained
31  from the flux with a direction normal to the patch faces.
32 
33 Usage
34  \table
35  Property | Description | Required | Default value
36  phi | flux field name | no | phi
37  tangentialVelocity | tangential velocity field | no |
38  origin | origin of rotation in Cartesian co-ordinates | yes|
39  axis | axis of rotation | yes |
40  omega | angular velocity of the frame [rad/s] | no |
41  rpm | angular velocity of the frame [rpm] | no |
42  \endtable
43 
44  Example of the boundary condition specification:
45  \verbatim
46  <patchName>
47  {
48  type rotatingPressureInletOutletVelocity;
49  phi phi;
50  tangentialVelocity uniform (0 0 0);
51  origin (0 0 0);
52  axis (0 0 1);
53  rpm 100;
54  }
55  \endverbatim
56 
57  The \c omega or \c rpm entries are Function1 of time, see Foam::Function1s.
58 
59  Note:
60  Sign conventions:
61  - positive flux (out of domain): apply zero-gradient condition
62  - negative flux (into of domain): derive from the flux in the patch-normal
63  direction
64 
65 See also
66  Foam::pressureInletOutletVelocityFvPatchVectorField
67  Foam::Function1s
68 
69 SourceFiles
70  rotatingPressureInletOutletVelocityFvPatchVectorField.C
71 
72 \*---------------------------------------------------------------------------*/
73 
74 #ifndef rotatingPressureInletOutletVelocityFvPatchVectorField_H
75 #define rotatingPressureInletOutletVelocityFvPatchVectorField_H
76 
77 #include "fvPatchFields.H"
79 #include "omega.H"
80 
81 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
82 
83 namespace Foam
84 {
85 
86 /*---------------------------------------------------------------------------*\
87  Class rotatingPressureInletOutletVelocityFvPatchVectorField Declaration
88 \*---------------------------------------------------------------------------*/
89 
90 class rotatingPressureInletOutletVelocityFvPatchVectorField
91 :
92  public pressureInletOutletVelocityFvPatchVectorField
93 {
94  // Private Data
95 
96  //- Origin of the rotation
97  vector origin_;
98 
99  //- Axis of the rotation
100  vector axis_;
101 
102  //- Angular velocity of the frame (rad/sec)
103  Function1s::omega omega_;
104 
105 
106  // Private Member Functions
107 
108  //- Calculate the tangentialVelocity from omega
109  void calcTangentialVelocity();
110 
111 
112 public:
113 
114  //- Runtime type information
115  TypeName("rotatingPressureInletOutletVelocity");
116 
117 
118  // Constructors
119 
120  //- Construct from patch, internal field and dictionary
122  (
123  const fvPatch&,
125  const dictionary&
126  );
127 
128  //- Construct by mapping given
129  // rotatingPressureInletOutletVelocityFvPatchVectorField
130  // onto a new patch
132  (
134  const fvPatch&,
136  const fvPatchFieldMapper&
137  );
138 
139  //- Disallow copy without setting internal field reference
141  (
143  ) = delete;
144 
145  //- Copy constructor setting internal field reference
147  (
150  );
151 
152  //- Construct and return a clone setting internal field reference
154  (
156  ) const
157  {
159  (
161  (
162  *this,
163  iF
164  )
165  );
166  }
167 
168 
169  // Member Functions
170 
171  //- Write
172  virtual void write(Ostream&) const;
173 };
174 
175 
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 
178 } // End namespace Foam
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 #endif
183 
184 // ************************************************************************* //
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:57
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Foam::fvPatchFieldMapper.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:64
This velocity inlet/outlet boundary condition is applied to patches in a rotating frame where the pre...
virtual tmp< fvPatchVectorField > clone(const DimensionedField< vector, volMesh > &iF) const
Construct and return a clone setting internal field reference.
rotatingPressureInletOutletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
TypeName("rotatingPressureInletOutletVelocity")
Runtime type information.
A class for managing temporary objects.
Definition: tmp.H:55
const scalar omega
Namespace for OpenFOAM.
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:49