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-2012 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  \heading Patch usage
37 
38  \table
39  Property | Description | Required | Default value
40  phi | flux field name | no | phi
41  rho | density field name | no | rho
42  \endtable
43 
44  Example of the boundary condition specification:
45  \verbatim
46  myPatch
47  {
48  type pressureNormalInletOutletVelocity;
49  phi phi;
50  rho rho;
51  value uniform 0;
52  }
53  \endverbatim
54 
55 Note
56  Sign conventions:
57  - positive flux (out of domain): apply zero-gradient condition
58  - negative flux (into of domain): derive from the flux and patch-normal
59  direction
60 
61 SeeAlso
62  Foam::mixedFvPatchVectorField
63 
64 SourceFiles
65  pressureNormalInletOutletVelocityFvPatchVectorField.C
66 
67 \*---------------------------------------------------------------------------*/
68 
69 #ifndef pressureNormalInletOutletVelocityFvPatchVectorField_H
70 #define pressureNormalInletOutletVelocityFvPatchVectorField_H
71 
72 #include "fvPatchFields.H"
73 #include "mixedFvPatchFields.H"
74 
75 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
76 
77 namespace Foam
78 {
79 
80 /*---------------------------------------------------------------------------*\
81  Class pressureNormalInletOutletVelocityFvPatchVectorField Declaration
82 \*---------------------------------------------------------------------------*/
83 
84 class pressureNormalInletOutletVelocityFvPatchVectorField
85 :
86  public mixedFvPatchVectorField
87 {
88  // Private data
89 
90  //- Flux field name
91  word phiName_;
92 
93  //- Density field name
94  word rhoName_;
95 
96 
97 public:
98 
99  //- Runtime type information
100  TypeName("pressureNormalInletOutletVelocity");
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  // pressureNormalInletOutletVelocityFvPatchVectorField
122  // onto a new patch
124  (
126  const fvPatch&,
128  const fvPatchFieldMapper&
129  );
130 
131  //- Construct as copy
133  (
135  );
136 
137  //- Construct and return a clone
138  virtual tmp<fvPatchVectorField> clone() const
139  {
141  (
143  (
144  *this
145  )
146  );
147  }
148 
149  //- Construct as copy setting internal field reference
151  (
154  );
155 
156  //- Construct and return a clone setting internal field reference
158  (
160  ) const
161  {
163  (
165  (
166  *this,
167  iF
168  )
169  );
170  }
171 
172 
173  // Member functions
174 
175  // Access
176 
177  //- Return the name of rho
178  const word& rhoName() const
179  {
180  return rhoName_;
181  }
182 
183  //- Return reference to the name of rho to allow adjustment
184  word& rhoName()
185  {
186  return rhoName_;
187  }
188 
189  //- Return the name of phi
190  const word& phiName() const
191  {
192  return phiName_;
193  }
194 
195 
196  //- Return reference to the name of phi to allow adjustment
197  word& phiName()
198  {
199  return phiName_;
200  }
201 
202 
203  //- Update the coefficients associated with the patch field
204  virtual void updateCoeffs();
205 
206  //- Write
207  virtual void write(Ostream&) const;
208 
209 
210  // Member operators
211 
212  virtual void operator=(const fvPatchField<vector>& pvf);
213 };
214 
215 
216 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
217 
218 } // End namespace Foam
219 
220 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
221 
222 #endif
223 
224 // ************************************************************************* //
Foam::fvPatchField
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:65
Foam::pressureNormalInletOutletVelocityFvPatchVectorField
This velocity inlet/outlet boundary condition is applied to patches where the pressure is specified....
Definition: pressureNormalInletOutletVelocityFvPatchVectorField.H:98
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::pressureNormalInletOutletVelocityFvPatchVectorField::pressureNormalInletOutletVelocityFvPatchVectorField
pressureNormalInletOutletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Definition: pressureNormalInletOutletVelocityFvPatchVectorField.C:37
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::pressureNormalInletOutletVelocityFvPatchVectorField::rhoName_
word rhoName_
Density field name.
Definition: pressureNormalInletOutletVelocityFvPatchVectorField.H:108
Foam::pressureNormalInletOutletVelocityFvPatchVectorField::operator=
virtual void operator=(const fvPatchField< vector > &pvf)
Definition: pressureNormalInletOutletVelocityFvPatchVectorField.C:171
Foam::pressureNormalInletOutletVelocityFvPatchVectorField::rhoName
word & rhoName()
Return reference to the name of rho to allow adjustment.
Definition: pressureNormalInletOutletVelocityFvPatchVectorField.H:198
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::pressureNormalInletOutletVelocityFvPatchVectorField::phiName_
word phiName_
Flux field name.
Definition: pressureNormalInletOutletVelocityFvPatchVectorField.H:105
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:211
Foam::pressureNormalInletOutletVelocityFvPatchVectorField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: pressureNormalInletOutletVelocityFvPatchVectorField.C:113
fvPatchFields.H
Foam::pressureNormalInletOutletVelocityFvPatchVectorField::phiName
const word & phiName() const
Return the name of phi.
Definition: pressureNormalInletOutletVelocityFvPatchVectorField.H:204
Foam::pressureNormalInletOutletVelocityFvPatchVectorField::rhoName
const word & rhoName() const
Return the name of rho.
Definition: pressureNormalInletOutletVelocityFvPatchVectorField.H:192
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
Foam::pressureNormalInletOutletVelocityFvPatchVectorField::clone
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
Definition: pressureNormalInletOutletVelocityFvPatchVectorField.H:152
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51
Foam::pressureNormalInletOutletVelocityFvPatchVectorField::write
virtual void write(Ostream &) const
Write.
Definition: pressureNormalInletOutletVelocityFvPatchVectorField.C:157