pressureNormalInletOutletVelocityFvPatchVectorField.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::pressureNormalInletOutletVelocityFvPatchVectorField
26 
27 Group
28  grpInletBoundaryConditions grpOutletBoundaryConditions
29 
30 Description
31  This velocity inlet/outlet boundary condition is applied to patches where
32  the pressure is specified. A zero-gradient condition is applied for
33  outflow (as defined by the flux); for inflow, the velocity is obtained from
34  the flux with a direction normal to the patch faces.
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  \endtable
42 
43  Example of the boundary condition specification:
44  \verbatim
45  <patchName>
46  {
47  type pressureNormalInletOutletVelocity;
48  phi phi;
49  rho rho;
50  value uniform 0;
51  }
52  \endverbatim
53 
54 Note
55  Sign conventions:
56  - positive flux (out of domain): apply zero-gradient condition
57  - negative flux (into of domain): derive from the flux and patch-normal
58  direction
59 
60 See also
61  Foam::mixedFvPatchVectorField
62 
63 SourceFiles
64  pressureNormalInletOutletVelocityFvPatchVectorField.C
65 
66 \*---------------------------------------------------------------------------*/
67 
68 #ifndef pressureNormalInletOutletVelocityFvPatchVectorField_H
69 #define pressureNormalInletOutletVelocityFvPatchVectorField_H
70 
71 #include "fvPatchFields.H"
72 #include "mixedFvPatchFields.H"
73 
74 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
75 
76 namespace Foam
77 {
78 
79 /*---------------------------------------------------------------------------*\
80  Class pressureNormalInletOutletVelocityFvPatchVectorField Declaration
81 \*---------------------------------------------------------------------------*/
82 
83 class pressureNormalInletOutletVelocityFvPatchVectorField
84 :
85  public mixedFvPatchVectorField
86 {
87  // Private data
88 
89  //- Flux field name
90  word phiName_;
91 
92  //- Density field name
93  word rhoName_;
94 
95 
96 public:
97 
98  //- Runtime type information
99  TypeName("pressureNormalInletOutletVelocity");
100 
101 
102  // Constructors
103 
104  //- Construct from patch and internal field
106  (
107  const fvPatch&,
109  );
110 
111  //- Construct from patch, internal field and dictionary
113  (
114  const fvPatch&,
116  const dictionary&
117  );
118 
119  //- Construct by mapping given
120  // pressureNormalInletOutletVelocityFvPatchVectorField
121  // onto a new patch
123  (
125  const fvPatch&,
127  const fvPatchFieldMapper&
128  );
129 
130  //- Construct as copy
132  (
134  );
135 
136  //- Construct and return a clone
137  virtual tmp<fvPatchVectorField> clone() const
138  {
140  (
142  (
143  *this
144  )
145  );
146  }
147 
148  //- Construct as copy setting internal field reference
150  (
153  );
154 
155  //- Construct and return a clone setting internal field reference
157  (
159  ) const
160  {
162  (
164  (
165  *this,
166  iF
167  )
168  );
169  }
170 
172  // Member functions
173 
174  // Attributes
175 
176  //- Return true: this patch field is altered by assignment
177  virtual bool assignable() const
178  {
179  return true;
180  }
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 
204  //- Return reference to the name of phi to allow adjustment
205  word& phiName()
206  {
207  return phiName_;
208  }
209 
210 
211  //- Update the coefficients associated with the patch field
212  virtual void updateCoeffs();
213 
214  //- Write
215  virtual void write(Ostream&) const;
216 
217 
218  // Member operators
220  virtual void operator=(const fvPatchField<vector>& pvf);
221 };
222 
223 
224 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
225 
226 } // End namespace Foam
227 
228 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229 
230 #endif
231 
232 // ************************************************************************* //
This velocity inlet/outlet boundary condition is applied to patches where the pressure is specified...
pressureNormalInletOutletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
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
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
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
TypeName("pressureNormalInletOutletVelocity")
Runtime type information.
A class for handling words, derived from string.
Definition: word.H:59
Foam::fvPatchFieldMapper.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
virtual bool assignable() const
Return true: this patch field is altered by assignment.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A class for managing temporary objects.
Definition: PtrList.H:53
Namespace for OpenFOAM.