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
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  );
150 
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
167 
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  {
184  }
185 
186  //- Reset the tangential velocity
188 
189 
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 // ************************************************************************* //
Foam::fvPatchField
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:65
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::pressureInletOutletVelocityFvPatchVectorField::clone
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
Definition: pressureInletOutletVelocityFvPatchVectorField.H:150
Foam::pressureInletOutletVelocityFvPatchVectorField::write
virtual void write(Ostream &) const
Write.
Definition: pressureInletOutletVelocityFvPatchVectorField.C:184
Foam::pressureInletOutletVelocityFvPatchVectorField::tangentialVelocity
const vectorField & tangentialVelocity() const
Return the tangential velocity.
Definition: pressureInletOutletVelocityFvPatchVectorField.H:195
directionMixedFvPatchFields.H
Foam::pressureInletOutletVelocityFvPatchVectorField::pressureInletOutletVelocityFvPatchVectorField
pressureInletOutletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Definition: pressureInletOutletVelocityFvPatchVectorField.C:36
Foam::pressureInletOutletVelocityFvPatchVectorField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: pressureInletOutletVelocityFvPatchVectorField.C:166
Foam::vectorField
Field< vector > vectorField
Specialisation of Field<T> for vector.
Definition: primitiveFieldsFwd.H:49
Foam::pressureInletOutletVelocityFvPatchVectorField::phiName
const word & phiName() const
Return the name of phi.
Definition: pressureInletOutletVelocityFvPatchVectorField.H:183
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::pressureInletOutletVelocityFvPatchVectorField::TypeName
TypeName("pressureInletOutletVelocity")
Runtime type information.
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::pressureInletOutletVelocityFvPatchVectorField::rmap
virtual void rmap(const fvPatchVectorField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: pressureInletOutletVelocityFvPatchVectorField.C:149
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::pressureInletOutletVelocityFvPatchVectorField::phiName_
word phiName_
Flux field name.
Definition: pressureInletOutletVelocityFvPatchVectorField.H:104
Foam::pressureInletOutletVelocityFvPatchVectorField::phiName
word & phiName()
Return reference to the name of phi to allow adjustment.
Definition: pressureInletOutletVelocityFvPatchVectorField.H:189
fvPatchFields.H
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::pressureInletOutletVelocityFvPatchVectorField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: pressureInletOutletVelocityFvPatchVectorField.C:136
Foam::pressureInletOutletVelocityFvPatchVectorField::operator=
virtual void operator=(const fvPatchField< vector > &pvf)
Definition: pressureInletOutletVelocityFvPatchVectorField.C:202
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::pressureInletOutletVelocityFvPatchVectorField::setTangentialVelocity
void setTangentialVelocity(const vectorField &tangentialVelocity)
Reset the tangential velocity.
Definition: pressureInletOutletVelocityFvPatchVectorField.C:127
Foam::pressureInletOutletVelocityFvPatchVectorField::tangentialVelocity_
vectorField tangentialVelocity_
Optional tangential velocity component.
Definition: pressureInletOutletVelocityFvPatchVectorField.H:107
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