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-2020 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  //- Disallow copy without setting internal field reference
131  (
133  ) = delete;
134 
135  //- Copy constructor setting internal field reference
137  (
140  );
141 
142  //- Construct and return a clone setting internal field reference
144  (
146  ) const
147  {
149  (
151  );
152  }
153 
154 
155  // Member Functions
156 
157  // Attributes
159  //- Return true: this patch field is altered by assignment
160  virtual bool assignable() const
161  {
162  return true;
163  }
164 
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 
181  //- Update the coefficients associated with the patch field
182  virtual void updateCoeffs();
184  //- Write
185  virtual void write(Ostream&) const;
186 
187 
188  // Member Operators
190  virtual void operator=(const fvPatchField<vector>& pvf);
191 };
192 
193 
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 } // End namespace Foam
197 
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 
200 #endif
201 
202 // ************************************************************************* //
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:156
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:62
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:66
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.
virtual tmp< fvPatchVectorField > clone(const DimensionedField< vector, volMesh > &iF) const
Construct and return a clone setting internal field reference.
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.