pressureInletOutletParSlipVelocityFvPatchVectorField.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-2013 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::pressureInletOutletParSlipVelocityFvPatchVectorField
26 
27 Group
28  grpInletBoundaryConditions grpOutletBoundaryConditions
29 
30 Description
31  This velocity inlet/outlet boundary condition for pressure boundary where
32  the pressure is specified. A zero-gradient is applied for outflow (as
33  defined by the flux); for inflow, the velocity is obtained from the flux
34  with the specified inlet direction.
35 
36  A slip condition is applied tangential to the patch.
37 
38  \heading Patch usage
39 
40  \table
41  Property | Description | Required | Default value
42  phi | flux field name | no | phi
43  rho | density field name | no | rho
44  \endtable
45 
46  Example of the boundary condition specification:
47  \verbatim
48  myPatch
49  {
50  type pressureInletOutletParSlipVelocity;
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 with specified
59  direction
60 
61 SeeAlso
62  Foam::mixedFvPatchVectorField
63  Foam::pressureDirectedInletOutletVelocityFvPatchVectorField
64 
65 SourceFiles
66  pressureInletOutletParSlipVelocityFvPatchVectorField.C
67 
68 \*---------------------------------------------------------------------------*/
69 
70 #ifndef pressureInletOutletParSlipVelocityFvPatchVectorField_H
71 #define pressureInletOutletParSlipVelocityFvPatchVectorField_H
72 
73 #include "fvPatchFields.H"
74 #include "mixedFvPatchFields.H"
75 
76 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
77 
78 namespace Foam
79 {
80 
81 /*---------------------------------------------------------------------------*\
82  Class pressureInletOutletParSlipVelocityFvPatchVectorField Declaration
83 \*---------------------------------------------------------------------------*/
84 
85 class pressureInletOutletParSlipVelocityFvPatchVectorField
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("pressureInletOutletParSlipVelocity");
102 
103 
104  // Constructors
105 
106  //- Construct from patch and internal field
108  (
109  const fvPatch&,
111  );
112 
113  //- Construct by mapping given
114  // pressureInletOutletParSlipVelocityFvPatchVectorField
115  // onto a new patch
117  (
119  const fvPatch&,
121  const fvPatchFieldMapper&
122  );
123 
124  //- Construct from patch, internal field and dictionary
126  (
127  const fvPatch&,
129  const dictionary&
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 
174  // Member functions
175 
176  // Access
177 
178  //- Return the name of rho
179  const word& rhoName() const
180  {
181  return rhoName_;
182  }
183 
184  //- Return reference to the name of rho to allow adjustment
185  word& rhoName()
186  {
187  return rhoName_;
188  }
189 
190  //- Return the name of phi
191  const word& phiName() const
192  {
193  return phiName_;
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();
206  //- Write
207  virtual void write(Ostream&) const;
208 
209 
210  // Member operators
212  virtual void operator=(const fvPatchField<vector>& pvf);
213 };
214 
215 
216 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
217 
218 } // End namespace Foam
219 
220 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
221 
222 #endif
223 
224 // ************************************************************************* //
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
pressureInletOutletParSlipVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
A class for handling words, derived from string.
Definition: word.H:59
This velocity inlet/outlet boundary condition for pressure boundary where the pressure is specified...
Foam::fvPatchFieldMapper.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
Namespace for OpenFOAM.
TypeName("pressureInletOutletParSlipVelocity")
Runtime type information.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:65
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
A class for managing temporary objects.
Definition: PtrList.H:118