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-2012 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  \heading Patch usage
36 
37  Example of the boundary condition specification:
38  \verbatim
39  myPatch
40  {
41  type pressureInletVelocity;
42  phi phi;
43  rho rho;
44  value uniform 0;
45  }
46  \endverbatim
47 
48 Note
49  If reverse flow is possible or expected use
50  the pressureInletOutletVelocityFvPatchVectorField condition instead.
51 
52 SeeAlso
53  Foam::fixedValueFvPatchField
54  Foam::pressureInletOutletVelocityFvPatchVectorField
55 
56 SourceFiles
57  pressureInletVelocityFvPatchVectorField.C
58 
59 \*---------------------------------------------------------------------------*/
60 
61 #ifndef pressureInletVelocityFvPatchVectorField_H
62 #define pressureInletVelocityFvPatchVectorField_H
63 
64 #include "fvPatchFields.H"
66 
67 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
68 
69 namespace Foam
70 {
71 
72 /*---------------------------------------------------------------------------*\
73  Class pressureInletVelocityFvPatchVectorField Declaration
74 \*---------------------------------------------------------------------------*/
75 
77 :
78  public fixedValueFvPatchVectorField
79 {
80  // Private data
81 
82  //- Flux field name
83  word phiName_;
84 
85  //- Density field name
86  word rhoName_;
87 
88 
89 public:
90 
91  //- Runtime type information
92  TypeName("pressureInletVelocity");
93 
94 
95  // Constructors
96 
97  //- Construct from patch and internal field
99  (
100  const fvPatch&,
102  );
103 
104  //- Construct from patch, internal field and dictionary
106  (
107  const fvPatch&,
109  const dictionary&
110  );
111 
112  //- Construct by mapping given pressureInletVelocityFvPatchVectorField
113  // onto a new patch
115  (
117  const fvPatch&,
119  const fvPatchFieldMapper&
120  );
121 
122  //- Construct as copy
124  (
126  );
127 
128  //- Construct and return a clone
129  virtual tmp<fvPatchVectorField> clone() const
130  {
132  (
134  );
135  }
136 
137  //- Construct as copy setting internal field reference
139  (
142  );
143 
144  //- Construct and return a clone setting internal field reference
146  (
148  ) const
149  {
151  (
153  );
154  }
155 
156 
157  // Member functions
158 
159  // Access
160 
161  //- Return the name of rho
162  const word& rhoName() const
163  {
164  return rhoName_;
165  }
166 
167  //- Return reference to the name of rho to allow adjustment
168  word& rhoName()
169  {
170  return rhoName_;
171  }
172 
173  //- Return the name of phi
174  const word& phiName() const
175  {
176  return phiName_;
177  }
178 
179  //- Return reference to the name of phi to allow adjustment
180  word& phiName()
181  {
182  return phiName_;
183  }
184 
185 
186  //- Update the coefficients associated with the patch field
187  virtual void updateCoeffs();
188 
189  //- Write
190  virtual void write(Ostream&) const;
191 
192 
193  // Member operators
194 
195  virtual void operator=(const fvPatchField<vector>& pvf);
196 };
197 
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 
201 } // End namespace Foam
202 
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 
205 #endif
206 
207 // ************************************************************************* //
Foam::fvPatchField
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:65
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::pressureInletVelocityFvPatchVectorField::phiName
word & phiName()
Return reference to the name of phi to allow adjustment.
Definition: pressureInletVelocityFvPatchVectorField.H:179
Foam::pressureInletVelocityFvPatchVectorField::rhoName_
word rhoName_
Density field name.
Definition: pressureInletVelocityFvPatchVectorField.H:85
Foam::pressureInletVelocityFvPatchVectorField::TypeName
TypeName("pressureInletVelocity")
Runtime type information.
Foam::pressureInletVelocityFvPatchVectorField::operator=
virtual void operator=(const fvPatchField< vector > &pvf)
Definition: pressureInletVelocityFvPatchVectorField.C:157
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::pressureInletVelocityFvPatchVectorField::pressureInletVelocityFvPatchVectorField
pressureInletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Definition: pressureInletVelocityFvPatchVectorField.C:35
Foam::pressureInletVelocityFvPatchVectorField
This velocity inlet boundary condition is applied to patches where the pressure is specified....
Definition: pressureInletVelocityFvPatchVectorField.H:75
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::pressureInletVelocityFvPatchVectorField::rhoName
word & rhoName()
Return reference to the name of rho to allow adjustment.
Definition: pressureInletVelocityFvPatchVectorField.H:167
Foam::pressureInletVelocityFvPatchVectorField::clone
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
Definition: pressureInletVelocityFvPatchVectorField.H:128
fvPatchFields.H
fixedValueFvPatchFields.H
Foam::pressureInletVelocityFvPatchVectorField::rhoName
const word & rhoName() const
Return the name of rho.
Definition: pressureInletVelocityFvPatchVectorField.H:161
Foam::pressureInletVelocityFvPatchVectorField::phiName
const word & phiName() const
Return the name of phi.
Definition: pressureInletVelocityFvPatchVectorField.H:173
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::pressureInletVelocityFvPatchVectorField::phiName_
word phiName_
Flux field name.
Definition: pressureInletVelocityFvPatchVectorField.H:82
Foam::pressureInletVelocityFvPatchVectorField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: pressureInletVelocityFvPatchVectorField.C:104
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51
Foam::pressureInletVelocityFvPatchVectorField::write
virtual void write(Ostream &) const
Write.
Definition: pressureInletVelocityFvPatchVectorField.C:145