pressureDirectedInletVelocityFvPatchVectorField.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::pressureDirectedInletVelocityFvPatchVectorField
26 
27 Description
28  This velocity inlet boundary condition is applied to patches where the
29  pressure is specified. The inflow velocity is obtained from the flux with
30  the specified inlet direction" direction.
31 
32 Usage
33  \table
34  Property | Description | Required | Default value
35  phi | flux field name | no | phi
36  rho | density field name | no | rho
37  inletDirection | inlet direction per patch face | yes |
38  \endtable
39 
40  Example of the boundary condition specification:
41  \verbatim
42  <patchName>
43  {
44  type pressureDirectedInletVelocity;
45  phi phi;
46  rho rho;
47  inletDirection uniform (1 0 0);
48  value uniform 0;
49  }
50  \endverbatim
51 
52  Note:
53  If reverse flow is possible or expected use the
54  pressureDirectedInletOutletVelocityFvPatchVectorField condition instead.
55 
56 See also
57  Foam::fixedValueFvPatchField
58  Foam::pressureDirectedInletOutletVelocityFvPatchVectorField
59 
60 SourceFiles
61  pressureDirectedInletVelocityFvPatchVectorField.C
62 
63 \*---------------------------------------------------------------------------*/
64 
65 #ifndef pressureDirectedInletVelocityFvPatchVectorField_H
66 #define pressureDirectedInletVelocityFvPatchVectorField_H
67 
68 #include "fvPatchFields.H"
70 
71 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
72 
73 namespace Foam
74 {
75 
76 /*---------------------------------------------------------------------------*\
77  Class pressureDirectedInletVelocityFvPatchVectorField Declaration
78 \*---------------------------------------------------------------------------*/
79 
80 class pressureDirectedInletVelocityFvPatchVectorField
81 :
82  public fixedValueFvPatchVectorField
83 {
84  // Private Data
85 
86  //- Flux field name
87  word phiName_;
88 
89  //- Density field name
90  word rhoName_;
91 
92  //- Inlet direction
93  vectorField inletDir_;
94 
95 
96 public:
97 
98  //- Runtime type information
99  TypeName("pressureDirectedInletVelocity");
100 
101 
102  // Constructors
103 
104  //- Construct from patch, internal field and dictionary
106  (
107  const fvPatch&,
109  const dictionary&
110  );
111 
112  //- Construct by mapping given
113  // pressureDirectedInletVelocityFvPatchVectorField
114  // onto a new patch
116  (
118  const fvPatch&,
120  const fvPatchFieldMapper&
121  );
122 
123  //- Disallow copy without setting internal field reference
125  (
127  ) = delete;
128 
129  //- Copy constructor setting internal field reference
131  (
134  );
135 
136  //- Construct and return a clone setting internal field reference
138  (
140  ) const
141  {
143  (
145  (
146  *this,
147  iF
148  )
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  // Access
164 
165  //- Return the name of rho
166  const word& rhoName() const
167  {
168  return rhoName_;
169  }
170 
171  //- Return reference to the name of rho to allow adjustment
172  word& rhoName()
173  {
174  return rhoName_;
175  }
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  // Mapping functions
191 
192  //- Map the given fvPatchField onto this fvPatchField
193  virtual void map
194  (
195  const fvPatchVectorField&,
196  const fvPatchFieldMapper&
197  );
198 
199  //- Reset the fvPatchField to the given fvPatchField
200  // Used for mesh to mesh mapping
201  virtual void reset(const fvPatchVectorField&);
202 
203 
204  //- Update the coefficients associated with the patch field
205  virtual void updateCoeffs();
206 
207  //- Write
208  virtual void write(Ostream&) const;
209 
210 
211  // Member Operators
212 
213  virtual void operator=(const fvPatchField<vector>& pvf);
214 };
215 
216 
217 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
218 
219 } // End namespace Foam
220 
221 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
222 
223 #endif
224 
225 // ************************************************************************* //
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 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
This velocity inlet boundary condition is applied to patches where the pressure is specified....
virtual tmp< fvPatchVectorField > clone(const DimensionedField< vector, volMesh > &iF) const
Construct and return a clone setting internal field reference.
TypeName("pressureDirectedInletVelocity")
Runtime type information.
pressureDirectedInletVelocityFvPatchVectorField(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.
virtual void map(const fvPatchVectorField &, const fvPatchFieldMapper &)
Map the given fvPatchField onto this fvPatchField.
virtual void reset(const fvPatchVectorField &)
Reset the fvPatchField to the given fvPatchField.
virtual bool assignable() const
Return true: this patch field is altered by assignment.
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.
Field< vector > vectorField
Specialisation of Field<T> for vector.