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 | 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::pressureInletOutletParSlipVelocityFvPatchVectorField
28 
29 Group
30  grpInletBoundaryConditions grpOutletBoundaryConditions
31 
32 Description
33  This velocity inlet/outlet boundary condition for pressure boundary where
34  the pressure is specified. A zero-gradient is applied for outflow (as
35  defined by the flux); for inflow, the velocity is obtained from the flux
36  with the specified inlet direction.
37 
38  A slip condition is applied tangential to the patch.
39 
40 Usage
41  \table
42  Property | Description | Required | Default value
43  phi | flux field name | no | phi
44  rho | density field name | no | rho
45  \endtable
46 
47  Example of the boundary condition specification:
48  \verbatim
49  <patchName>
50  {
51  type pressureInletOutletParSlipVelocity;
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 with specified
60  direction
61 
62 See also
63  Foam::mixedFvPatchVectorField
64  Foam::pressureDirectedInletOutletVelocityFvPatchVectorField
65 
66 SourceFiles
67  pressureInletOutletParSlipVelocityFvPatchVectorField.C
68 
69 \*---------------------------------------------------------------------------*/
70 
71 #ifndef pressureInletOutletParSlipVelocityFvPatchVectorField_H
72 #define pressureInletOutletParSlipVelocityFvPatchVectorField_H
73 
74 #include "fvPatchFields.H"
75 #include "mixedFvPatchFields.H"
76 
77 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
78 
79 namespace Foam
80 {
81 
82 /*---------------------------------------------------------------------------*\
83  Class pressureInletOutletParSlipVelocityFvPatchVectorField Declaration
84 \*---------------------------------------------------------------------------*/
85 
86 class pressureInletOutletParSlipVelocityFvPatchVectorField
87 :
88  public mixedFvPatchVectorField
89 {
90  // Private data
91 
92  //- Flux field name
93  word phiName_;
94 
95  //- Density field name
96  word rhoName_;
97 
98 
99 public:
100 
101  //- Runtime type information
102  TypeName("pressureInletOutletParSlipVelocity");
103 
104 
105  // Constructors
106 
107  //- Construct from patch and internal field
109  (
110  const fvPatch&,
112  );
113 
114  //- Construct by mapping given
115  // pressureInletOutletParSlipVelocityFvPatchVectorField
116  // onto a new patch
118  (
120  const fvPatch&,
122  const fvPatchFieldMapper&
123  );
124 
125  //- Construct from patch, internal field and dictionary
127  (
128  const fvPatch&,
130  const dictionary&
131  );
132 
133  //- Construct as copy
135  (
137  );
138 
139  //- Construct and return a clone
140  virtual tmp<fvPatchVectorField> clone() const
141  {
143  (
145  (
146  *this
147  )
148  );
149  }
150 
151  //- Construct as copy setting internal field reference
153  (
156  );
157 
158  //- Construct and return a clone setting internal field reference
160  (
162  ) const
163  {
165  (
167  (
168  *this,
169  iF
170  )
171  );
172  }
173 
174 
175  // Member functions
176 
177  // Attributes
178 
179  //- Return true: this patch field is altered by assignment
180  virtual bool assignable() const
181  {
182  return true;
183  }
184 
185 
186  // Access
187 
188  //- Return the name of rho
189  const word& rhoName() const
190  {
191  return rhoName_;
192  }
193 
194  //- Return reference to the name of rho to allow adjustment
195  word& rhoName()
196  {
197  return rhoName_;
198  }
199 
200  //- Return the name of phi
201  const word& phiName() const
202  {
203  return phiName_;
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::pressureInletOutletParSlipVelocityFvPatchVectorField::TypeName
TypeName("pressureInletOutletParSlipVelocity")
Runtime type information.
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::pressureInletOutletParSlipVelocityFvPatchVectorField::operator=
virtual void operator=(const fvPatchField< vector > &pvf)
Definition: pressureInletOutletParSlipVelocityFvPatchVectorField.C:179
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:59
Foam::pressureInletOutletParSlipVelocityFvPatchVectorField::pressureInletOutletParSlipVelocityFvPatchVectorField
pressureInletOutletParSlipVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Definition: pressureInletOutletParSlipVelocityFvPatchVectorField.C:40
Foam::pressureInletOutletParSlipVelocityFvPatchVectorField::assignable
virtual bool assignable() const
Return true: this patch field is altered by assignment.
Definition: pressureInletOutletParSlipVelocityFvPatchVectorField.H:194
Foam::pressureInletOutletParSlipVelocityFvPatchVectorField::phiName
word & phiName()
Return reference to the name of phi to allow adjustment.
Definition: pressureInletOutletParSlipVelocityFvPatchVectorField.H:221
Foam::pressureInletOutletParSlipVelocityFvPatchVectorField::clone
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
Definition: pressureInletOutletParSlipVelocityFvPatchVectorField.H:154
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::pressureInletOutletParSlipVelocityFvPatchVectorField::rhoName
word & rhoName()
Return reference to the name of rho to allow adjustment.
Definition: pressureInletOutletParSlipVelocityFvPatchVectorField.H:209
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
mixedFvPatchFields.H
Foam::pressureInletOutletParSlipVelocityFvPatchVectorField
This velocity inlet/outlet boundary condition for pressure boundary where the pressure is specified....
Definition: pressureInletOutletParSlipVelocityFvPatchVectorField.H:100
fvPatchFields.H
Foam::pressureInletOutletParSlipVelocityFvPatchVectorField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: pressureInletOutletParSlipVelocityFvPatchVectorField.C:117
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::pressureInletOutletParSlipVelocityFvPatchVectorField::phiName
const word & phiName() const
Return the name of phi.
Definition: pressureInletOutletParSlipVelocityFvPatchVectorField.H:215
Foam::pressureInletOutletParSlipVelocityFvPatchVectorField::write
virtual void write(Ostream &) const
Write.
Definition: pressureInletOutletParSlipVelocityFvPatchVectorField.C:165
Foam::pressureInletOutletParSlipVelocityFvPatchVectorField::rhoName
const word & rhoName() const
Return the name of rho.
Definition: pressureInletOutletParSlipVelocityFvPatchVectorField.H:203
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54