filmHeightInletVelocityFvPatchVectorField.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::filmHeightInletVelocityFvPatchVectorField
28 
29 Group
30  grpSurfaceFilmBoundaryConditions
31 
32 Description
33  This boundary condition is designed to be used in conjunction with
34  surface film modelling. It provides a velocity inlet boundary condition
35  for patches where the film height is specified. The inflow velocity is
36  obtained from the flux with a direction normal to the patch faces using:
37 
38  \f[
39  U_p = \frac{n \phi}{\rho |Sf| \delta}
40  \f]
41 
42  where
43  \vartable
44  U_p | patch velocity [m/s]
45  n | patch normal vector
46  \phi | mass flux [kg/s]
47  \rho | density [kg/m3]
48  Sf | patch face area vectors [m2]
49  \delta | film height [m]
50  \endvartable
51 
52 Usage
53  \table
54  Property | Description | Required | Default value
55  phi | Flux field name | no | phi
56  rho | density field name | no | rho
57  deltaf | height field name | no | deltaf
58  \endtable
59 
60  Example of the boundary condition specification:
61  \verbatim
62  <patchName>
63  {
64  type filmHeightInletVelocity;
65  phi phi;
66  rho rho;
67  deltaf deltaf;
68  value uniform (0 0 0); // initial velocity / [m/s]
69  }
70  \endverbatim
71 
72 See also
73  Foam::fixedValueFvPatchField
74 
75 SourceFiles
76  filmHeightInletVelocityFvPatchVectorField.C
77 
78 \*---------------------------------------------------------------------------*/
79 
80 #ifndef filmHeightInletVelocityFvPatchVectorField_H
81 #define filmHeightInletVelocityFvPatchVectorField_H
82 
83 #include "fvPatchFields.H"
85 
86 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
87 
88 namespace Foam
89 {
90 
91 /*---------------------------------------------------------------------------*\
92  Class filmHeightInletVelocityFvPatchVectorField Declaration
93 \*---------------------------------------------------------------------------*/
94 
95 class filmHeightInletVelocityFvPatchVectorField
96 :
97  public fixedValueFvPatchVectorField
98 {
99  // Private data
100 
101  //- Name of flux field
102  word phiName_;
103 
104  //- Name of density field
105  word rhoName_;
106 
107  //- Name of film height field
108  word deltafName_;
109 
110 
111 public:
112 
113  //- Runtime type information
114  TypeName("filmHeightInletVelocity");
115 
116 
117  // Constructors
118 
119  //- Construct from patch and internal field
121  (
122  const fvPatch&,
123  const DimensionedField<vector, volMesh>&
124  );
125 
126  //- Construct from patch, internal field and dictionary
128  (
129  const fvPatch&,
130  const DimensionedField<vector, volMesh>&,
131  const dictionary&
132  );
133 
134  //- Construct by mapping given filmHeightInletVelocityFvPatchVectorField
135  // onto a new patch
137  (
139  const fvPatch&,
141  const fvPatchFieldMapper&
142  );
143 
144  //- Construct as copy
146  (
148  );
149 
150  //- Construct and return a clone
151  virtual tmp<fvPatchVectorField> clone() const
152  {
154  (
156  );
157  }
158 
159  //- Construct as copy setting internal field reference
161  (
164  );
165 
166  //- Construct and return a clone setting internal field reference
168  (
170  ) const
171  {
173  (
175  );
176  }
177 
178 
179  // Member Functions
180 
181  //- True: this patch field is altered by assignment
182  virtual bool assignable() const { return true; }
183 
184 
185  // Access
186 
187  //- Return the name of phi
188  const word& phiName() const
189  {
190  return phiName_;
191  }
192 
193  //- Return reference to the name of phi to allow adjustment
194  word& phiName()
195  {
196  return phiName_;
197  }
198 
199  //- Return the name of rho
200  const word& rhoName() const
201  {
202  return rhoName_;
203  }
204 
205  //- Return reference to the name of rho to allow adjustment
206  word& rhoName()
207  {
208  return rhoName_;
209  }
210 
211  //- Return the name of deltaf
212  const word& deltafName() const
213  {
214  return deltafName_;
215  }
216 
217  //- Return reference to the name of df to allow adjustment
218  word& deltafName()
219  {
220  return deltafName_;
221  }
222 
223 
224  //- Update the coefficients associated with the patch field
225  virtual void updateCoeffs();
226 
227  //- Write
228  virtual void write(Ostream&) const;
229 
231  // Member operators
232 
233  virtual void operator=(const fvPatchField<vector>& pvf);
234 };
235 
236 
237 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
238 
239 } // End namespace Foam
240 
241 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
242 
243 #endif
244 
245 // ************************************************************************* //
TypeName("filmHeightInletVelocity")
Runtime type information.
filmHeightInletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
This boundary condition is designed to be used in conjunction with surface film modelling. It provides a velocity inlet boundary condition for patches where the film height is specified. The inflow velocity is obtained from the flux with a direction normal to the patch faces using:
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
A class for handling words, derived from Foam::string.
Definition: word.H:63
A FieldMapper for finite-volume patch fields.
virtual bool assignable() const
True: this patch field is altered by assignment.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: areaFieldsFwd.H:42
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Namespace for OpenFOAM.