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