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) 2011-2016 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 Group
28  grpInletBoundaryConditions grpOutletBoundaryConditions
29 
30 Description
31  This velocity inlet/outlet boundary condition is applied to patches in a
32  rotating frame where the pressure is specified. A zero-gradient is applied
33  for outflow (as defined by the flux); for inflow, the velocity is obtained
34  from the flux with a direction normal to the patch faces.
35 
36 Usage
37  \table
38  Property | Description | Required | Default value
39  phi | flux field name | no | phi
40  tangentialVelocity | tangential velocity field | no |
41  omega | angular velocty of the frame [rad/s] | yes |
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  omega 100;
52  }
53  \endverbatim
54 
55  The \c omega entry is a Function1 type, able to describe time varying
56  functions.
57 
58 Note
59  Sign conventions:
60  - positive flux (out of domain): apply zero-gradient condition
61  - negative flux (into of domain): derive from the flux in the patch-normal
62  direction
63 
64 See also
65  Foam::pressureInletOutletVelocityFvPatchVectorField
66  Foam::Function1Types
67 
68 SourceFiles
69  rotatingPressureInletOutletVelocityFvPatchVectorField.C
70 
71 \*---------------------------------------------------------------------------*/
72 
73 #ifndef rotatingPressureInletOutletVelocityFvPatchVectorField_H
74 #define rotatingPressureInletOutletVelocityFvPatchVectorField_H
75 
76 #include "fvPatchFields.H"
78 #include "Function1.H"
79 
80 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
81 
82 namespace Foam
83 {
84 
85 /*---------------------------------------------------------------------------*\
86  Class rotatingPressureInletOutletVelocityFvPatchVectorField Declaration
87 \*---------------------------------------------------------------------------*/
88 
89 class rotatingPressureInletOutletVelocityFvPatchVectorField
90 :
91  public pressureInletOutletVelocityFvPatchVectorField
92 {
93  // Private data
94 
95  //- Angular velocity of the frame
96  autoPtr<Function1<vector>> omega_;
97 
98 
99  // Private Member Functions
100 
101  //- Calculate the tangentialVelocity from omega
102  void calcTangentialVelocity();
103 
104 
105 public:
106 
107  //- Runtime type information
108  TypeName("rotatingPressureInletOutletVelocity");
109 
110 
111  // Constructors
112 
113  //- Construct from patch and internal field
115  (
116  const fvPatch&,
118  );
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  //- Construct as copy
141  (
143  );
144 
145  //- Construct and return a clone
146  virtual tmp<fvPatchVectorField> clone() const
147  {
149  (
151  );
152  }
153 
154  //- Construct as copy setting internal field reference
156  (
159  );
160 
161  //- Construct and return a clone setting internal field reference
163  (
165  ) const
166  {
168  (
170  (
171  *this,
172  iF
173  )
174  );
175  }
176 
177 
178  // Member functions
179 
180  //- Write
181  virtual void write(Ostream&) const;
182 };
183 
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 } // End namespace Foam
188 
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 
191 #endif
192 
193 // ************************************************************************* //
This velocity inlet/outlet boundary condition is applied to patches in a rotating frame where the pre...
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
rotatingPressureInletOutletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
Foam::fvPatchFieldMapper.
TypeName("rotatingPressureInletOutletVelocity")
Runtime type information.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A class for managing temporary objects.
Definition: PtrList.H:54
Namespace for OpenFOAM.