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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::rotatingPressureInletOutletVelocityFvPatchVectorField
28 
29 Group
30  grpInletBoundaryConditions grpOutletBoundaryConditions
31 
32 Description
33  This velocity inlet/outlet boundary condition is applied to patches in a
34  rotating frame where the pressure is specified. A zero-gradient is applied
35  for outflow (as defined by the flux); for inflow, the velocity is obtained
36  from the flux with a direction normal to the patch faces.
37 
38 Usage
39  \table
40  Property | Description | Required | Default value
41  phi | flux field name | no | phi
42  tangentialVelocity | tangential velocity field | no |
43  omega | angular velocity of the frame [rad/s] | yes |
44  \endtable
45 
46  Example of the boundary condition specification:
47  \verbatim
48  <patchName>
49  {
50  type rotatingPressureInletOutletVelocity;
51  phi phi;
52  tangentialVelocity uniform (0 0 0);
53  omega 100;
54  }
55  \endverbatim
56 
57  The \c omega entry is a Function1 type, able to describe time varying
58  functions.
59 
60 Note
61  Sign conventions:
62  - positive flux (out of domain): apply zero-gradient condition
63  - negative flux (into of domain): derive from the flux in the patch-normal
64  direction
65 
66 See also
67  Foam::pressureInletOutletVelocityFvPatchVectorField
68  Foam::Function1Types
69 
70 SourceFiles
71  rotatingPressureInletOutletVelocityFvPatchVectorField.C
72 
73 \*---------------------------------------------------------------------------*/
74 
75 #ifndef rotatingPressureInletOutletVelocityFvPatchVectorField_H
76 #define rotatingPressureInletOutletVelocityFvPatchVectorField_H
77 
78 #include "fvPatchFields.H"
80 #include "Function1.H"
81 
82 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
83 
84 namespace Foam
85 {
86 
87 /*---------------------------------------------------------------------------*\
88  Class rotatingPressureInletOutletVelocityFvPatchVectorField Declaration
89 \*---------------------------------------------------------------------------*/
90 
91 class rotatingPressureInletOutletVelocityFvPatchVectorField
92 :
93  public pressureInletOutletVelocityFvPatchVectorField
94 {
95  // Private data
96 
97  //- Angular velocity of the frame
98  autoPtr<Function1<vector>> omega_;
99 
100 
101  // Private Member Functions
102 
103  //- Calculate the tangentialVelocity from omega
104  void calcTangentialVelocity();
105 
106 
107 public:
108 
109  //- Runtime type information
110  TypeName("rotatingPressureInletOutletVelocity");
111 
112 
113  // Constructors
114 
115  //- Construct from patch and internal field
117  (
118  const fvPatch&,
120  );
121 
122  //- Construct from patch, internal field and dictionary
124  (
125  const fvPatch&,
127  const dictionary&
128  );
129 
130  //- Construct by mapping given
131  // rotatingPressureInletOutletVelocityFvPatchVectorField
132  // onto a new patch
134  (
136  const fvPatch&,
138  const fvPatchFieldMapper&
139  );
140 
141  //- Construct as copy
143  (
145  );
146 
147  //- Construct and return a clone
148  virtual tmp<fvPatchVectorField> clone() const
149  {
151  (
153  );
154  }
155 
156  //- Construct as copy setting internal field reference
158  (
161  );
162 
163  //- Construct and return a clone setting internal field reference
165  (
167  ) const
168  {
170  (
172  (
173  *this,
174  iF
175  )
176  );
177  }
178 
179 
180  // Member functions
181 
182  //- Write
183  virtual void write(Ostream&) const;
184 };
185 
186 
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 
189 } // End namespace Foam
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 #endif
194 
195 // ************************************************************************* //
Foam::rotatingPressureInletOutletVelocityFvPatchVectorField::rotatingPressureInletOutletVelocityFvPatchVectorField
rotatingPressureInletOutletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Definition: rotatingPressureInletOutletVelocityFvPatchVectorField.C:57
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:59
Function1.H
Foam::rotatingPressureInletOutletVelocityFvPatchVectorField::TypeName
TypeName("rotatingPressureInletOutletVelocity")
Runtime type information.
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::rotatingPressureInletOutletVelocityFvPatchVectorField::clone
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
Definition: rotatingPressureInletOutletVelocityFvPatchVectorField.H:167
pressureInletOutletVelocityFvPatchVectorField.H
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
fvPatchFields.H
Foam::rotatingPressureInletOutletVelocityFvPatchVectorField
This velocity inlet/outlet boundary condition is applied to patches in a rotating frame where the pre...
Definition: rotatingPressureInletOutletVelocityFvPatchVectorField.H:110
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::rotatingPressureInletOutletVelocityFvPatchVectorField::write
virtual void write(Ostream &) const
Write.
Definition: rotatingPressureInletOutletVelocityFvPatchVectorField.C:129
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54
Foam::pressureInletOutletVelocityFvPatchVectorField
This velocity inlet/outlet boundary condition is applied to pressure boundaries where the pressure is...
Definition: pressureInletOutletVelocityFvPatchVectorField.H:98