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  // Attributes
182 
183  //- Return true: this patch field is altered by assignment
184  virtual bool assignable() const
185  {
186  return true;
187  }
188 
189 
190  // Access
191 
192  //- Return the name of phi
193  const word& phiName() const
194  {
195  return phiName_;
196  }
197 
198  //- Return reference to the name of phi to allow adjustment
199  word& phiName()
200  {
201  return phiName_;
202  }
203 
204  //- Return the name of rho
205  const word& rhoName() const
206  {
207  return rhoName_;
208  }
209 
210  //- Return reference to the name of rho to allow adjustment
212  {
213  return rhoName_;
214  }
215 
216  //- Return the name of deltaf
217  const word& deltafName() const
218  {
219  return deltafName_;
220  }
221 
222  //- Return reference to the name of df to allow adjustment
223  word& deltafName()
224  {
225  return deltafName_;
226  }
227 
228 
229  //- Update the coefficients associated with the patch field
230  virtual void updateCoeffs();
231 
232  //- Write
233  virtual void write(Ostream&) const;
234 
235 
236  // Member operators
237 
238  virtual void operator=(const fvPatchField<vector>& pvf);
239 };
240 
241 
242 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
243 
244 } // End namespace Foam
245 
246 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
247 
248 #endif
249 
250 // ************************************************************************* //
Foam::fvPatchField< vector >
Foam::filmHeightInletVelocityFvPatchVectorField::phiName
word & phiName()
Return reference to the name of phi to allow adjustment.
Definition: filmHeightInletVelocityFvPatchVectorField.H:242
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::filmHeightInletVelocityFvPatchVectorField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: filmHeightInletVelocityFvPatchVectorField.C:110
Foam::filmHeightInletVelocityFvPatchVectorField::operator=
virtual void operator=(const fvPatchField< vector > &pvf)
Definition: filmHeightInletVelocityFvPatchVectorField.C:148
Foam::filmHeightInletVelocityFvPatchVectorField::phiName
const word & phiName() const
Return the name of phi.
Definition: filmHeightInletVelocityFvPatchVectorField.H:236
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::filmHeightInletVelocityFvPatchVectorField
This boundary condition is designed to be used in conjunction with surface film modelling....
Definition: filmHeightInletVelocityFvPatchVectorField.H:138
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::filmHeightInletVelocityFvPatchVectorField::deltafName
word & deltafName()
Return reference to the name of df to allow adjustment.
Definition: filmHeightInletVelocityFvPatchVectorField.H:266
Foam::filmHeightInletVelocityFvPatchVectorField::deltafName
const word & deltafName() const
Return the name of deltaf.
Definition: filmHeightInletVelocityFvPatchVectorField.H:260
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::filmHeightInletVelocityFvPatchVectorField::write
virtual void write(Ostream &) const
Write.
Definition: filmHeightInletVelocityFvPatchVectorField.C:135
Foam::filmHeightInletVelocityFvPatchVectorField::filmHeightInletVelocityFvPatchVectorField
filmHeightInletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Definition: filmHeightInletVelocityFvPatchVectorField.C:38
Foam::filmHeightInletVelocityFvPatchVectorField::rhoName
const word & rhoName() const
Return the name of rho.
Definition: filmHeightInletVelocityFvPatchVectorField.H:248
fvPatchFields.H
fixedValueFvPatchFields.H
Foam::filmHeightInletVelocityFvPatchVectorField::clone
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
Definition: filmHeightInletVelocityFvPatchVectorField.H:194
Foam::filmHeightInletVelocityFvPatchVectorField::TypeName
TypeName("filmHeightInletVelocity")
Runtime type information.
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::filmHeightInletVelocityFvPatchVectorField::assignable
virtual bool assignable() const
Return true: this patch field is altered by assignment.
Definition: filmHeightInletVelocityFvPatchVectorField.H:227
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::filmHeightInletVelocityFvPatchVectorField::rhoName
word & rhoName()
Return reference to the name of rho to allow adjustment.
Definition: filmHeightInletVelocityFvPatchVectorField.H:254
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54