pressureInletOutletVelocityFvPatchVectorField.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::pressureInletOutletVelocityFvPatchVectorField
26 
27 Group
28  grpInletletBoundaryConditions grpOutletBoundaryConditions
29 
30 Description
31  This velocity inlet/outlet boundary condition is applied to pressure
32  boundaries where the pressure is specified. A zero-gradient condition is
33  applied for outflow (as defined by the flux); for inflow, the velocity is
34  obtained from the patch-face normal component of the internal-cell value.
35 
36  The tangential patch velocity can be optionally specified.
37 
38  \heading Patch usage
39 
40  \table
41  Property | Description | Required | Default value
42  phi | flux field name | no | phi
43  tangentialVelocity | tangential velocity field | no |
44  \endtable
45 
46  Example of the boundary condition specification:
47  \verbatim
48  myPatch
49  {
50  type pressureInletOutletVelocity;
51  phi phi;
52  tangentialVelocity uniform (0 0 0);
53  value uniform 0;
54  }
55  \endverbatim
56 
57 Note
58  Sign conventions:
59  - positive flux (out of domain): apply zero-gradient condition
60  - negative flux (into of domain): derive from the flux in the patch-normal
61  direction
62 
63 SourceFiles
64  pressureInletOutletVelocityFvPatchVectorField.C
65 
66 \*---------------------------------------------------------------------------*/
67 
68 #ifndef pressureInletOutletVelocityFvPatchVectorField_H
69 #define pressureInletOutletVelocityFvPatchVectorField_H
70 
71 #include "fvPatchFields.H"
73 
74 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
75 
76 namespace Foam
77 {
78 
79 /*---------------------------------------------------------------------------*\
80  Class pressureInletOutletVelocityFvPatchVectorField Declaration
81 \*---------------------------------------------------------------------------*/
82 
83 class pressureInletOutletVelocityFvPatchVectorField
84 :
85  public directionMixedFvPatchVectorField
86 {
87  // Private data
88 
89  //- Flux field name
90  word phiName_;
91 
92  //- Optional tangential velocity component
93  vectorField tangentialVelocity_;
94 
95 
96 public:
97 
98  //- Runtime type information
99  TypeName("pressureInletOutletVelocity");
100 
101 
102  // Constructors
103 
104  //- Construct from patch and internal field
106  (
107  const fvPatch&,
109  );
110 
111  //- Construct from patch, internal field and dictionary
113  (
114  const fvPatch&,
116  const dictionary&
117  );
118 
119  //- Construct by mapping given
120  // pressureInletOutletVelocityFvPatchVectorField onto a new patch
122  (
124  const fvPatch&,
126  const fvPatchFieldMapper&
127  );
128 
129  //- Construct as copy
131  (
133  );
134 
135  //- Construct and return a clone
136  virtual tmp<fvPatchVectorField> clone() const
137  {
139  (
141  );
142  }
143 
144  //- Construct as copy setting internal field reference
146  (
149  );
151  //- Construct and return a clone setting internal field reference
153  (
155  ) const
156  {
158  (
160  );
161  }
162 
163 
164  // Member functions
165 
166  // Access
168  //- Return the name of phi
169  const word& phiName() const
170  {
171  return phiName_;
172  }
173 
174  //- Return reference to the name of phi to allow adjustment
175  word& phiName()
176  {
177  return phiName_;
178  }
179 
180  //- Return the tangential velocity
181  const vectorField& tangentialVelocity() const
182  {
183  return tangentialVelocity_;
184  }
185 
186  //- Reset the tangential velocity
188 
190  // Mapping functions
191 
192  //- Map (and resize as needed) from self given a mapping object
193  virtual void autoMap
194  (
196  );
197 
198  //- Reverse map the given fvPatchField onto this fvPatchField
199  virtual void rmap
200  (
201  const fvPatchVectorField&,
202  const labelList&
203  );
204 
205 
206  //- Update the coefficients associated with the patch field
207  virtual void updateCoeffs();
208 
209  //- Write
210  virtual void write(Ostream&) const;
211 
212 
213  // Member operators
214 
215  virtual void operator=(const fvPatchField<vector>& pvf);
216 };
217 
218 
219 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
220 
221 } // End namespace Foam
222 
223 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
224 
225 #endif
226 
227 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
void setTangentialVelocity(const vectorField &tangentialVelocity)
Reset the tangential velocity.
A class for handling words, derived from string.
Definition: word.H:59
Foam::fvPatchFieldMapper.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
pressureInletOutletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Namespace for OpenFOAM.
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
Field< vector > vectorField
Specialisation of Field<T> for vector.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:65
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
TypeName("pressureInletOutletVelocity")
Runtime type information.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
const vectorField & tangentialVelocity() const
Return the tangential velocity.
This velocity inlet/outlet boundary condition is applied to pressure boundaries where the pressure is...
A class for managing temporary objects.
Definition: PtrList.H:118
virtual void rmap(const fvPatchVectorField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.