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 | Copyright (C) 2011-2012 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::pressureDirectedInletOutletVelocityFvPatchVectorField
26 
27 Group
28  grpInletBoundaryConditions grpOutletBoundaryConditions
29 
30 Description
31  This velocity inlet/outlet boundary condition is applied to pressure
32  boundaries where the pressure is specified. A zero-gradient condtion is
33  applied for outflow (as defined by the flux); for inflow, the velocity
34  is obtained from the flux with the specified inlet direction.
35 
36  \heading Patch usage
37 
38  \table
39  Property | Description | Required | Default value
40  phi | flux field name | no | phi
41  rho | density field name | no | rho
42  inletDirection | inlet direction per patch face | yes |
43  \endtable
44 
45  Example of the boundary condition specification:
46  \verbatim
47  myPatch
48  {
49  type pressureDirectedInletOutletVelocity;
50  phi phi;
51  rho rho;
52  inletDirection uniform (1 0 0);
53  value uniform 0;
54  }
55  \endverbatim
56 
57 Note
58  Sign conventions:
59  - positive flux (out of domain): apply zero-gradient condition
60  - negative flux (into of domain): derive from the flux with specified
61  direction
62 
63 SeeAlso
64  Foam::mixedFvPatchVectorField
65 
66 SourceFiles
67  pressureDirectedInletOutletVelocityFvPatchVectorField.C
68 
69 \*---------------------------------------------------------------------------*/
70 
71 #ifndef pressureDirectedInletOutletVelocityFvPatchVectorField_H
72 #define pressureDirectedInletOutletVelocityFvPatchVectorField_H
73 
74 #include "fvPatchFields.H"
75 #include "mixedFvPatchFields.H"
76 
77 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
78 
79 namespace Foam
80 {
81 
82 /*---------------------------------------------------------------------------*\
83  Class pressureDirectedInletOutletVelocityFvPatchVectorField Declaration
84 \*---------------------------------------------------------------------------*/
85 
86 class pressureDirectedInletOutletVelocityFvPatchVectorField
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  //- Inlet direction
100 
101 
102 public:
103 
104  //- Runtime type information
105  TypeName("pressureDirectedInletOutletVelocity");
106 
107 
108  // Constructors
109 
110  //- Construct from patch and internal field
112  (
113  const fvPatch&,
115  );
116 
117  //- Construct from patch, internal field and dictionary
119  (
120  const fvPatch&,
122  const dictionary&
123  );
124 
125  //- Construct by mapping given
126  // pressureDirectedInletOutletVelocityFvPatchVectorField
127  // onto a new patch
129  (
131  const fvPatch&,
133  const fvPatchFieldMapper&
134  );
135 
136  //- Construct as copy
138  (
140  );
141 
142  //- Construct and return a clone
143  virtual tmp<fvPatchVectorField> clone() const
144  {
146  (
148  (
149  *this
150  )
151  );
152  }
153 
154  //- Construct as copy setting internal field reference
156  (
159  );
160 
161  //- Construct and return a clone setting internal field reference
163  (
165  ) const
166  {
168  (
170  (
171  *this,
172  iF
173  )
174  );
175  }
176 
177 
178  // Member functions
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  //- Return reference to the name of phi to allow adjustment
201  word& phiName()
202  {
203  return phiName_;
204  }
205 
206 
207  // Mapping functions
208 
209  //- Map (and resize as needed) from self given a mapping object
210  virtual void autoMap
211  (
212  const fvPatchFieldMapper&
213  );
214 
215  //- Reverse map the given fvPatchField onto this fvPatchField
216  virtual void rmap
217  (
218  const fvPatchVectorField&,
219  const labelList&
220  );
221 
222 
223  //- Update the coefficients associated with the patch field
224  virtual void updateCoeffs();
225 
226  //- Write
227  virtual void write(Ostream&) const;
228 
229 
230  // Member operators
231 
232  virtual void operator=(const fvPatchField<vector>& pvf);
233 };
234 
235 
236 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
237 
238 } // End namespace Foam
239 
240 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
241 
242 #endif
243 
244 // ************************************************************************* //
Foam::fvPatchField
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:65
Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: pressureDirectedInletOutletVelocityFvPatchVectorField.C:118
Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::TypeName
TypeName("pressureDirectedInletOutletVelocity")
Runtime type information.
Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::rhoName
const word & rhoName() const
Return the name of rho.
Definition: pressureDirectedInletOutletVelocityFvPatchVectorField.H:202
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::rmap
virtual void rmap(const fvPatchVectorField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: pressureDirectedInletOutletVelocityFvPatchVectorField.C:128
Foam::vectorField
Field< vector > vectorField
Specialisation of Field<T> for vector.
Definition: primitiveFieldsFwd.H:49
Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::rhoName
word & rhoName()
Return reference to the name of rho to allow adjustment.
Definition: pressureDirectedInletOutletVelocityFvPatchVectorField.H:208
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::phiName
const word & phiName() const
Return the name of phi.
Definition: pressureDirectedInletOutletVelocityFvPatchVectorField.H:214
Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::rhoName_
word rhoName_
Density field name.
Definition: pressureDirectedInletOutletVelocityFvPatchVectorField.H:115
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::phiName
word & phiName()
Return reference to the name of phi to allow adjustment.
Definition: pressureDirectedInletOutletVelocityFvPatchVectorField.H:220
Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: pressureDirectedInletOutletVelocityFvPatchVectorField.C:143
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::write
virtual void write(Ostream &) const
Write.
Definition: pressureDirectedInletOutletVelocityFvPatchVectorField.C:187
mixedFvPatchFields.H
Foam::pressureDirectedInletOutletVelocityFvPatchVectorField
This velocity inlet/outlet boundary condition is applied to pressure boundaries where the pressure is...
Definition: pressureDirectedInletOutletVelocityFvPatchVectorField.H:105
fvPatchFields.H
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::inletDir_
vectorField inletDir_
Inlet direction.
Definition: pressureDirectedInletOutletVelocityFvPatchVectorField.H:118
Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::clone
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
Definition: pressureDirectedInletOutletVelocityFvPatchVectorField.H:162
Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::phiName_
word phiName_
Flux field name.
Definition: pressureDirectedInletOutletVelocityFvPatchVectorField.H:112
Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::pressureDirectedInletOutletVelocityFvPatchVectorField
pressureDirectedInletOutletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Definition: pressureDirectedInletOutletVelocityFvPatchVectorField.C:36
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51
Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::operator=
virtual void operator=(const fvPatchField< vector > &pvf)
Definition: pressureDirectedInletOutletVelocityFvPatchVectorField.C:202