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-2014 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  \heading Patch usage
37 
38  \table
39  Property | Description | Required | Default value
40  phi | flux field name | no | phi
41  tangentialVelocity | tangential velocity field | no |
42  omega | angular velocty of the frame [rad/s] | yes |
43  \endtable
44 
45  Example of the boundary condition specification:
46  \verbatim
47  myPatch
48  {
49  type rotatingPressureInletOutletVelocity;
50  phi phi;
51  tangentialVelocity uniform (0 0 0);
52  omega 100;
53  }
54  \endverbatim
55 
56  The \c omega entry is a DataEntry type, able to describe time varying
57  functions.
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 SeeAlso
66  Foam::pressureInletOutletVelocityFvPatchVectorField
67 
68 SourceFiles
69  rotatingPressureInletOutletVelocityFvPatchVectorField.C
70 
71 \*---------------------------------------------------------------------------*/
72 
73 #ifndef rotatingPressureInletOutletVelocityFvPatchVectorField_H
74 #define rotatingPressureInletOutletVelocityFvPatchVectorField_H
75 
76 #include "fvPatchFields.H"
78 #include "DataEntry.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<DataEntry<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 // ************************************************************************* //
Foam::rotatingPressureInletOutletVelocityFvPatchVectorField::rotatingPressureInletOutletVelocityFvPatchVectorField
rotatingPressureInletOutletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Definition: rotatingPressureInletOutletVelocityFvPatchVectorField.C:54
Foam::rotatingPressureInletOutletVelocityFvPatchVectorField::calcTangentialVelocity
void calcTangentialVelocity()
Calculate the tangentialVelocity from omega.
Definition: rotatingPressureInletOutletVelocityFvPatchVectorField.C:34
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::rotatingPressureInletOutletVelocityFvPatchVectorField::omega_
autoPtr< DataEntry< vector > > omega_
Angular velocity of the frame.
Definition: rotatingPressureInletOutletVelocityFvPatchVectorField.H:115
Foam::rotatingPressureInletOutletVelocityFvPatchVectorField::TypeName
TypeName("rotatingPressureInletOutletVelocity")
Runtime type information.
DataEntry.H
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::rotatingPressureInletOutletVelocityFvPatchVectorField::clone
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
Definition: rotatingPressureInletOutletVelocityFvPatchVectorField.H:165
pressureInletOutletVelocityFvPatchVectorField.H
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
fvPatchFields.H
Foam::rotatingPressureInletOutletVelocityFvPatchVectorField
This velocity inlet/outlet boundary condition is applied to patches in a rotating frame where the pre...
Definition: rotatingPressureInletOutletVelocityFvPatchVectorField.H:108
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::rotatingPressureInletOutletVelocityFvPatchVectorField::write
virtual void write(Ostream &) const
Write.
Definition: rotatingPressureInletOutletVelocityFvPatchVectorField.C:125
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51
Foam::pressureInletOutletVelocityFvPatchVectorField
This velocity inlet/outlet boundary condition is applied to pressure boundaries where the pressure is...
Definition: pressureInletOutletVelocityFvPatchVectorField.H:97