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-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::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 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 pressureInletOutletParSlipVelocity;
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 with specified
58  direction
59 
60 See also
61  Foam::mixedFvPatchVectorField
62  Foam::pressureDirectedInletOutletVelocityFvPatchVectorField
63 
64 SourceFiles
65  pressureInletOutletParSlipVelocityFvPatchVectorField.C
66 
67 \*---------------------------------------------------------------------------*/
68 
69 #ifndef pressureInletOutletParSlipVelocityFvPatchVectorField_H
70 #define pressureInletOutletParSlipVelocityFvPatchVectorField_H
71 
72 #include "fvPatchFields.H"
73 #include "mixedFvPatchFields.H"
74 
75 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
76 
77 namespace Foam
78 {
79 
80 /*---------------------------------------------------------------------------*\
81  Class pressureInletOutletParSlipVelocityFvPatchVectorField Declaration
82 \*---------------------------------------------------------------------------*/
83 
84 class pressureInletOutletParSlipVelocityFvPatchVectorField
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("pressureInletOutletParSlipVelocity");
101 
102 
103  // Constructors
104 
105  //- Construct from patch and internal field
107  (
108  const fvPatch&,
110  );
111 
112  //- Construct by mapping given
113  // pressureInletOutletParSlipVelocityFvPatchVectorField
114  // onto a new patch
116  (
118  const fvPatch&,
120  const fvPatchFieldMapper&
121  );
122 
123  //- Construct from patch, internal field and dictionary
125  (
126  const fvPatch&,
128  const dictionary&
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 
173  // Member functions
174 
175  // Attributes
176 
177  //- Return true: this patch field is altered by assignment
178  virtual bool assignable() const
179  {
180  return true;
181  }
182 
183 
184  // Access
185 
186  //- Return the name of rho
187  const word& rhoName() const
188  {
189  return rhoName_;
190  }
191 
192  //- Return reference to the name of rho to allow adjustment
193  word& rhoName()
194  {
195  return rhoName_;
196  }
197 
198  //- Return the name of phi
199  const word& phiName() const
200  {
201  return phiName_;
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();
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 // ************************************************************************* //
pressureInletOutletParSlipVelocityFvPatchVectorField(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 bool assignable() const
Return true: this patch field is altered by assignment.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
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
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
This velocity inlet/outlet boundary condition for pressure boundary where the pressure is specified...
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:54
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
Namespace for OpenFOAM.