FreeFOAM The Cross-Platform CFD Toolkit
pressureInletOutletVelocityFvPatchVectorField.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) 1991-2010 OpenCFD Ltd.
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::pressureInletOutletVelocityFvPatchVectorField
26 
27 Description
28  Velocity inlet/outlet boundary condition patches for where the pressure is
29  specified. zero-gradient is applied for outflow (as defined by the flux)
30  and for inflow the velocity is obtained from the patch-face normal
31  component of the internal-cell value.
32 
33 SourceFiles
34  pressureInletOutletVelocityFvPatchVectorField.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef pressureInletOutletVelocityFvPatchVectorField_H
39 #define pressureInletOutletVelocityFvPatchVectorField_H
40 
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class pressureInletOutletVelocityFvPatch Declaration
51 \*---------------------------------------------------------------------------*/
52 
54 :
55  public directionMixedFvPatchVectorField
56 {
57  // Private data
58 
59  word phiName_;
60 
61  //- Optional tangential velocity component
62  vectorField tangentialVelocity_;
63 
64 
65 public:
66 
67  //- Runtime type information
68  TypeName("pressureInletOutletVelocity");
69 
70 
71  // Constructors
72 
73  //- Construct from patch and internal field
75  (
76  const fvPatch&,
78  );
79 
80  //- Construct from patch, internal field and dictionary
82  (
83  const fvPatch&,
85  const dictionary&
86  );
87 
88  //- Construct by mapping given
89  // pressureInletOutletVelocityFvPatchVectorField onto a new patch
91  (
93  const fvPatch&,
95  const fvPatchFieldMapper&
96  );
97 
98  //- Construct as copy
100  (
102  );
103 
104  //- Construct and return a clone
106  {
108  (
110  );
111  }
112 
113  //- Construct as copy setting internal field reference
115  (
118  );
119 
120  //- Construct and return a clone setting internal field reference
122  (
124  ) const
125  {
127  (
129  );
130  }
131 
132 
133  // Member functions
134 
135  // Access
136 
137  //- Return the name of phi
138  const word& phiName() const
139  {
140  return phiName_;
141  }
142 
143  //- Return reference to the name of phi to allow adjustment
145  {
146  return phiName_;
147  }
148 
149  //- Return the tangential velocity
151  {
152  return tangentialVelocity_;
153  }
154 
155  //- Reset the tangential velocity
157 
158 
159  // Mapping functions
160 
161  //- Map (and resize as needed) from self given a mapping object
162  virtual void autoMap
163  (
164  const fvPatchFieldMapper&
165  );
166 
167  //- Reverse map the given fvPatchField onto this fvPatchField
168  virtual void rmap
169  (
170  const fvPatchVectorField&,
171  const labelList&
172  );
173 
174 
175  //- Update the coefficients associated with the patch field
176  virtual void updateCoeffs();
177 
178  //- Write
179  virtual void write(Ostream&) const;
180 
181 
182  // Member operators
183 
184  virtual void operator=(const fvPatchField<vector>& pvf);
185 };
186 
187 
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 
190 } // End namespace Foam
191 
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 
194 #endif
195 
196 // ************************ vim: set sw=4 sts=4 et: ************************ //