FreeFOAM The Cross-Platform CFD Toolkit
pressureDirectedInletVelocityFvPatchVectorField.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::pressureDirectedInletVelocityFvPatchVectorField
26 
27 Description
28  Velocity inlet boundary condition for patches where the pressure is
29  specified. The inflow velocity is obtained from the flux with the
30  specified "inletDirection" direction. If reverse flow is possible or
31  expected use the "pressureDirectedInletOutletVelocityFvPatchVectorField"
32  BC instead.
33 
34 SourceFiles
35  pressureDirectedInletVelocityFvPatchVectorField.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef pressureDirectedInletVelocityFvPatchVectorField_H
40 #define pressureDirectedInletVelocityFvPatchVectorField_H
41 
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class pressureDirectedInletVelocityFvPatch Declaration
52 \*---------------------------------------------------------------------------*/
53 
55 :
56  public fixedValueFvPatchVectorField
57 {
58  // Private data
59 
60  word phiName_;
61  word rhoName_;
62  vectorField inletDir_;
63 
64 
65 public:
66 
67  //- Runtime type information
68  TypeName("pressureDirectedInletVelocity");
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  // pressureDirectedInletVelocityFvPatchVectorField
90  // onto a new patch
92  (
94  const fvPatch&,
96  const fvPatchFieldMapper&
97  );
98 
99  //- Construct as copy
101  (
103  );
104 
105  //- Construct and return a clone
107  {
109  (
111  );
112  }
113 
114  //- Construct as copy setting internal field reference
116  (
119  );
120 
121  //- Construct and return a clone setting internal field reference
123  (
125  ) const
126  {
128  (
130  (
131  *this,
132  iF
133  )
134  );
135  }
136 
137 
138  // Member functions
139 
140  // Access
141 
142  //- Return the name of rho
143  const word& rhoName() const
144  {
145  return rhoName_;
146  }
147 
148  //- Return reference to the name of rho to allow adjustment
150  {
151  return rhoName_;
152  }
153 
154  //- Return the name of phi
155  const word& phiName() const
156  {
157  return phiName_;
158  }
159 
160  //- Return reference to the name of phi to allow adjustment
162  {
163  return phiName_;
164  }
165 
166 
167  // Mapping functions
168 
169  //- Map (and resize as needed) from self given a mapping object
170  virtual void autoMap
171  (
172  const fvPatchFieldMapper&
173  );
174 
175  //- Reverse map the given fvPatchField onto this fvPatchField
176  virtual void rmap
177  (
178  const fvPatchVectorField&,
179  const labelList&
180  );
181 
182 
183  //- Update the coefficients associated with the patch field
184  virtual void updateCoeffs();
185 
186  //- Write
187  virtual void write(Ostream&) const;
188 
189 
190  // Member operators
191 
192  virtual void operator=(const fvPatchField<vector>& pvf);
193 };
194 
195 
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 
198 } // End namespace Foam
199 
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201 
202 #endif
203 
204 // ************************ vim: set sw=4 sts=4 et: ************************ //