variableHeightFlowRateInletVelocityFvPatchVectorField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2022 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 Description
28  This boundary condition provides a velocity boundary condition for
29  multiphase flow based on a user-specified volumetric flow rate.
30 
31  The flow rate is made proportional to the phase fraction alpha at each
32  face of the patch and alpha is ensured to be bound between 0 and 1.
33 
34 Usage
35  \table
36  Property | Description | Required | Default value
37  flowRate | volumetric flow rate [m^3/s] | yes |
38  alpha | phase-fraction field | yes |
39  \endtable
40 
41  Example of the boundary condition specification:
42  \verbatim
43  <patchName>
44  {
45  type variableHeightFlowRateInletVelocity;
46  flowRate 0.2;
47  alpha alpha.water;
48  value uniform (0 0 0); // placeholder
49  }
50  \endverbatim
51 
52  The \c flowRate entry is a \c Function1 of time, see Foam::Function1s.
53 
54  Note:
55  - the value is positive into the domain
56  - may not work correctly for transonic inlets
57  - strange behaviour with potentialFoam since the momentum equation is
58  not solved
59 
60 See also
61  Foam::fixedValueFvPatchField
62  Foam::Function1s
63 
64 SourceFiles
65  variableHeightFlowRateInletVelocityFvPatchVectorField.C
66 
67 \*---------------------------------------------------------------------------*/
68 
69 #ifndef variableHeightFlowRateInletVelocityFvPatchVectorField_H
70 #define variableHeightFlowRateInletVelocityFvPatchVectorField_H
71 
73 #include "Function1.H"
74 
75 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
76 
77 namespace Foam
78 {
79 /*---------------------------------------------------------------------------*\
80  Class variableHeightFlowRateInletVelocityFvPatchVectorField Declaration
81 \*---------------------------------------------------------------------------*/
82 
83 class variableHeightFlowRateInletVelocityFvPatchVectorField
84 :
85  public fixedValueFvPatchVectorField
86 {
87  // Private Data
88 
89  //- Inlet integral flow rate
90  autoPtr<Function1<scalar>> flowRate_;
91 
92  //- Name of the phase-fraction field
93  word alphaName_;
94 
95 
96 public:
97 
98  //- Runtime type information
99  TypeName("variableHeightFlowRateInletVelocity");
100 
101 
102  // Constructors
103 
104  //- Construct from patch and internal field
106  (
107  const fvPatch&,
109  );
110 
111  //- Construct from patch, internal field and dictionary
113  (
114  const fvPatch&,
116  const dictionary&
117  );
118 
119  //- Construct by mapping given
120  // variableHeightFlowRateInletVelocityFvPatchVectorField
121  // onto a new patch
123  (
125  const fvPatch&,
127  const fvPatchFieldMapper&
128  );
129 
130  //- Disallow copy without setting internal field reference
132  (
134  ) = delete;
135 
136  //- Copy constructor setting internal field reference
138  (
141  );
142 
143  //- Construct and return a clone setting internal field reference
145  (
147  ) const
148  {
150  (
152  (
153  *this,
154  iF
155  )
156  );
157  }
158 
160  // Member Functions
161 
162  //- Update the coefficients associated with the patch field
163  virtual void updateCoeffs();
164 
165  //- Write
166  virtual void write(Ostream&) const;
167 };
168 
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 } // End namespace Foam
173 
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 
176 #endif
177 
178 // ************************************************************************* //
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:156
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:63
virtual tmp< fvPatchVectorField > clone(const DimensionedField< vector, volMesh > &iF) const
Construct and return a clone setting internal field reference.
This boundary condition provides a velocity boundary condition for multiphase flow based on a user-sp...
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:54
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.