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