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 as copy setting internal field reference
138  (
141  );
142 
143  //- Return a clone
144  virtual tmp<fvPatchField<vector>> clone() const
145  {
146  return fvPatchField<vector>::Clone(*this);
147  }
148 
149  //- Clone with an internal field reference
151  (
153  ) const
154  {
155  return fvPatchField<vector>::Clone(*this, iF);
156  }
157 
158 
159  // Member Functions
160 
161  //- True: this patch field is altered by assignment
162  virtual bool assignable() const { return true; }
163 
164 
165  // Access
166 
167  //- Return the name of phi
168  const word& phiName() const
169  {
170  return phiName_;
171  }
172 
173  //- Return reference to the name of phi to allow adjustment
174  word& phiName()
175  {
176  return phiName_;
177  }
178 
179  //- Return the tangential velocity
180  const vectorField& tangentialVelocity() const
181  {
182  return tangentialVelocity_;
183  }
184 
185  //- Reset the tangential velocity
187 
188 
189  // Mapping functions
190 
191  //- Map (and resize as needed) from self given a mapping object
192  virtual void autoMap
193  (
194  const fvPatchFieldMapper&
195  );
196 
197  //- Reverse map the given fvPatchField onto this fvPatchField
198  virtual void rmap
199  (
200  const fvPatchVectorField&,
201  const labelList&
202  );
204 
205  //- Update the coefficients associated with the patch field
206  virtual void updateCoeffs();
207 
208  //- Write
209  virtual void write(Ostream&) const;
210 
212  // Member operators
213 
214  virtual void operator=(const fvPatchField<vector>& pvf);
215 };
216 
217 
218 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
220 } // End namespace Foam
221 
222 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
223 
224 #endif
225 
226 // ************************************************************************* //
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< fvPatchField< vector > > clone() const
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.
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
Definition: fvPatchField.H:597
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...
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Namespace for OpenFOAM.