pressureInletOutletParSlipVelocityFvPatchVectorField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2018 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 Description
28  This velocity inlet/outlet boundary condition for pressure boundary where
29  the pressure is specified. A zero-gradient is applied for outflow (as
30  defined by the flux); for inflow, the velocity is obtained from the flux
31  with the specified inlet direction.
32 
33  A slip condition is applied tangential to the patch.
34 
35 Usage
36  \table
37  Property | Description | Required | Default value
38  phi | flux field name | no | phi
39  rho | density field name | no | rho
40  \endtable
41 
42  Example of the boundary condition specification:
43  \verbatim
44  <patchName>
45  {
46  type pressureInletOutletParSlipVelocity;
47  value uniform 0;
48  }
49  \endverbatim
50 
51 Note
52  Sign conventions:
53  - positive flux (out of domain): apply zero-gradient condition
54  - negative flux (into of domain): derive from the flux with specified
55  direction
56 
57 See also
58  Foam::mixedFvPatchVectorField
59  Foam::pressureDirectedInletOutletVelocityFvPatchVectorField
60 
61 SourceFiles
62  pressureInletOutletParSlipVelocityFvPatchVectorField.C
63 
64 \*---------------------------------------------------------------------------*/
65 
66 #ifndef pressureInletOutletParSlipVelocityFvPatchVectorField_H
67 #define pressureInletOutletParSlipVelocityFvPatchVectorField_H
68 
69 #include "fvPatchFields.H"
70 #include "mixedFvPatchFields.H"
71 
72 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
73 
74 namespace Foam
75 {
76 
77 /*---------------------------------------------------------------------------*\
78  Class pressureInletOutletParSlipVelocityFvPatchVectorField Declaration
79 \*---------------------------------------------------------------------------*/
80 
81 class pressureInletOutletParSlipVelocityFvPatchVectorField
82 :
83  public mixedFvPatchVectorField
84 {
85  // Private data
86 
87  //- Flux field name
88  word phiName_;
89 
90  //- Density field name
91  word rhoName_;
92 
93 
94 public:
95 
96  //- Runtime type information
97  TypeName("pressureInletOutletParSlipVelocity");
98 
99 
100  // Constructors
101 
102  //- Construct from patch and internal field
104  (
105  const fvPatch&,
107  );
108 
109  //- Construct by mapping given
110  // pressureInletOutletParSlipVelocityFvPatchVectorField
111  // onto a new patch
113  (
115  const fvPatch&,
117  const fvPatchFieldMapper&
118  );
119 
120  //- Construct from patch, internal field and dictionary
122  (
123  const fvPatch&,
125  const dictionary&
126  );
127 
128  //- Construct as copy
130  (
132  );
133 
134  //- Construct and return a clone
135  virtual tmp<fvPatchVectorField> clone() const
136  {
138  (
140  (
141  *this
142  )
143  );
144  }
145 
146  //- Construct as copy setting internal field reference
148  (
151  );
152 
153  //- Construct and return a clone setting internal field reference
155  (
157  ) const
158  {
160  (
162  (
163  *this,
164  iF
165  )
166  );
167  }
168 
170  // Member functions
171 
172  // Attributes
173 
174  //- Return true: this patch field is altered by assignment
175  virtual bool assignable() const
176  {
177  return true;
178  }
179 
180 
181  // Access
182 
183  //- Return the name of rho
184  const word& rhoName() const
185  {
186  return rhoName_;
187  }
188 
189  //- Return reference to the name of rho to allow adjustment
190  word& rhoName()
191  {
192  return rhoName_;
193  }
194 
195  //- Return the name of phi
196  const word& phiName() const
197  {
198  return phiName_;
199  }
200 
201  //- Return reference to the name of phi to allow adjustment
202  word& phiName()
203  {
204  return phiName_;
205  }
206 
207 
208  //- Update the coefficients associated with the patch field
209  virtual void updateCoeffs();
211  //- Write
212  virtual void write(Ostream&) const;
213 
214 
215  // Member operators
217  virtual void operator=(const fvPatchField<vector>& pvf);
218 };
219 
220 
221 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
222 
223 } // End namespace Foam
224 
225 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
226 
227 #endif
228 
229 // ************************************************************************* //
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
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:66
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
A class for handling words, derived from string.
Definition: word.H:59
Foam::fvPatchFieldMapper.
virtual bool assignable() const
Return true: this patch field is altered by assignment.
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:53
Namespace for OpenFOAM.