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 as copy setting internal field reference
152  (
155  );
156 
157  //- Return a clone
158  virtual tmp<fvPatchField<vector>> clone() const
159  {
160  return fvPatchField<vector>::Clone(*this);
161  }
162 
163  //- Clone with an internal field reference
165  (
167  ) const
168  {
169  return fvPatchField<vector>::Clone(*this, iF);
170  }
171 
172 
173  // Member Functions
174 
175  //- True: this patch field is altered by assignment
176  virtual bool assignable() const { return true; }
177 
178 
179  // Access
180 
181  //- Return the name of phi
182  const word& phiName() const
183  {
184  return phiName_;
185  }
186 
187  //- Return reference to the name of phi to allow adjustment
188  word& phiName()
189  {
190  return phiName_;
191  }
192 
193  //- Return the name of rho
194  const word& rhoName() const
195  {
196  return rhoName_;
197  }
198 
199  //- Return reference to the name of rho to allow adjustment
200  word& rhoName()
201  {
202  return rhoName_;
203  }
204 
205  //- Return the name of deltaf
206  const word& deltafName() const
207  {
208  return deltafName_;
209  }
210 
211  //- Return reference to the name of df to allow adjustment
212  word& deltafName()
213  {
214  return deltafName_;
215  }
216 
217 
218  //- Update the coefficients associated with the patch field
219  virtual void updateCoeffs();
220 
221  //- Write
222  virtual void write(Ostream&) const;
223 
224 
225  // Member operators
226 
227  virtual void operator=(const fvPatchField<vector>& pvf);
228 };
229 
230 
231 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
232 
233 } // End namespace Foam
234 
235 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
236 
237 #endif
238 
239 // ************************************************************************* //
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:
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
Definition: fvPatchField.H:597
A FieldMapper for finite-volume patch fields.
virtual bool assignable() const
True: this patch field is altered by assignment.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
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...
virtual tmp< fvPatchField< vector > > clone() const
Return a clone.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Namespace for OpenFOAM.