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-2020 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  //- Disallow copy without setting internal field reference
133  (
135  ) = delete;
136 
137  //- Copy constructor setting internal field reference
139  (
142  );
143 
144  //- Construct and return a clone setting internal field reference
146  (
148  ) const
149  {
151  (
153  (
154  *this,
155  iF
156  )
157  );
158  }
159 
160 
161  // Member Functions
162 
163  // Attributes
164 
165  //- Return true: this patch field is altered by assignment
166  virtual bool assignable() const
167  {
168  return true;
169  }
170 
171  // Access
172 
173  //- Return the name of rho
174  const word& rhoName() const
175  {
176  return rhoName_;
177  }
178 
179  //- Return reference to the name of rho to allow adjustment
180  word& rhoName()
181  {
182  return rhoName_;
183  }
184 
185  //- Return the name of phi
186  const word& phiName() const
187  {
188  return phiName_;
189  }
190 
191  //- Return reference to the name of phi to allow adjustment
192  word& phiName()
193  {
194  return phiName_;
195  }
196 
197 
198  // Mapping functions
200  //- Map (and resize as needed) from self given a mapping object
201  // Used to update fields following mesh topology change
202  virtual void autoMap(const fvPatchFieldMapper&);
203 
204  //- Reverse map the given fvPatchField onto this fvPatchField
205  // Used to reconstruct fields
206  virtual void rmap(const fvPatchVectorField&, const labelList&);
207 
208 
209  //- Update the coefficients associated with the patch field
210  virtual void updateCoeffs();
212  //- Write
213  virtual void write(Ostream&) const;
214 
215 
216  // Member Operators
217 
218  virtual void operator=(const fvPatchField<vector>& pvf);
219 };
220 
221 
222 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
223 
224 } // End namespace Foam
225 
226 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
227 
228 #endif
229 
230 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
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:62
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 DimensionedField< vector, volMesh > &iF) const
Construct and return a clone setting internal field reference.
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.