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-2023 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:
102 
103  //- Runtime type information
104  TypeName("pressureInletOutletVelocity");
105 
106 
107  // Constructors
108 
109  //- Construct from patch, internal field and dictionary
111  (
112  const fvPatch&,
114  const dictionary&
115  );
116 
117  //- Construct by mapping given
118  // pressureInletOutletVelocityFvPatchVectorField onto a new patch
120  (
122  const fvPatch&,
124  const fvPatchFieldMapper&
125  );
126 
127  //- Disallow copy without setting internal field reference
129  (
131  ) = delete;
132 
133  //- Copy constructor setting internal field reference
135  (
138  );
139 
140  //- Construct and return a clone setting internal field reference
142  (
144  ) const
145  {
147  (
149  );
150  }
151 
152 
153  // Member Functions
154 
155  // Attributes
156 
157  //- Return true: this patch field is altered by assignment
158  virtual bool assignable() const
159  {
160  return true;
161  }
162 
163 
164  // Access
165 
166  //- Return the name of phi
167  const word& phiName() const
168  {
169  return phiName_;
170  }
171 
172  //- Return reference to the name of phi to allow adjustment
173  word& phiName()
174  {
175  return phiName_;
176  }
177 
178  //- Return the tangential velocity Function1
180  {
181  return tangentialVelocity_;
182  }
183 
184 
185  //- Update the coefficients associated with the patch field
186  virtual void updateCoeffs();
187 
188  //- Write
189  virtual void write(Ostream&) const;
190 
191 
192  // Member Operators
193 
194  virtual void operator=(const fvPatchField<vector>& pvf);
195 };
196 
197 
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 
200 } // End namespace Foam
201 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 #endif
205 
206 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Foam::fvPatchFieldMapper.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:87
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:64
Velocity inlet/outlet boundary condition for patches where the pressure is specified in some manner,...
virtual tmp< fvPatchVectorField > clone(const DimensionedField< vector, volMesh > &iF) const
Construct and return a clone setting internal field reference.
pressureInletOutletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
TypeName("pressureInletOutletVelocity")
Runtime type information.
virtual bool assignable() const
Return true: this patch field is altered by assignment.
const autoPtr< Function1< vector > > & tangentialVelocity() const
Return the tangential velocity Function1.
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.