FreeFOAM The Cross-Platform CFD Toolkit
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) 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::pressureDirectedInletOutletVelocityFvPatchVectorField
26 
27 Description
28  Velocity inlet/outlet boundary condition for pressure boundary where the
29  pressure is specified. zero-gradient is applied for outflow (as defined
30  by the flux) and for inflow the velocity is obtained from the flux with
31  the specified `inletDirection'.
32 
33 SourceFiles
34  pressureDirectedInletOutletVelocityFvPatchVectorField.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef pressureDirectedInletOutletVelocityFvPatchVectorField_H
39 #define pressureDirectedInletOutletVelocityFvPatchVectorField_H
40 
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class pressureDirectedInletOutletVelocityFvPatch Declaration
51 \*---------------------------------------------------------------------------*/
52 
54 :
55  public mixedFvPatchVectorField
56 {
57  // Private data
58 
59  word phiName_;
60  word rhoName_;
61  vectorField inletDir_;
62 
63 
64 public:
65 
66  //- Runtime type information
67  TypeName("pressureDirectedInletOutletVelocity");
68 
69 
70  // Constructors
71 
72  //- Construct from patch and internal field
74  (
75  const fvPatch&,
77  );
78 
79  //- Construct from patch, internal field and dictionary
81  (
82  const fvPatch&,
84  const dictionary&
85  );
86 
87  //- Construct by mapping given
88  // pressureDirectedInletOutletVelocityFvPatchVectorField
89  // 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  *this
112  )
113  );
114  }
115 
116  //- Construct as copy setting internal field reference
118  (
121  );
122 
123  //- Construct and return a clone setting internal field reference
125  (
127  ) const
128  {
130  (
132  (
133  *this,
134  iF
135  )
136  );
137  }
138 
139 
140  // Member functions
141 
142  // Access
143 
144  //- Return the name of rho
145  const word& rhoName() const
146  {
147  return rhoName_;
148  }
149 
150  //- Return reference to the name of rho to allow adjustment
152  {
153  return rhoName_;
154  }
155 
156  //- Return the name of phi
157  const word& phiName() const
158  {
159  return phiName_;
160  }
161 
162  //- Return reference to the name of phi to allow adjustment
164  {
165  return phiName_;
166  }
167 
168 
169  // Mapping functions
170 
171  //- Map (and resize as needed) from self given a mapping object
172  virtual void autoMap
173  (
174  const fvPatchFieldMapper&
175  );
176 
177  //- Reverse map the given fvPatchField onto this fvPatchField
178  virtual void rmap
179  (
180  const fvPatchVectorField&,
181  const labelList&
182  );
183 
184 
185  //- Update the coefficients associated with the patch field
186  virtual void updateCoeffs();
187 
188  //- Write
189  virtual void write(Ostream&) const;
190 
191 
192  // Member operators
193 
194  virtual void operator=(const fvPatchField<vector>& pvf);
195 };
196 
197 
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 
200 } // End namespace Foam
201 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 #endif
205 
206 // ************************ vim: set sw=4 sts=4 et: ************************ //