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-2022 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  Velocity inlet/outlet boundary condition for patches where the pressure is
29  specified in some manner, e.g. fixedValue, totalPressure,
30  entrainmentPressure etc.
31 
32  This boundary condition is directionMixed:
33  Flux outflow: zeroGradient condition
34  Flux inflow: zeroGradient condition for normal component
35  fixedValue for tangential component
36 
37  The external tangential velocity can be optionally specified otherwise it
38  is assumed zero.
39 
40 Usage
41  \table
42  Property | Description | Required | Default value
43  phi | flux field name | no | phi
44  tangentialVelocity | tangential velocity | no |
45  \endtable
46 
47  Example of the boundary condition specification:
48  \verbatim
49  <patchName>
50  {
51  type pressureInletOutletVelocity;
52  phi phi;
53  tangentialVelocity (0 0 0);
54  value uniform 0;
55  }
56  \endverbatim
57 
58  The \c tangentialVelocity entry is a Function1 of time, see
59  Foam::Function1s.
60 
61 See also
62  Foam::directionMixedFvPatchVectorField
63  Foam::totalPressureFvPatchScalarField
64  Foam::entrainmentPressureFvPatchScalarField
65  Foam::fixedValueFvPatchField
66 
67 SourceFiles
68  pressureInletOutletVelocityFvPatchVectorField.C
69 
70 \*---------------------------------------------------------------------------*/
71 
72 #ifndef pressureInletOutletVelocityFvPatchVectorField_H
73 #define pressureInletOutletVelocityFvPatchVectorField_H
74 
75 #include "fvPatchFields.H"
77 #include "Function1.H"
78 
79 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
80 
81 namespace Foam
82 {
83 
84 /*---------------------------------------------------------------------------*\
85  Class pressureInletOutletVelocityFvPatchVectorField Declaration
86 \*---------------------------------------------------------------------------*/
87 
88 class pressureInletOutletVelocityFvPatchVectorField
89 :
90  public directionMixedFvPatchVectorField
91 {
92  // Private Data
93 
94  //- Flux field name
95  word phiName_;
96 
97  //- Optional tangential velocity component
98  autoPtr<Function1<vector>> tangentialVelocity_;
99 
100 
101 public:
103  //- Runtime type information
104  TypeName("pressureInletOutletVelocity");
105 
106 
107  // Constructors
108 
109  //- Construct from patch and internal field
111  (
112  const fvPatch&,
114  );
115 
116  //- Construct from patch, internal field and dictionary
118  (
119  const fvPatch&,
121  const dictionary&
122  );
123 
124  //- Construct by mapping given
125  // pressureInletOutletVelocityFvPatchVectorField onto a new patch
127  (
129  const fvPatch&,
131  const fvPatchFieldMapper&
132  );
133 
134  //- Disallow copy without setting internal field reference
136  (
138  ) = delete;
139 
140  //- Copy constructor setting internal field reference
142  (
145  );
146 
147  //- Construct and return a clone setting internal field reference
149  (
151  ) const
152  {
154  (
156  );
157  }
158 
159 
160  // Member Functions
161 
162  // Attributes
164  //- Return true: this patch field is altered by assignment
165  virtual bool assignable() const
166  {
167  return true;
168  }
169 
170 
171  // Access
172 
173  //- Return the name of phi
174  const word& phiName() const
175  {
176  return phiName_;
177  }
178 
179  //- Return reference to the name of phi to allow adjustment
180  word& phiName()
181  {
182  return phiName_;
183  }
184 
185  //- Return the tangential velocity Function1
187  {
188  return tangentialVelocity_;
189  }
190 
191 
192  //- Update the coefficients associated with the patch field
193  virtual void updateCoeffs();
195  //- Write
196  virtual void write(Ostream&) const;
197 
198 
199  // Member Operators
201  virtual void operator=(const fvPatchField<vector>& pvf);
202 };
203 
204 
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 
207 } // End namespace Foam
208 
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 
211 #endif
212 
213 // ************************************************************************* //
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
const autoPtr< Function1< vector > > & tangentialVelocity() const
Return the tangential velocity Function1.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:63
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.
Velocity inlet/outlet boundary condition for patches where the pressure is specified in some manner...
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...
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
A class for managing temporary objects.
Definition: PtrList.H:53
Namespace for OpenFOAM.