pressureInletVelocityFvPatchVectorField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011-2016 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::pressureInletVelocityFvPatchVectorField
26 
27 Group
28  grpInletBoundaryConditions
29 
30 Description
31  This velocity inlet boundary condition is applied to patches where the
32  pressure is specified. The inflow velocity is obtained from the flux with
33  a direction normal to the patch faces.
34 
35 Usage
36  Example of the boundary condition specification:
37  \verbatim
38  <patchName>
39  {
40  type pressureInletVelocity;
41  phi phi;
42  rho rho;
43  value uniform 0;
44  }
45  \endverbatim
46 
47 Note
48  If reverse flow is possible or expected use
49  the pressureInletOutletVelocityFvPatchVectorField condition instead.
50 
51 See also
52  Foam::fixedValueFvPatchField
53  Foam::pressureInletOutletVelocityFvPatchVectorField
54 
55 SourceFiles
56  pressureInletVelocityFvPatchVectorField.C
57 
58 \*---------------------------------------------------------------------------*/
59 
60 #ifndef pressureInletVelocityFvPatchVectorField_H
61 #define pressureInletVelocityFvPatchVectorField_H
62 
63 #include "fvPatchFields.H"
65 
66 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
67 
68 namespace Foam
69 {
70 
71 /*---------------------------------------------------------------------------*\
72  Class pressureInletVelocityFvPatchVectorField Declaration
73 \*---------------------------------------------------------------------------*/
74 
76 :
77  public fixedValueFvPatchVectorField
78 {
79  // Private data
80 
81  //- Flux field name
82  word phiName_;
83 
84  //- Density field name
85  word rhoName_;
86 
87 
88 public:
89 
90  //- Runtime type information
91  TypeName("pressureInletVelocity");
92 
93 
94  // Constructors
95 
96  //- Construct from patch and internal field
98  (
99  const fvPatch&,
101  );
102 
103  //- Construct from patch, internal field and dictionary
105  (
106  const fvPatch&,
108  const dictionary&
109  );
110 
111  //- Construct by mapping given pressureInletVelocityFvPatchVectorField
112  // onto a new patch
114  (
116  const fvPatch&,
118  const fvPatchFieldMapper&
119  );
120 
121  //- Construct as copy
123  (
125  );
126 
127  //- Construct and return a clone
128  virtual tmp<fvPatchVectorField> clone() const
129  {
131  (
133  );
134  }
135 
136  //- Construct as copy setting internal field reference
138  (
141  );
142 
143  //- Construct and return a clone setting internal field reference
145  (
147  ) const
148  {
150  (
152  );
153  }
154 
155 
156  // Member functions
157 
158  // Attributes
159 
160  //- Return true: this patch field is altered by assignment
161  virtual bool assignable() const
162  {
163  return true;
164  }
165 
166 
167  // Access
168 
169  //- Return the name of rho
170  const word& rhoName() const
171  {
172  return rhoName_;
173  }
174 
175  //- Return reference to the name of rho to allow adjustment
176  word& rhoName()
177  {
178  return rhoName_;
179  }
180 
181  //- Return the name of phi
182  const word& phiName() const
183  {
184  return phiName_;
185  }
186 
187  //- Return reference to the name of phi to allow adjustment
188  word& phiName()
189  {
190  return phiName_;
191  }
192 
193 
194  //- Update the coefficients associated with the patch field
195  virtual void updateCoeffs();
196 
197  //- Write
198  virtual void write(Ostream&) const;
199 
200 
201  // Member operators
202 
203  virtual void operator=(const fvPatchField<vector>& pvf);
204 };
205 
206 
207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208 
209 } // End namespace Foam
210 
211 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212 
213 #endif
214 
215 // ************************************************************************* //
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
TypeName("pressureInletVelocity")
Runtime type information.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
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.
A class for handling words, derived from string.
Definition: word.H:59
Foam::fvPatchFieldMapper.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
pressureInletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
virtual void operator=(const fvPatchField< vector > &pvf)
This velocity inlet boundary condition is applied to patches where the pressure is specified...
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A class for managing temporary objects.
Definition: PtrList.H:53
Namespace for OpenFOAM.