pressureDirectedInletVelocityFvPatchVectorField.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::pressureDirectedInletVelocityFvPatchVectorField
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  the specified inlet direction" direction.
36 
37 Usage
38  \table
39  Property | Description | Required | Default value
40  phi | flux field name | no | phi
41  rho | density field name | no | rho
42  inletDirection | inlet direction per patch face | yes |
43  \endtable
44 
45  Example of the boundary condition specification:
46  \verbatim
47  <patchName>
48  {
49  type pressureDirectedInletVelocity;
50  phi phi;
51  rho rho;
52  inletDirection uniform (1 0 0);
53  value uniform 0;
54  }
55  \endverbatim
56 
57 Note
58  If reverse flow is possible or expected use the
59  pressureDirectedInletOutletVelocityFvPatchVectorField condition instead.
60 
61 
62 See also
63  Foam::fixedValueFvPatchField
64  Foam::pressureDirectedInletOutletVelocityFvPatchVectorField
65 
66 SourceFiles
67  pressureDirectedInletVelocityFvPatchVectorField.C
68 
69 \*---------------------------------------------------------------------------*/
70 
71 #ifndef pressureDirectedInletVelocityFvPatchVectorField_H
72 #define pressureDirectedInletVelocityFvPatchVectorField_H
73 
74 #include "fvPatchFields.H"
76 
77 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
78 
79 namespace Foam
80 {
81 
82 /*---------------------------------------------------------------------------*\
83  Class pressureDirectedInletVelocityFvPatchVectorField Declaration
84 \*---------------------------------------------------------------------------*/
85 
86 class pressureDirectedInletVelocityFvPatchVectorField
87 :
88  public fixedValueFvPatchVectorField
89 {
90  // Private data
91 
92  //- Flux field name
93  word phiName_;
94 
95  //- Density field name
96  word rhoName_;
97 
98  //- Inlet direction
99  vectorField inletDir_;
100 
101 
102 public:
103 
104  //- Runtime type information
105  TypeName("pressureDirectedInletVelocity");
106 
107 
108  // Constructors
109 
110  //- Construct from patch and internal field
112  (
113  const fvPatch&,
115  );
116 
117  //- Construct from patch, internal field and dictionary
119  (
120  const fvPatch&,
122  const dictionary&
123  );
124 
125  //- Construct by mapping given
126  // pressureDirectedInletVelocityFvPatchVectorField
127  // onto a new patch
129  (
131  const fvPatch&,
133  const fvPatchFieldMapper&
134  );
135 
136  //- Construct as copy
138  (
140  );
141 
142  //- Construct and return a clone
143  virtual tmp<fvPatchVectorField> clone() const
144  {
146  (
148  );
149  }
150 
151  //- Construct as copy setting internal field reference
153  (
156  );
157 
158  //- Construct and return a clone setting internal field reference
160  (
162  ) const
163  {
165  (
167  (
168  *this,
169  iF
170  )
171  );
172  }
173 
174 
175  // Member functions
176 
177  // Attributes
178 
179  //- Return true: this patch field is altered by assignment
180  virtual bool assignable() const
181  {
182  return true;
183  }
184 
185  // Access
186 
187  //- Return the name of rho
188  const word& rhoName() const
189  {
190  return rhoName_;
191  }
192 
193  //- Return reference to the name of rho to allow adjustment
194  word& rhoName()
195  {
196  return rhoName_;
197  }
198 
199  //- Return the name of phi
200  const word& phiName() const
201  {
202  return phiName_;
203  }
204 
205  //- Return reference to the name of phi to allow adjustment
206  word& phiName()
207  {
208  return phiName_;
209  }
210 
211 
212  // Mapping functions
213 
214  //- Map (and resize as needed) from self given a mapping object
215  virtual void autoMap
216  (
217  const fvPatchFieldMapper&
218  );
219 
220  //- Reverse map the given fvPatchField onto this fvPatchField
221  virtual void rmap
222  (
223  const fvPatchVectorField&,
224  const labelList&
225  );
226 
227 
228  //- Update the coefficients associated with the patch field
229  virtual void updateCoeffs();
230 
231  //- Write
232  virtual void write(Ostream&) const;
233 
234 
235  // Member operators
236 
237  virtual void operator=(const fvPatchField<vector>& pvf);
238 };
239 
240 
241 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
242 
243 } // End namespace Foam
244 
245 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
246 
247 #endif
248 
249 // ************************************************************************* //
Foam::fvPatchField< vector >
Foam::pressureDirectedInletVelocityFvPatchVectorField
This velocity inlet boundary condition is applied to patches where the pressure is specified....
Definition: pressureDirectedInletVelocityFvPatchVectorField.H:105
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::pressureDirectedInletVelocityFvPatchVectorField::operator=
virtual void operator=(const fvPatchField< vector > &pvf)
Definition: pressureDirectedInletVelocityFvPatchVectorField.C:194
Foam::pressureDirectedInletVelocityFvPatchVectorField::rhoName
word & rhoName()
Return reference to the name of rho to allow adjustment.
Definition: pressureDirectedInletVelocityFvPatchVectorField.H:213
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::pressureDirectedInletVelocityFvPatchVectorField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: pressureDirectedInletVelocityFvPatchVectorField.C:137
Foam::pressureDirectedInletVelocityFvPatchVectorField::rmap
virtual void rmap(const fvPatchVectorField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: pressureDirectedInletVelocityFvPatchVectorField.C:123
Foam::vectorField
Field< vector > vectorField
Specialisation of Field<T> for vector.
Definition: primitiveFieldsFwd.H:54
Foam::Field< vector >
Foam::pressureDirectedInletVelocityFvPatchVectorField::rhoName
const word & rhoName() const
Return the name of rho.
Definition: pressureDirectedInletVelocityFvPatchVectorField.H:207
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::pressureDirectedInletVelocityFvPatchVectorField::TypeName
TypeName("pressureDirectedInletVelocity")
Runtime type information.
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::pressureDirectedInletVelocityFvPatchVectorField::phiName
const word & phiName() const
Return the name of phi.
Definition: pressureDirectedInletVelocityFvPatchVectorField.H:219
Foam::pressureDirectedInletVelocityFvPatchVectorField::assignable
virtual bool assignable() const
Return true: this patch field is altered by assignment.
Definition: pressureDirectedInletVelocityFvPatchVectorField.H:199
fvPatchFields.H
Foam::List< label >
fixedValueFvPatchFields.H
Foam::pressureDirectedInletVelocityFvPatchVectorField::clone
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
Definition: pressureDirectedInletVelocityFvPatchVectorField.H:162
Foam::pressureDirectedInletVelocityFvPatchVectorField::phiName
word & phiName()
Return reference to the name of phi to allow adjustment.
Definition: pressureDirectedInletVelocityFvPatchVectorField.H:225
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::pressureDirectedInletVelocityFvPatchVectorField::write
virtual void write(Ostream &) const
Write.
Definition: pressureDirectedInletVelocityFvPatchVectorField.C:179
Foam::pressureDirectedInletVelocityFvPatchVectorField::pressureDirectedInletVelocityFvPatchVectorField
pressureDirectedInletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Definition: pressureDirectedInletVelocityFvPatchVectorField.C:40
Foam::pressureDirectedInletVelocityFvPatchVectorField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: pressureDirectedInletVelocityFvPatchVectorField.C:113
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54