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 | 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::pressureInletOutletVelocityFvPatchVectorField
28 
29 Group
30  grpInletBoundaryConditions grpOutletBoundaryConditions
31 
32 Description
33  This velocity inlet/outlet boundary condition is applied to velocity
34  boundaries where the pressure is specified. A zero-gradient condition is
35  applied for outflow (as defined by the flux); for inflow, the velocity is
36  obtained from the patch-face normal component of the internal-cell value.
37 
38  The tangential patch velocity can be optionally specified.
39 
40 Usage
41  \table
42  Property | Description | Required | Default value
43  phi | flux field name | no | phi
44  tangentialVelocity | tangential velocity field | no |
45  \endtable
46 
47  Example of the boundary condition specification:
48  \verbatim
49  <patchName>
50  {
51  type pressureInletOutletVelocity;
52  phi phi;
53  tangentialVelocity uniform (0 0 0);
54  value uniform (0 0 0);
55  }
56  \endverbatim
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 SourceFiles
65  pressureInletOutletVelocityFvPatchVectorField.C
66 
67 \*---------------------------------------------------------------------------*/
68 
69 #ifndef pressureInletOutletVelocityFvPatchVectorField_H
70 #define pressureInletOutletVelocityFvPatchVectorField_H
71 
72 #include "fvPatchFields.H"
74 
75 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
76 
77 namespace Foam
78 {
79 
80 /*---------------------------------------------------------------------------*\
81  Class pressureInletOutletVelocityFvPatchVectorField Declaration
82 \*---------------------------------------------------------------------------*/
83 
84 class pressureInletOutletVelocityFvPatchVectorField
85 :
86  public directionMixedFvPatchVectorField
87 {
88  // Private data
89 
90  //- Flux field name
91  word phiName_;
92 
93  //- Optional tangential velocity component
94  vectorField tangentialVelocity_;
95 
96 
97 public:
98 
99  //- Runtime type information
100  TypeName("pressureInletOutletVelocity");
101 
102 
103  // Constructors
104 
105  //- Construct from patch and internal field
107  (
108  const fvPatch&,
110  );
111 
112  //- Construct from patch, internal field and dictionary
114  (
115  const fvPatch&,
117  const dictionary&
118  );
119 
120  //- Construct by mapping given
121  // pressureInletOutletVelocityFvPatchVectorField onto a new patch
123  (
125  const fvPatch&,
127  const fvPatchFieldMapper&
128  );
129 
130  //- Construct as copy
132  (
134  );
135 
136  //- Construct and return a clone
137  virtual tmp<fvPatchVectorField> clone() const
138  {
140  (
142  );
143  }
144 
145  //- Construct as copy setting internal field reference
147  (
150  );
151 
152  //- Construct and return a clone setting internal field reference
154  (
156  ) const
157  {
159  (
161  );
162  }
163 
165  // Member Functions
166 
167  //- True: this patch field is altered by assignment
168  virtual bool assignable() const { return true; }
169 
170 
171  // Access
172 
173  //- Return the name of phi
174  const word& phiName() const
175  {
176  return phiName_;
177  }
178 
179  //- Return reference to the name of phi to allow adjustment
180  word& phiName()
181  {
182  return phiName_;
183  }
184 
185  //- Return the tangential velocity
186  const vectorField& tangentialVelocity() const
187  {
188  return tangentialVelocity_;
189  }
190 
191  //- Reset the tangential velocity
193 
194 
195  // Mapping functions
196 
197  //- Map (and resize as needed) from self given a mapping object
198  virtual void autoMap
199  (
200  const fvPatchFieldMapper&
201  );
202 
203  //- Reverse map the given fvPatchField onto this fvPatchField
204  virtual void rmap
205  (
206  const fvPatchVectorField&,
207  const labelList&
208  );
210 
211  //- Update the coefficients associated with the patch field
212  virtual void updateCoeffs();
213 
214  //- Write
215  virtual void write(Ostream&) const;
216 
218  // Member operators
219 
220  virtual void operator=(const fvPatchField<vector>& pvf);
221 };
222 
223 
224 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
226 } // End namespace Foam
227 
228 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229 
230 #endif
231 
232 // ************************************************************************* //
virtual bool assignable() const
True: this patch field is altered by assignment.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
pressureInletOutletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
const vectorField & tangentialVelocity() const
Return the tangential velocity.
This velocity inlet/outlet boundary condition is applied to velocity boundaries where the pressure is...
A class for handling words, derived from Foam::string.
Definition: word.H:63
A FieldMapper for finite-volume patch fields.
TypeName("pressureInletOutletVelocity")
Runtime type information.
virtual void rmap(const fvPatchVectorField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
void setTangentialVelocity(const vectorField &tangentialVelocity)
Reset the tangential velocity.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: areaFieldsFwd.H:42
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Namespace for OpenFOAM.