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-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::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 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  // pressureDirectedInletVelocityFvPatchVectorField
121  // onto a new patch
123  (
125  const fvPatch&,
127  const fvPatchFieldMapper&
128  );
129 
130  //- Disallow copy without setting internal field reference
132  (
134  ) = delete;
135 
136  //- Copy constructor setting internal field reference
138  (
141  );
142 
143  //- Construct and return a clone setting internal field reference
145  (
147  ) const
148  {
150  (
152  (
153  *this,
154  iF
155  )
156  );
157  }
158 
159 
160  // Member Functions
161 
162  // Attributes
163 
164  //- Return true: this patch field is altered by assignment
165  virtual bool assignable() const
166  {
167  return true;
168  }
169 
170  // Access
171 
172  //- Return the name of rho
173  const word& rhoName() const
174  {
175  return rhoName_;
176  }
177 
178  //- Return reference to the name of rho to allow adjustment
179  word& rhoName()
180  {
181  return rhoName_;
182  }
183 
184  //- Return the name of phi
185  const word& phiName() const
186  {
187  return phiName_;
188  }
189 
190  //- Return reference to the name of phi to allow adjustment
191  word& phiName()
192  {
193  return phiName_;
194  }
195 
196 
197  // Mapping functions
199  //- Map (and resize as needed) from self given a mapping object
200  // Used to update fields following mesh topology change
201  virtual void autoMap(const fvPatchFieldMapper&);
202 
203  //- Reverse map the given fvPatchField onto this fvPatchField
204  // Used to reconstruct fields
205  virtual void rmap(const fvPatchVectorField&, const labelList&);
206 
207  //- Reset the fvPatchField to the given fvPatchField
208  // Used for mesh to mesh mapping
209  virtual void reset(const fvPatchVectorField&);
211 
212  //- Update the coefficients associated with the patch field
213  virtual void updateCoeffs();
214 
215  //- Write
216  virtual void write(Ostream&) const;
217 
218 
219  // Member Operators
220 
221  virtual void operator=(const fvPatchField<vector>& pvf);
222 };
223 
224 
225 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
226 
227 } // End namespace Foam
228 
229 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
230 
231 #endif
232 
233 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
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
virtual bool assignable() const
Return true: this patch field is altered by assignment.
pressureDirectedInletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A class for handling words, derived from string.
Definition: word.H:59
Foam::fvPatchFieldMapper.
virtual void reset(const fvPatchVectorField &)
Reset the fvPatchField to the given fvPatchField.
TypeName("pressureDirectedInletVelocity")
Runtime type information.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
virtual void rmap(const fvPatchVectorField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
virtual tmp< fvPatchVectorField > clone(const DimensionedField< vector, volMesh > &iF) const
Construct and return a clone setting internal field reference.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
This velocity inlet boundary condition is applied to patches where the pressure is specified...
Field< vector > vectorField
Specialisation of Field<T> for vector.
A class for managing temporary objects.
Definition: PtrList.H:53
Namespace for OpenFOAM.