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-2026 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  value | initial velocity | no | evaluated
46  \endtable
47 
48  Example of the boundary condition specification:
49  \verbatim
50  <patchName>
51  {
52  type pressureInletOutletVelocity;
53  tangentialVelocity $internalField;
54  }
55  \endverbatim
56 
57  The \c tangentialVelocity entry is a \c UFunctionalDimensionedField
58  providing total flexibility in the specification of the tangential velocity,
59  the normal component is removed automatically from the field returned by the
60  function.
61 
62 See also
63  Foam::DimensionedFieldFunction
64  Foam::UFunctionalDimensionedField
65  Foam::directionMixedFvPatchVectorField
66  Foam::totalPressureFvPatchScalarField
67  Foam::entrainmentPressureFvPatchScalarField
68 
69 SourceFiles
70  pressureInletOutletVelocityFvPatchVectorField.C
71 
72 \*---------------------------------------------------------------------------*/
73 
74 #ifndef pressureInletOutletVelocityFvPatchVectorField_H
75 #define pressureInletOutletVelocityFvPatchVectorField_H
76 
79 
80 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
81 
82 namespace Foam
83 {
84 
85 /*---------------------------------------------------------------------------*\
86  Class pressureInletOutletVelocityFvPatchVectorField Declaration
87 \*---------------------------------------------------------------------------*/
88 
89 class pressureInletOutletVelocityFvPatchVectorField
90 :
91  public directionMixedFvPatchVectorField
92 {
93  // Private Data
94 
95  //- Optional tangential velocity
96  UFunctionalDimensionedField<vector, fvPatch> tangentialVelocity_;
97 
98  //- Flux field name
99  word phiName_;
100 
101 
102 public:
103 
104  //- Runtime type information
105  TypeName("pressureInletOutletVelocity");
106 
107 
108  // Constructors
109 
110  //- Construct from patch, internal field and dictionary
112  (
113  const fvPatch&,
115  const dictionary&
116  );
117 
118  //- Construct by mapping given
119  // pressureInletOutletVelocityFvPatchVectorField onto a new patch
121  (
123  const fvPatch&,
125  const fieldMapper&
126  );
127 
128  //- Disallow copy without setting internal field reference
130  (
132  ) = delete;
133 
134  //- Copy constructor setting internal field reference
136  (
139  );
140 
141  //- Construct and return a clone setting internal field reference
143  (
145  ) const
146  {
148  (
150  );
151  }
152 
153 
154  // Member Functions
155 
156  // Attributes
157 
158  //- Return true: this patch field is altered by assignment
159  virtual bool assignable() const
160  {
161  return true;
162  }
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 Function1
181  {
182  return tangentialVelocity_;
183  }
184 
185 
186  // Mapping functions
187 
188  //- Map the given fvPatchField onto this fvPatchField
189  virtual void map(const fvPatchField<vector>&, const fieldMapper&);
190 
191  //- Reset the fvPatchField to the given fvPatchField
192  // Used for mesh to mesh mapping
193  virtual void reset(const fvPatchField<vector>&);
194 
195 
196  //- Update the coefficients associated with the patch field
197  virtual void updateCoeffs();
198 
199  //- Write
200  virtual void write(Ostream&) const;
201 
202 
203  // Member Operators
204 
205  virtual void operator=(const fvPatchField<vector>& pvf);
206 
207  //- Inherit assignment
208  using directionMixedFvPatchVectorField::operator=;
209 };
210 
211 
212 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
213 
214 } // End namespace Foam
215 
216 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
217 
218 #endif
219 
220 // ************************************************************************* //
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
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Abstract base class for field mapping.
Definition: fieldMapper.H:48
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:90
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:58
Velocity inlet/outlet boundary condition for patches where the pressure is specified in some manner,...
virtual void map(const fvPatchField< vector > &, const fieldMapper &)
Map the given fvPatchField onto this fvPatchField.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual tmp< fvPatchVectorField > clone(const DimensionedField< vector, fvMesh > &iF) const
Construct and return a clone setting internal field reference.
virtual void reset(const fvPatchField< vector > &)
Reset the fvPatchField to the given fvPatchField.
TypeName("pressureInletOutletVelocity")
Runtime type information.
virtual bool assignable() const
Return true: this patch field is altered by assignment.
const DimensionedField< vector, fvPatch > & tangentialVelocity() const
Return the tangential velocity Function1.
pressureInletOutletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, fvMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:63
Namespace for OpenFOAM.