pressureDirectedInletOutletVelocityFvPatchVectorField.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::pressureDirectedInletOutletVelocityFvPatchVectorField
26 
27 Group
28  grpInletBoundaryConditions grpOutletBoundaryConditions
29 
30 Description
31  This velocity inlet/outlet boundary condition is applied to pressure
32  boundaries where the pressure is specified. A zero-gradient condtion is
33  applied for outflow (as defined by the flux); for inflow, the velocity
34  is obtained from the flux with the specified inlet direction.
35 
36 Usage
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  <patchName>
47  {
48  type pressureDirectedInletOutletVelocity;
49  phi phi;
50  rho rho;
51  inletDirection uniform (1 0 0);
52  value uniform 0;
53  }
54  \endverbatim
55 
56 Note
57  Sign conventions:
58  - positive flux (out of domain): apply zero-gradient condition
59  - negative flux (into of domain): derive from the flux with specified
60  direction
61 
62 See also
63  Foam::mixedFvPatchVectorField
64 
65 SourceFiles
66  pressureDirectedInletOutletVelocityFvPatchVectorField.C
67 
68 \*---------------------------------------------------------------------------*/
69 
70 #ifndef pressureDirectedInletOutletVelocityFvPatchVectorField_H
71 #define pressureDirectedInletOutletVelocityFvPatchVectorField_H
72 
73 #include "fvPatchFields.H"
74 #include "mixedFvPatchFields.H"
75 
76 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
77 
78 namespace Foam
79 {
80 
81 /*---------------------------------------------------------------------------*\
82  Class pressureDirectedInletOutletVelocityFvPatchVectorField Declaration
83 \*---------------------------------------------------------------------------*/
84 
85 class pressureDirectedInletOutletVelocityFvPatchVectorField
86 :
87  public mixedFvPatchVectorField
88 {
89  // Private data
90 
91  //- Flux field name
92  word phiName_;
93 
94  //- Density field name
95  word rhoName_;
96 
97  //- Inlet direction
98  vectorField inletDir_;
99 
100 
101 public:
102 
103  //- Runtime type information
104  TypeName("pressureDirectedInletOutletVelocity");
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  // pressureDirectedInletOutletVelocityFvPatchVectorField
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  *this
149  )
150  );
151  }
152 
153  //- Construct as copy setting internal field reference
155  (
158  );
159 
160  //- Construct and return a clone setting internal field reference
162  (
164  ) const
165  {
167  (
169  (
170  *this,
171  iF
172  )
173  );
174  }
175 
176 
177  // Member functions
178 
179  // Attributes
180 
181  //- Return true: this patch field is altered by assignment
182  virtual bool assignable() const
183  {
184  return true;
185  }
186 
187 
188  // Access
189 
190  //- Return the name of rho
191  const word& rhoName() const
192  {
193  return rhoName_;
194  }
195 
196  //- Return reference to the name of rho to allow adjustment
197  word& rhoName()
198  {
199  return rhoName_;
200  }
202  //- Return the name of phi
203  const word& phiName() const
204  {
205  return phiName_;
206  }
207 
208  //- Return reference to the name of phi to allow adjustment
209  word& phiName()
210  {
211  return phiName_;
212  }
213 
214 
215  // Mapping functions
217  //- Map (and resize as needed) from self given a mapping object
218  virtual void autoMap
219  (
220  const fvPatchFieldMapper&
221  );
223  //- Reverse map the given fvPatchField onto this fvPatchField
224  virtual void rmap
225  (
226  const fvPatchVectorField&,
227  const labelList&
228  );
229 
230 
231  //- Update the coefficients associated with the patch field
232  virtual void updateCoeffs();
233 
234  //- Write
235  virtual void write(Ostream&) const;
236 
237 
238  // Member operators
239 
240  virtual void operator=(const fvPatchField<vector>& pvf);
241 };
242 
243 
244 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
245 
246 } // End namespace Foam
247 
248 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
249 
250 #endif
251 
252 // ************************************************************************* //
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
pressureDirectedInletOutletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
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 void rmap(const fvPatchVectorField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
A class for handling words, derived from string.
Definition: word.H:59
Foam::fvPatchFieldMapper.
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
This velocity inlet/outlet boundary condition is applied to pressure boundaries where the pressure is...
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Field< vector > vectorField
Specialisation of Field<T> for vector.
A class for managing temporary objects.
Definition: PtrList.H:53
virtual bool assignable() const
Return true: this patch field is altered by assignment.
TypeName("pressureDirectedInletOutletVelocity")
Runtime type information.
Namespace for OpenFOAM.