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