pressureInletOutletVelocityFvPatchVectorField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2019 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 Description
28  This velocity inlet/outlet boundary condition is applied to pressure
29  boundaries where the pressure is specified. A zero-gradient condition is
30  applied for outflow (as defined by the flux); for inflow, the velocity is
31  obtained from the patch-face normal component of the internal-cell value.
32 
33  The tangential patch velocity can be optionally specified.
34 
35 Usage
36  \table
37  Property | Description | Required | Default value
38  phi | flux field name | no | phi
39  tangentialVelocity | tangential velocity | no |
40  \endtable
41 
42  Example of the boundary condition specification:
43  \verbatim
44  <patchName>
45  {
46  type pressureInletOutletVelocity;
47  phi phi;
48  tangentialVelocity (0 0 0);
49  value uniform 0;
50  }
51  \endverbatim
52 
53  The \c tangentialVelocity entry is a Function1 of time, see
54  Foam::Function1s.
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 #include "Function1.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
93  autoPtr<Function1<vector>> tangentialVelocity_;
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  //- Copy constructor
131  (
133  );
134 
135  //- Construct and return a clone
136  virtual tmp<fvPatchVectorField> clone() const
137  {
139  (
141  );
142  }
143 
144  //- Copy constructor setting internal field reference
146  (
149  );
151  //- Construct and return a clone setting internal field reference
153  (
155  ) const
156  {
158  (
160  );
161  }
162 
163 
164  // Member Functions
165 
166  // Attributes
168  //- Return true: this patch field is altered by assignment
169  virtual bool assignable() const
170  {
171  return true;
172  }
173 
174 
175  // Access
176 
177  //- Return the name of phi
178  const word& phiName() const
179  {
180  return phiName_;
181  }
182 
183  //- Return reference to the name of phi to allow adjustment
184  word& phiName()
185  {
186  return phiName_;
187  }
188 
189 
190  //- Update the coefficients associated with the patch field
191  virtual void updateCoeffs();
193  //- Write
194  virtual void write(Ostream&) const;
195 
196 
197  // Member Operators
199  virtual void operator=(const fvPatchField<vector>& pvf);
200 };
201 
202 
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 
205 } // End namespace Foam
206 
207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208 
209 #endif
210 
211 // ************************************************************************* //
virtual bool assignable() const
Return true: this patch field is altered by assignment.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:66
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.
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.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
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: PtrList.H:53
Namespace for OpenFOAM.