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-2023 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, internal field and dictionary
106  (
107  const fvPatch&,
109  const dictionary&
110  );
111 
112  //- Construct by mapping given
113  // variableHeightFlowRateInletVelocityFvPatchVectorField
114  // onto a new patch
116  (
118  const fvPatch&,
120  const fvPatchFieldMapper&
121  );
122 
123  //- Disallow copy without setting internal field reference
125  (
127  ) = delete;
128 
129  //- Copy constructor setting internal field reference
131  (
134  );
135 
136  //- Construct and return a clone setting internal field reference
138  (
140  ) const
141  {
143  (
145  (
146  *this,
147  iF
148  )
149  );
150  }
151 
152 
153  // Member Functions
154 
155  //- Update the coefficients associated with the patch field
156  virtual void updateCoeffs();
157 
158  //- Write
159  virtual void write(Ostream&) const;
160 };
161 
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 } // End namespace Foam
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 #endif
170 
171 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Foam::fvPatchFieldMapper.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:64
A class for managing temporary objects.
Definition: tmp.H:55
This boundary condition provides a velocity boundary condition for multiphase flow based on a user-sp...
virtual tmp< fvPatchVectorField > clone(const DimensionedField< vector, volMesh > &iF) const
Construct and return a clone setting internal field reference.
variableHeightFlowRateInletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
TypeName("variableHeightFlowRateInletVelocity")
Runtime type information.
Namespace for OpenFOAM.