pressureDirectedInletVelocityFvPatchVectorField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2019 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 Description
28  This velocity inlet boundary condition is applied to patches where the
29  pressure is specified. The inflow velocity is obtained from the flux with
30  the specified inlet direction" direction.
31 
32 Usage
33  \table
34  Property | Description | Required | Default value
35  phi | flux field name | no | phi
36  rho | density field name | no | rho
37  inletDirection | inlet direction per patch face | yes |
38  \endtable
39 
40  Example of the boundary condition specification:
41  \verbatim
42  <patchName>
43  {
44  type pressureDirectedInletVelocity;
45  phi phi;
46  rho rho;
47  inletDirection uniform (1 0 0);
48  value uniform 0;
49  }
50  \endverbatim
51 
52 Note
53  If reverse flow is possible or expected use the
54  pressureDirectedInletOutletVelocityFvPatchVectorField condition instead.
55 
56 
57 See also
58  Foam::fixedValueFvPatchField
59  Foam::pressureDirectedInletOutletVelocityFvPatchVectorField
60 
61 SourceFiles
62  pressureDirectedInletVelocityFvPatchVectorField.C
63 
64 \*---------------------------------------------------------------------------*/
65 
66 #ifndef pressureDirectedInletVelocityFvPatchVectorField_H
67 #define pressureDirectedInletVelocityFvPatchVectorField_H
68 
69 #include "fvPatchFields.H"
71 
72 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
73 
74 namespace Foam
75 {
76 
77 /*---------------------------------------------------------------------------*\
78  Class pressureDirectedInletVelocityFvPatchVectorField Declaration
79 \*---------------------------------------------------------------------------*/
80 
81 class pressureDirectedInletVelocityFvPatchVectorField
82 :
83  public fixedValueFvPatchVectorField
84 {
85  // Private Data
86 
87  //- Flux field name
88  word phiName_;
89 
90  //- Density field name
91  word rhoName_;
92 
93  //- Inlet direction
94  vectorField inletDir_;
95 
96 
97 public:
98 
99  //- Runtime type information
100  TypeName("pressureDirectedInletVelocity");
101 
102 
103  // Constructors
104 
105  //- Construct from patch and internal field
107  (
108  const fvPatch&,
110  );
111 
112  //- Construct from patch, internal field and dictionary
114  (
115  const fvPatch&,
117  const dictionary&
118  );
119 
120  //- Construct by mapping given
121  // pressureDirectedInletVelocityFvPatchVectorField
122  // onto a new patch
124  (
126  const fvPatch&,
128  const fvPatchFieldMapper&
129  );
130 
131  //- Copy constructor
133  (
135  );
136 
137  //- Construct and return a clone
138  virtual tmp<fvPatchVectorField> clone() const
139  {
141  (
143  );
144  }
145 
146  //- Copy constructor setting internal field reference
148  (
151  );
152 
153  //- Construct and return a clone setting internal field reference
155  (
157  ) const
158  {
160  (
162  (
163  *this,
164  iF
165  )
166  );
167  }
168 
169 
170  // Member Functions
171 
172  // Attributes
173 
174  //- Return true: this patch field is altered by assignment
175  virtual bool assignable() const
176  {
177  return true;
178  }
179 
180  // Access
181 
182  //- Return the name of rho
183  const word& rhoName() const
184  {
185  return rhoName_;
186  }
187 
188  //- Return reference to the name of rho to allow adjustment
189  word& rhoName()
190  {
191  return rhoName_;
192  }
193 
194  //- Return the name of phi
195  const word& phiName() const
196  {
197  return phiName_;
198  }
199 
200  //- Return reference to the name of phi to allow adjustment
201  word& phiName()
202  {
203  return phiName_;
204  }
205 
206 
207  // Mapping functions
209  //- Map (and resize as needed) from self given a mapping object
210  // Used to update fields following mesh topology change
211  virtual void autoMap(const fvPatchFieldMapper&);
212 
213  //- Reverse map the given fvPatchField onto this fvPatchField
214  // Used to reconstruct fields
215  virtual void rmap(const fvPatchVectorField&, const labelList&);
216 
217 
218  //- Update the coefficients associated with the patch field
219  virtual void updateCoeffs();
221  //- Write
222  virtual void write(Ostream&) const;
223 
224 
225  // Member Operators
226 
227  virtual void operator=(const fvPatchField<vector>& pvf);
228 };
229 
230 
231 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
232 
233 } // End namespace Foam
234 
235 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
236 
237 #endif
238 
239 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
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:66
virtual bool assignable() const
Return true: this patch field is altered by assignment.
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:54
virtual void rmap(const fvPatchVectorField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
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:53
Namespace for OpenFOAM.