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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::pressureInletVelocityFvPatchVectorField
28 
29 Group
30  grpInletBoundaryConditions
31 
32 Description
33  This velocity inlet boundary condition is applied to patches where the
34  pressure is specified. The inflow velocity is obtained from the flux with
35  a direction normal to the patch faces.
36 
37 Usage
38  Example of the boundary condition specification:
39  \verbatim
40  <patchName>
41  {
42  type pressureInletVelocity;
43  phi phi;
44  rho rho;
45  value uniform 0;
46  }
47  \endverbatim
48 
49 Note
50  If reverse flow is possible or expected use
51  the pressureInletOutletVelocityFvPatchVectorField condition instead.
52 
53 See also
54  Foam::fixedValueFvPatchField
55  Foam::pressureInletOutletVelocityFvPatchVectorField
56 
57 SourceFiles
58  pressureInletVelocityFvPatchVectorField.C
59 
60 \*---------------------------------------------------------------------------*/
61 
62 #ifndef pressureInletVelocityFvPatchVectorField_H
63 #define pressureInletVelocityFvPatchVectorField_H
64 
65 #include "fvPatchFields.H"
67 
68 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
69 
70 namespace Foam
71 {
72 
73 /*---------------------------------------------------------------------------*\
74  Class pressureInletVelocityFvPatchVectorField Declaration
75 \*---------------------------------------------------------------------------*/
76 
78 :
79  public fixedValueFvPatchVectorField
80 {
81  // Private data
82 
83  //- Flux field name
84  word phiName_;
85 
86  //- Density field name
87  word rhoName_;
88 
89 
90 public:
91 
92  //- Runtime type information
93  TypeName("pressureInletVelocity");
94 
95 
96  // Constructors
97 
98  //- Construct from patch and internal field
100  (
101  const fvPatch&,
103  );
104 
105  //- Construct from patch, internal field and dictionary
107  (
108  const fvPatch&,
110  const dictionary&
111  );
112 
113  //- Construct by mapping given pressureInletVelocityFvPatchVectorField
114  // onto a new patch
116  (
118  const fvPatch&,
120  const fvPatchFieldMapper&
121  );
122 
123  //- Construct as copy
125  (
127  );
128 
129  //- Construct and return a clone
130  virtual tmp<fvPatchVectorField> clone() const
131  {
133  (
135  );
136  }
137 
138  //- Construct as copy setting internal field reference
140  (
143  );
144 
145  //- Construct and return a clone setting internal field reference
147  (
149  ) const
150  {
152  (
154  );
155  }
156 
157 
158  // Member functions
159 
160  // Attributes
161 
162  //- Return true: this patch field is altered by assignment
163  virtual bool assignable() const
164  {
165  return true;
166  }
167 
168 
169  // Access
170 
171  //- Return the name of rho
172  const word& rhoName() const
173  {
174  return rhoName_;
175  }
176 
177  //- Return reference to the name of rho to allow adjustment
178  word& rhoName()
179  {
180  return rhoName_;
181  }
182 
183  //- Return the name of phi
184  const word& phiName() const
185  {
186  return phiName_;
187  }
188 
189  //- Return reference to the name of phi to allow adjustment
190  word& phiName()
191  {
192  return phiName_;
193  }
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 
208 
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 
211 } // End namespace Foam
212 
213 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214 
215 #endif
216 
217 // ************************************************************************* //
Foam::fvPatchField< vector >
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::pressureInletVelocityFvPatchVectorField::phiName
word & phiName()
Return reference to the name of phi to allow adjustment.
Definition: pressureInletVelocityFvPatchVectorField.H:189
Foam::pressureInletVelocityFvPatchVectorField::assignable
virtual bool assignable() const
Return true: this patch field is altered by assignment.
Definition: pressureInletVelocityFvPatchVectorField.H:162
Foam::pressureInletVelocityFvPatchVectorField::TypeName
TypeName("pressureInletVelocity")
Runtime type information.
Foam::pressureInletVelocityFvPatchVectorField::operator=
virtual void operator=(const fvPatchField< vector > &pvf)
Definition: pressureInletVelocityFvPatchVectorField.C:158
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::pressureInletVelocityFvPatchVectorField::pressureInletVelocityFvPatchVectorField
pressureInletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Definition: pressureInletVelocityFvPatchVectorField.C:38
Foam::pressureInletVelocityFvPatchVectorField
This velocity inlet boundary condition is applied to patches where the pressure is specified....
Definition: pressureInletVelocityFvPatchVectorField.H:76
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::pressureInletVelocityFvPatchVectorField::rhoName
word & rhoName()
Return reference to the name of rho to allow adjustment.
Definition: pressureInletVelocityFvPatchVectorField.H:177
Foam::pressureInletVelocityFvPatchVectorField::clone
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
Definition: pressureInletVelocityFvPatchVectorField.H:129
fvPatchFields.H
fixedValueFvPatchFields.H
Foam::pressureInletVelocityFvPatchVectorField::rhoName
const word & rhoName() const
Return the name of rho.
Definition: pressureInletVelocityFvPatchVectorField.H:171
Foam::pressureInletVelocityFvPatchVectorField::phiName
const word & phiName() const
Return the name of phi.
Definition: pressureInletVelocityFvPatchVectorField.H:183
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::pressureInletVelocityFvPatchVectorField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: pressureInletVelocityFvPatchVectorField.C:105
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54
Foam::pressureInletVelocityFvPatchVectorField::write
virtual void write(Ostream &) const
Write.
Definition: pressureInletVelocityFvPatchVectorField.C:146