pressureDirectedInletOutletVelocityFvPatchVectorField.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::pressureDirectedInletOutletVelocityFvPatchVectorField
28 
29 Group
30  grpInletBoundaryConditions grpOutletBoundaryConditions
31 
32 Description
33  This velocity inlet/outlet boundary condition is applied to pressure
34  boundaries where the pressure is specified. A zero-gradient condition is
35  applied for outflow (as defined by the flux); for inflow, the velocity
36  is obtained from the flux with the specified inlet direction.
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  inletDirection | inlet direction per patch face | yes |
44  \endtable
45 
46  Example of the boundary condition specification:
47  \verbatim
48  <patchName>
49  {
50  type pressureDirectedInletOutletVelocity;
51  phi phi;
52  rho rho;
53  inletDirection uniform (1 0 0);
54  value uniform 0;
55  }
56  \endverbatim
57 
58 Note
59  Sign conventions:
60  - positive flux (out of domain): apply zero-gradient condition
61  - negative flux (into of domain): derive from the flux with specified
62  direction
63 
64 See also
65  Foam::mixedFvPatchVectorField
66 
67 SourceFiles
68  pressureDirectedInletOutletVelocityFvPatchVectorField.C
69 
70 \*---------------------------------------------------------------------------*/
71 
72 #ifndef pressureDirectedInletOutletVelocityFvPatchVectorField_H
73 #define pressureDirectedInletOutletVelocityFvPatchVectorField_H
74 
75 #include "fvPatchFields.H"
76 #include "mixedFvPatchFields.H"
77 
78 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
79 
80 namespace Foam
81 {
82 
83 /*---------------------------------------------------------------------------*\
84  Class pressureDirectedInletOutletVelocityFvPatchVectorField Declaration
85 \*---------------------------------------------------------------------------*/
86 
87 class pressureDirectedInletOutletVelocityFvPatchVectorField
88 :
89  public mixedFvPatchVectorField
90 {
91  // Private data
92 
93  //- Flux field name
94  word phiName_;
95 
96  //- Density field name
97  word rhoName_;
98 
99  //- Inlet direction
100  vectorField inletDir_;
101 
102 
103 public:
104 
105  //- Runtime type information
106  TypeName("pressureDirectedInletOutletVelocity");
107 
108 
109  // Constructors
110 
111  //- Construct from patch and internal field
113  (
114  const fvPatch&,
116  );
117 
118  //- Construct from patch, internal field and dictionary
120  (
121  const fvPatch&,
123  const dictionary&
124  );
125 
126  //- Construct by mapping given
127  // pressureDirectedInletOutletVelocityFvPatchVectorField
128  // onto a new patch
130  (
132  const fvPatch&,
134  const fvPatchFieldMapper&
135  );
136 
137  //- Construct as copy
139  (
141  );
142 
143  //- Construct and return a clone
144  virtual tmp<fvPatchVectorField> clone() const
145  {
147  (
149  (
150  *this
151  )
152  );
153  }
154 
155  //- Construct as copy setting internal field reference
157  (
160  );
161 
162  //- Construct and return a clone setting internal field reference
164  (
166  ) const
167  {
169  (
171  (
172  *this,
173  iF
174  )
175  );
176  }
177 
178 
179  // Member functions
180 
181  // Attributes
182 
183  //- Return true: this patch field is altered by assignment
184  virtual bool assignable() const
185  {
186  return true;
187  }
188 
189 
190  // Access
191 
192  //- Return the name of rho
193  const word& rhoName() const
194  {
195  return rhoName_;
196  }
197 
198  //- Return reference to the name of rho to allow adjustment
199  word& rhoName()
200  {
201  return rhoName_;
202  }
203 
204  //- Return the name of phi
205  const word& phiName() const
206  {
207  return phiName_;
208  }
209 
210  //- Return reference to the name of phi to allow adjustment
211  word& phiName()
212  {
213  return phiName_;
214  }
215 
216 
217  // Mapping functions
218 
219  //- Map (and resize as needed) from self given a mapping object
220  virtual void autoMap
221  (
222  const fvPatchFieldMapper&
223  );
224 
225  //- Reverse map the given fvPatchField onto this fvPatchField
226  virtual void rmap
227  (
228  const fvPatchVectorField&,
229  const labelList&
230  );
231 
232 
233  //- Update the coefficients associated with the patch field
234  virtual void updateCoeffs();
235 
236  //- Write
237  virtual void write(Ostream&) const;
238 
239 
240  // Member operators
241 
242  virtual void operator=(const fvPatchField<vector>& pvf);
243 };
244 
245 
246 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
247 
248 } // End namespace Foam
249 
250 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
251 
252 #endif
253 
254 // ************************************************************************* //
Foam::fvPatchField< vector >
Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: pressureDirectedInletOutletVelocityFvPatchVectorField.C:122
Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::assignable
virtual bool assignable() const
Return true: this patch field is altered by assignment.
Definition: pressureDirectedInletOutletVelocityFvPatchVectorField.H:203
Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::TypeName
TypeName("pressureDirectedInletOutletVelocity")
Runtime type information.
Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::rhoName
const word & rhoName() const
Return the name of rho.
Definition: pressureDirectedInletOutletVelocityFvPatchVectorField.H:212
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:59
Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::rmap
virtual void rmap(const fvPatchVectorField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: pressureDirectedInletOutletVelocityFvPatchVectorField.C:132
Foam::vectorField
Field< vector > vectorField
Specialisation of Field<T> for vector.
Definition: primitiveFieldsFwd.H:54
Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::rhoName
word & rhoName()
Return reference to the name of rho to allow adjustment.
Definition: pressureDirectedInletOutletVelocityFvPatchVectorField.H:218
Foam::Field< vector >
Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::phiName
const word & phiName() const
Return the name of phi.
Definition: pressureDirectedInletOutletVelocityFvPatchVectorField.H:224
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::phiName
word & phiName()
Return reference to the name of phi to allow adjustment.
Definition: pressureDirectedInletOutletVelocityFvPatchVectorField.H:230
Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: pressureDirectedInletOutletVelocityFvPatchVectorField.C:147
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
Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::write
virtual void write(Ostream &) const
Write.
Definition: pressureDirectedInletOutletVelocityFvPatchVectorField.C:191
mixedFvPatchFields.H
Foam::pressureDirectedInletOutletVelocityFvPatchVectorField
This velocity inlet/outlet boundary condition is applied to pressure boundaries where the pressure is...
Definition: pressureDirectedInletOutletVelocityFvPatchVectorField.H:106
fvPatchFields.H
Foam::List< label >
Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::clone
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
Definition: pressureDirectedInletOutletVelocityFvPatchVectorField.H:163
Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::pressureDirectedInletOutletVelocityFvPatchVectorField
pressureDirectedInletOutletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Definition: pressureDirectedInletOutletVelocityFvPatchVectorField.C:39
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::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54
Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::operator=
virtual void operator=(const fvPatchField< vector > &pvf)
Definition: pressureDirectedInletOutletVelocityFvPatchVectorField.C:206