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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::pressureNormalInletOutletVelocityFvPatchVectorField
28 
29 Group
30  grpInletBoundaryConditions grpOutletBoundaryConditions
31 
32 Description
33  This velocity inlet/outlet boundary condition is applied to patches where
34  the pressure is specified. A zero-gradient condition is applied for
35  outflow (as defined by the flux); for inflow, the velocity is obtained from
36  the flux with a direction normal to the patch faces.
37 
38 Usage
39  \table
40  Property | Description | Required | Default value
41  phi | flux field name | no | phi
42  rho | density field name | no | rho
43  \endtable
44 
45  Example of the boundary condition specification:
46  \verbatim
47  <patchName>
48  {
49  type pressureNormalInletOutletVelocity;
50  phi phi;
51  rho rho;
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 and patch-normal
60  direction
61 
62 See also
63  Foam::mixedFvPatchVectorField
64 
65 SourceFiles
66  pressureNormalInletOutletVelocityFvPatchVectorField.C
67 
68 \*---------------------------------------------------------------------------*/
69 
70 #ifndef pressureNormalInletOutletVelocityFvPatchVectorField_H
71 #define pressureNormalInletOutletVelocityFvPatchVectorField_H
72 
73 #include "fvPatchFields.H"
74 #include "mixedFvPatchFields.H"
75 
76 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
77 
78 namespace Foam
79 {
80 
81 /*---------------------------------------------------------------------------*\
82  Class pressureNormalInletOutletVelocityFvPatchVectorField Declaration
83 \*---------------------------------------------------------------------------*/
84 
85 class pressureNormalInletOutletVelocityFvPatchVectorField
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 
98 public:
99 
100  //- Runtime type information
101  TypeName("pressureNormalInletOutletVelocity");
102 
103 
104  // Constructors
105 
106  //- Construct from patch and internal field
108  (
109  const fvPatch&,
111  );
112 
113  //- Construct from patch, internal field and dictionary
115  (
116  const fvPatch&,
118  const dictionary&
119  );
120 
121  //- Construct by mapping given
122  // pressureNormalInletOutletVelocityFvPatchVectorField
123  // onto a new patch
125  (
127  const fvPatch&,
129  const fvPatchFieldMapper&
130  );
131 
132  //- Construct as copy
134  (
136  );
137 
138  //- Construct and return a clone
139  virtual tmp<fvPatchVectorField> clone() const
140  {
142  (
144  (
145  *this
146  )
147  );
148  }
149 
150  //- Construct as copy setting internal field reference
152  (
155  );
156 
157  //- Construct and return a clone setting internal field reference
159  (
161  ) const
162  {
164  (
166  (
167  *this,
168  iF
169  )
170  );
171  }
172 
173 
174  // Member functions
175 
176  // Attributes
177 
178  //- Return true: this patch field is altered by assignment
179  virtual bool assignable() const
180  {
181  return true;
182  }
183 
184 
185  // Access
186 
187  //- Return the name of rho
188  const word& rhoName() const
189  {
190  return rhoName_;
191  }
192 
193  //- Return reference to the name of rho to allow adjustment
194  word& rhoName()
195  {
196  return rhoName_;
197  }
198 
199  //- Return the name of phi
200  const word& phiName() const
201  {
202  return phiName_;
203  }
204 
205 
206  //- Return reference to the name of phi to allow adjustment
207  word& phiName()
208  {
209  return phiName_;
210  }
211 
212 
213  //- Update the coefficients associated with the patch field
214  virtual void updateCoeffs();
215 
216  //- Write
217  virtual void write(Ostream&) const;
218 
219 
220  // Member operators
221 
222  virtual void operator=(const fvPatchField<vector>& pvf);
223 };
224 
225 
226 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
227 
228 } // End namespace Foam
229 
230 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
231 
232 #endif
233 
234 // ************************************************************************* //
Foam::fvPatchField< vector >
Foam::pressureNormalInletOutletVelocityFvPatchVectorField
This velocity inlet/outlet boundary condition is applied to patches where the pressure is specified....
Definition: pressureNormalInletOutletVelocityFvPatchVectorField.H:99
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::pressureNormalInletOutletVelocityFvPatchVectorField::pressureNormalInletOutletVelocityFvPatchVectorField
pressureNormalInletOutletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Definition: pressureNormalInletOutletVelocityFvPatchVectorField.C:40
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::pressureNormalInletOutletVelocityFvPatchVectorField::operator=
virtual void operator=(const fvPatchField< vector > &pvf)
Definition: pressureNormalInletOutletVelocityFvPatchVectorField.C:175
Foam::pressureNormalInletOutletVelocityFvPatchVectorField::assignable
virtual bool assignable() const
Return true: this patch field is altered by assignment.
Definition: pressureNormalInletOutletVelocityFvPatchVectorField.H:193
Foam::pressureNormalInletOutletVelocityFvPatchVectorField::rhoName
word & rhoName()
Return reference to the name of rho to allow adjustment.
Definition: pressureNormalInletOutletVelocityFvPatchVectorField.H:208
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
mixedFvPatchFields.H
Foam::pressureNormalInletOutletVelocityFvPatchVectorField::TypeName
TypeName("pressureNormalInletOutletVelocity")
Runtime type information.
Foam::pressureNormalInletOutletVelocityFvPatchVectorField::phiName
word & phiName()
Return reference to the name of phi to allow adjustment.
Definition: pressureNormalInletOutletVelocityFvPatchVectorField.H:221
Foam::pressureNormalInletOutletVelocityFvPatchVectorField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: pressureNormalInletOutletVelocityFvPatchVectorField.C:117
fvPatchFields.H
Foam::pressureNormalInletOutletVelocityFvPatchVectorField::phiName
const word & phiName() const
Return the name of phi.
Definition: pressureNormalInletOutletVelocityFvPatchVectorField.H:214
Foam::pressureNormalInletOutletVelocityFvPatchVectorField::rhoName
const word & rhoName() const
Return the name of rho.
Definition: pressureNormalInletOutletVelocityFvPatchVectorField.H:202
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::pressureNormalInletOutletVelocityFvPatchVectorField::clone
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
Definition: pressureNormalInletOutletVelocityFvPatchVectorField.H:153
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54
Foam::pressureNormalInletOutletVelocityFvPatchVectorField::write
virtual void write(Ostream &) const
Write.
Definition: pressureNormalInletOutletVelocityFvPatchVectorField.C:161