variableHeightFlowRateInletVelocityFvPatchVectorField.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) 2011-2016 OpenFOAM Foundation
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::variableHeightFlowRateInletVelocityFvPatchVectorField
26 
27 Group
28  grpInletBoundaryConditions
29 
30 Description
31  This boundary condition provides a velocity boundary condition for
32  multphase flow based on a user-specified volumetric flow rate.
33 
34  The flow rate is made proportional to the phase fraction alpha at each
35  face of the patch and alpha is ensured to be bound between 0 and 1.
36 
37 Usage
38  \table
39  Property | Description | Required | Default value
40  flowRate | volumetric flow rate [m3/s] | yes |
41  alpha | phase-fraction field | yes |
42  \endtable
43 
44  Example of the boundary condition specification:
45  \verbatim
46  <patchName>
47  {
48  type variableHeightFlowRateInletVelocity;
49  flowRate 0.2;
50  alpha alpha.water;
51  value uniform (0 0 0); // placeholder
52  }
53  \endverbatim
54 
55  The \c flowRate entry is a \c Function1 of time, see Foam::Function1Types.
56 
57 Note
58  - the value is positive into the domain
59  - may not work correctly for transonic inlets
60  - strange behaviour with potentialFoam since the momentum equation is
61  not solved
62 
63 See also
64  Foam::fixedValueFvPatchField
65  Foam::Function1Types
66 
67 SourceFiles
68  variableHeightFlowRateInletVelocityFvPatchVectorField.C
69 
70 \*---------------------------------------------------------------------------*/
71 
72 #ifndef variableHeightFlowRateInletVelocityFvPatchVectorField_H
73 #define variableHeightFlowRateInletVelocityFvPatchVectorField_H
74 
76 #include "Function1.H"
77 
78 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
79 
80 namespace Foam
81 {
82 /*---------------------------------------------------------------------------*\
83  Class variableHeightFlowRateInletVelocityFvPatchVectorField Declaration
84 \*---------------------------------------------------------------------------*/
85 
86 class variableHeightFlowRateInletVelocityFvPatchVectorField
87 :
88  public fixedValueFvPatchVectorField
89 {
90  // Private data
91 
92  //- Inlet integral flow rate
93  autoPtr<Function1<scalar>> flowRate_;
94 
95  //- Name of the phase-fraction field
96  word alphaName_;
97 
98 
99 public:
101  //- Runtime type information
102  TypeName("variableHeightFlowRateInletVelocity");
103 
104 
105  // Constructors
106 
107  //- Construct from patch and internal field
109  (
110  const fvPatch&,
112  );
113 
114  //- Construct from patch, internal field and dictionary
116  (
117  const fvPatch&,
119  const dictionary&
120  );
121 
122  //- Construct by mapping given
123  // variableHeightFlowRateInletVelocityFvPatchVectorField
124  // onto a new patch
126  (
128  const fvPatch&,
130  const fvPatchFieldMapper&
131  );
132 
133  //- Construct as copy
135  (
137  );
138 
139  //- Construct and return a clone
140  virtual tmp<fvPatchVectorField> clone() const
141  {
143  (
145  );
146  }
147 
148  //- Construct as copy setting internal field reference
150  (
153  );
155  //- Construct and return a clone setting internal field reference
157  (
159  ) const
160  {
162  (
164  (
165  *this,
166  iF
167  )
168  );
169  }
170 
172  // Member functions
173 
174  //- Update the coefficients associated with the patch field
175  virtual void updateCoeffs();
176 
177  //- Write
178  virtual void write(Ostream&) const;
179 };
180 
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 } // End namespace Foam
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 
188 #endif
189 
190 // ************************************************************************* //
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
This boundary condition provides a velocity boundary condition for multphase flow based on a user-spe...
Foam::fvPatchFieldMapper.
variableHeightFlowRateInletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A class for managing temporary objects.
Definition: PtrList.H:53
TypeName("variableHeightFlowRateInletVelocity")
Runtime type information.
Namespace for OpenFOAM.