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-2019 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  omega | angular velocty of the frame [rad/s] | yes |
39  \endtable
40 
41  Example of the boundary condition specification:
42  \verbatim
43  <patchName>
44  {
45  type rotatingPressureInletOutletVelocity;
46  phi phi;
47  tangentialVelocity uniform (0 0 0);
48  omega 100;
49  }
50  \endverbatim
51 
52  The \c omega entry is a Function1 type, able to describe time varying
53  functions.
54 
55 Note
56  Sign conventions:
57  - positive flux (out of domain): apply zero-gradient condition
58  - negative flux (into of domain): derive from the flux in the patch-normal
59  direction
60 
61 See also
62  Foam::pressureInletOutletVelocityFvPatchVectorField
63  Foam::Function1Types
64 
65 SourceFiles
66  rotatingPressureInletOutletVelocityFvPatchVectorField.C
67 
68 \*---------------------------------------------------------------------------*/
69 
70 #ifndef rotatingPressureInletOutletVelocityFvPatchVectorField_H
71 #define rotatingPressureInletOutletVelocityFvPatchVectorField_H
72 
73 #include "fvPatchFields.H"
75 #include "Function1.H"
76 
77 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
78 
79 namespace Foam
80 {
81 
82 /*---------------------------------------------------------------------------*\
83  Class rotatingPressureInletOutletVelocityFvPatchVectorField Declaration
84 \*---------------------------------------------------------------------------*/
85 
86 class rotatingPressureInletOutletVelocityFvPatchVectorField
87 :
88  public pressureInletOutletVelocityFvPatchVectorField
89 {
90  // Private Data
91 
92  //- Angular velocity of the frame
93  autoPtr<Function1<vector>> omega_;
94 
95 
96  // Private Member Functions
97 
98  //- Calculate the tangentialVelocity from omega
99  void calcTangentialVelocity();
100 
101 
102 public:
103 
104  //- Runtime type information
105  TypeName("rotatingPressureInletOutletVelocity");
106 
107 
108  // Constructors
109 
110  //- Construct from patch and internal field
112  (
113  const fvPatch&,
115  );
116 
117  //- Construct from patch, internal field and dictionary
119  (
120  const fvPatch&,
122  const dictionary&
123  );
124 
125  //- Construct by mapping given
126  // rotatingPressureInletOutletVelocityFvPatchVectorField
127  // onto a new patch
129  (
131  const fvPatch&,
133  const fvPatchFieldMapper&
134  );
135 
136  //- Copy constructor
138  (
140  );
141 
142  //- Construct and return a clone
143  virtual tmp<fvPatchVectorField> clone() const
144  {
146  (
148  );
149  }
150 
151  //- Copy constructor setting internal field reference
153  (
156  );
157 
158  //- Construct and return a clone setting internal field reference
160  (
162  ) const
163  {
165  (
167  (
168  *this,
169  iF
170  )
171  );
172  }
173 
174 
175  // Member Functions
176 
177  //- Write
178  virtual void write(Ostream&) const;
179 };
180 
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 } // End namespace Foam
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 
188 #endif
189 
190 // ************************************************************************* //
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:158
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.
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:53
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
Namespace for OpenFOAM.