pressureNormalInletOutletVelocityFvPatchVectorField.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-2019 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 Description
28  This velocity inlet/outlet boundary condition is applied to patches where
29  the pressure is specified. A zero-gradient condition is applied for
30  outflow (as defined by the flux); for inflow, the velocity is obtained from
31  the flux with a direction normal to the patch faces.
32 
33 Usage
34  \table
35  Property | Description | Required | Default value
36  phi | flux field name | no | phi
37  rho | density field name | no | rho
38  \endtable
39 
40  Example of the boundary condition specification:
41  \verbatim
42  <patchName>
43  {
44  type pressureNormalInletOutletVelocity;
45  phi phi;
46  rho rho;
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 and patch-normal
55  direction
56 
57 See also
58  Foam::mixedFvPatchVectorField
59 
60 SourceFiles
61  pressureNormalInletOutletVelocityFvPatchVectorField.C
62 
63 \*---------------------------------------------------------------------------*/
64 
65 #ifndef pressureNormalInletOutletVelocityFvPatchVectorField_H
66 #define pressureNormalInletOutletVelocityFvPatchVectorField_H
67 
68 #include "fvPatchFields.H"
69 #include "mixedFvPatchFields.H"
70 
71 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
72 
73 namespace Foam
74 {
75 
76 /*---------------------------------------------------------------------------*\
77  Class pressureNormalInletOutletVelocityFvPatchVectorField Declaration
78 \*---------------------------------------------------------------------------*/
79 
80 class pressureNormalInletOutletVelocityFvPatchVectorField
81 :
82  public mixedFvPatchVectorField
83 {
84  // Private Data
85 
86  //- Flux field name
87  word phiName_;
88 
89  //- Density field name
90  word rhoName_;
91 
92 
93 public:
94 
95  //- Runtime type information
96  TypeName("pressureNormalInletOutletVelocity");
97 
98 
99  // Constructors
100 
101  //- Construct from patch and internal field
103  (
104  const fvPatch&,
106  );
107 
108  //- Construct from patch, internal field and dictionary
110  (
111  const fvPatch&,
113  const dictionary&
114  );
115 
116  //- Construct by mapping given
117  // pressureNormalInletOutletVelocityFvPatchVectorField
118  // onto a new patch
120  (
122  const fvPatch&,
124  const fvPatchFieldMapper&
125  );
126 
127  //- Copy constructor
129  (
131  );
132 
133  //- Construct and return a clone
134  virtual tmp<fvPatchVectorField> clone() const
135  {
137  (
139  (
140  *this
141  )
142  );
143  }
144 
145  //- Copy constructor setting internal field reference
147  (
150  );
151 
152  //- Construct and return a clone setting internal field reference
154  (
156  ) const
157  {
159  (
161  (
162  *this,
163  iF
164  )
165  );
166  }
167 
169  // Member Functions
170 
171  // Attributes
172 
173  //- Return true: this patch field is altered by assignment
174  virtual bool assignable() const
175  {
176  return true;
177  }
178 
179 
180  // Access
181 
182  //- Return the name of rho
183  const word& rhoName() const
184  {
185  return rhoName_;
186  }
187 
188  //- Return reference to the name of rho to allow adjustment
189  word& rhoName()
190  {
191  return rhoName_;
192  }
193 
194  //- Return the name of phi
195  const word& phiName() const
196  {
197  return phiName_;
198  }
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();
210 
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 // ************************************************************************* //
This velocity inlet/outlet boundary condition is applied to patches where the pressure is specified...
pressureNormalInletOutletVelocityFvPatchVectorField(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:158
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:66
TypeName("pressureNormalInletOutletVelocity")
Runtime type information.
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
virtual bool assignable() const
Return true: this patch field is altered by assignment.
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.