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-2016 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 Usage
39  \table
40  Property | Description | Required | Default value
41  phi | flux field name | no | phi
42  tangentialVelocity | tangential velocity field | no |
43  \endtable
44 
45  Example of the boundary condition specification:
46  \verbatim
47  <patchName>
48  {
49  type pressureInletOutletVelocity;
50  phi phi;
51  tangentialVelocity uniform (0 0 0);
52  value uniform 0;
53  }
54  \endverbatim
55 
56 Note
57  Sign conventions:
58  - positive flux (out of domain): apply zero-gradient condition
59  - negative flux (into of domain): derive from the flux in the patch-normal
60  direction
61 
62 SourceFiles
63  pressureInletOutletVelocityFvPatchVectorField.C
64 
65 \*---------------------------------------------------------------------------*/
66 
67 #ifndef pressureInletOutletVelocityFvPatchVectorField_H
68 #define pressureInletOutletVelocityFvPatchVectorField_H
69 
70 #include "fvPatchFields.H"
72 
73 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
74 
75 namespace Foam
76 {
77 
78 /*---------------------------------------------------------------------------*\
79  Class pressureInletOutletVelocityFvPatchVectorField Declaration
80 \*---------------------------------------------------------------------------*/
81 
82 class pressureInletOutletVelocityFvPatchVectorField
83 :
84  public directionMixedFvPatchVectorField
85 {
86  // Private data
87 
88  //- Flux field name
89  word phiName_;
90 
91  //- Optional tangential velocity component
92  vectorField tangentialVelocity_;
93 
94 
95 public:
96 
97  //- Runtime type information
98  TypeName("pressureInletOutletVelocity");
99 
100 
101  // Constructors
102 
103  //- Construct from patch and internal field
105  (
106  const fvPatch&,
108  );
109 
110  //- Construct from patch, internal field and dictionary
112  (
113  const fvPatch&,
115  const dictionary&
116  );
117 
118  //- Construct by mapping given
119  // pressureInletOutletVelocityFvPatchVectorField onto a new patch
121  (
123  const fvPatch&,
125  const fvPatchFieldMapper&
126  );
127 
128  //- Construct as copy
130  (
132  );
133 
134  //- Construct and return a clone
135  virtual tmp<fvPatchVectorField> clone() const
136  {
138  (
140  );
141  }
142 
143  //- Construct as copy setting internal field reference
145  (
148  );
150  //- Construct and return a clone setting internal field reference
152  (
154  ) const
155  {
157  (
159  );
160  }
161 
162 
163  // Member functions
164 
165  // Attributes
167  //- Return true: this patch field is altered by assignment
168  virtual bool assignable() const
169  {
170  return true;
171  }
172 
173 
174  // Access
175 
176  //- Return the name of phi
177  const word& phiName() const
178  {
179  return phiName_;
180  }
181 
182  //- Return reference to the name of phi to allow adjustment
183  word& phiName()
184  {
185  return phiName_;
186  }
187 
188  //- Return the tangential velocity
189  const vectorField& tangentialVelocity() const
190  {
191  return tangentialVelocity_;
192  }
193 
194  //- Reset the tangential velocity
196 
198  // Mapping functions
199 
200  //- Map (and resize as needed) from self given a mapping object
201  virtual void autoMap
202  (
204  );
205 
206  //- Reverse map the given fvPatchField onto this fvPatchField
207  virtual void rmap
208  (
209  const fvPatchVectorField&,
210  const labelList&
211  );
212 
213 
214  //- Update the coefficients associated with the patch field
215  virtual void updateCoeffs();
216 
217  //- Write
218  virtual void write(Ostream&) const;
219 
220 
221  // Member operators
222 
223  virtual void operator=(const fvPatchField<vector>& pvf);
224 };
225 
226 
227 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
228 
229 } // End namespace Foam
230 
231 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
232 
233 #endif
234 
235 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
const vectorField & tangentialVelocity() const
Return the tangential velocity.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
virtual bool assignable() const
Return true: this patch field is altered by assignment.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:65
pressureInletOutletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
This velocity inlet/outlet boundary condition is applied to pressure boundaries where the pressure is...
A class for handling words, derived from string.
Definition: word.H:59
Foam::fvPatchFieldMapper.
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:53
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...
Field< vector > vectorField
Specialisation of Field<T> for vector.
A class for managing temporary objects.
Definition: PtrList.H:54
Namespace for OpenFOAM.