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 
164 
165  // Member functions
166 
167  // Attributes
168 
169  //- Return true: this patch field is altered by assignment
170  virtual bool assignable() const
171  {
172  return true;
173  }
174 
175 
176  // Access
177 
178  //- Return the name of phi
179  const word& phiName() const
180  {
181  return phiName_;
182  }
183 
184  //- Return reference to the name of phi to allow adjustment
185  word& phiName()
186  {
187  return phiName_;
188  }
189 
190  //- Return the tangential velocity
191  const vectorField& tangentialVelocity() const
192  {
193  return tangentialVelocity_;
194  }
195 
196  //- Reset the tangential velocity
198 
199 
200  // Mapping functions
201 
202  //- Map (and resize as needed) from self given a mapping object
203  virtual void autoMap
204  (
206  );
207 
208  //- Reverse map the given fvPatchField onto this fvPatchField
209  virtual void rmap
210  (
211  const fvPatchVectorField&,
212  const labelList&
213  );
214 
215 
216  //- Update the coefficients associated with the patch field
217  virtual void updateCoeffs();
218 
219  //- Write
220  virtual void write(Ostream&) const;
221 
222 
223  // Member operators
224 
225  virtual void operator=(const fvPatchField<vector>& pvf);
226 };
227 
228 
229 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
230 
231 } // End namespace Foam
232 
233 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
234 
235 #endif
236 
237 // ************************************************************************* //
Foam::fvPatchField< vector >
Foam::pressureInletOutletVelocityFvPatchVectorField::assignable
virtual bool assignable() const
Return true: this patch field is altered by assignment.
Definition: pressureInletOutletVelocityFvPatchVectorField.H:184
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::pressureInletOutletVelocityFvPatchVectorField::clone
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
Definition: pressureInletOutletVelocityFvPatchVectorField.H:151
Foam::pressureInletOutletVelocityFvPatchVectorField::write
virtual void write(Ostream &) const
Write.
Definition: pressureInletOutletVelocityFvPatchVectorField.C:188
Foam::pressureInletOutletVelocityFvPatchVectorField::tangentialVelocity
const vectorField & tangentialVelocity() const
Return the tangential velocity.
Definition: pressureInletOutletVelocityFvPatchVectorField.H:205
directionMixedFvPatchFields.H
Foam::pressureInletOutletVelocityFvPatchVectorField::pressureInletOutletVelocityFvPatchVectorField
pressureInletOutletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Definition: pressureInletOutletVelocityFvPatchVectorField.C:39
Foam::pressureInletOutletVelocityFvPatchVectorField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: pressureInletOutletVelocityFvPatchVectorField.C:170
Foam::vectorField
Field< vector > vectorField
Specialisation of Field<T> for vector.
Definition: primitiveFieldsFwd.H:54
Foam::pressureInletOutletVelocityFvPatchVectorField::phiName
const word & phiName() const
Return the name of phi.
Definition: pressureInletOutletVelocityFvPatchVectorField.H:193
Foam::Field< vector >
Foam::pressureInletOutletVelocityFvPatchVectorField::TypeName
TypeName("pressureInletOutletVelocity")
Runtime type information.
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::pressureInletOutletVelocityFvPatchVectorField::rmap
virtual void rmap(const fvPatchVectorField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: pressureInletOutletVelocityFvPatchVectorField.C:153
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::pressureInletOutletVelocityFvPatchVectorField::phiName
word & phiName()
Return reference to the name of phi to allow adjustment.
Definition: pressureInletOutletVelocityFvPatchVectorField.H:199
fvPatchFields.H
Foam::List< label >
Foam::pressureInletOutletVelocityFvPatchVectorField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: pressureInletOutletVelocityFvPatchVectorField.C:140
Foam::pressureInletOutletVelocityFvPatchVectorField::operator=
virtual void operator=(const fvPatchField< vector > &pvf)
Definition: pressureInletOutletVelocityFvPatchVectorField.C:206
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::pressureInletOutletVelocityFvPatchVectorField::setTangentialVelocity
void setTangentialVelocity(const vectorField &tangentialVelocity)
Reset the tangential velocity.
Definition: pressureInletOutletVelocityFvPatchVectorField.C:131
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54
Foam::pressureInletOutletVelocityFvPatchVectorField
This velocity inlet/outlet boundary condition is applied to velocity boundaries where the pressure is...
Definition: pressureInletOutletVelocityFvPatchVectorField.H:98