flowRateInletVelocityFvPatchVectorField.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-2017 OpenFOAM Foundation
9 Copyright (C) 2019 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::flowRateInletVelocityFvPatchVectorField
29
30Group
31 grpInletBoundaryConditions
32
33Description
34 Velocity inlet boundary condition either correcting the extrapolated
35 velocity or creating a uniform velocity field normal to the patch adjusted
36 to match the specified flow rate
37
38 For a mass-based flux:
39 - the flow rate should be provided in kg/s
40 - if \c rho is "none" the flow rate is in m3/s
41 - otherwise \c rho should correspond to the name of the density field
42 - if the density field cannot be found in the database, the user must
43 specify the inlet density using the \c rhoInlet entry
44
45 For a volumetric-based flux:
46 - the flow rate is in m3/s
47
48Usage
49 \table
50 Property | Description | Required | Default value
51 massFlowRate | mass flow rate [kg/s] | no |
52 volumetricFlowRate | volumetric flow rate [m3/s]| no |
53 rho | density field name | no | rho
54 rhoInlet | inlet density | no |
55 extrapolateProfile | Extrapolate velocity profile | no | false
56 \endtable
57
58 Example of the boundary condition specification for a volumetric flow rate:
59 \verbatim
60 <patchName>
61 {
62 type flowRateInletVelocity;
63 volumetricFlowRate 0.2;
64 extrapolateProfile yes;
65 value uniform (0 0 0);
66 }
67 \endverbatim
68
69 Example of the boundary condition specification for a mass flow rate:
70 \verbatim
71 <patchName>
72 {
73 type flowRateInletVelocity;
74 massFlowRate 0.2;
75 extrapolateProfile yes;
76 rho rho;
77 rhoInlet 1.0;
78 value uniform (0 0 0);
79 }
80 \endverbatim
81
82 The \c flowRate entry is a \c Function1 of time, see Foam::Function1Types.
83
84Note
85 - \c rhoInlet is required for the case of a mass flow rate, where the
86 density field is not available at start-up
87 - The value is positive into the domain (as an inlet)
88 - May not work correctly for transonic inlets
89 - Strange behaviour with potentialFoam since the U equation is not solved
90
91See also
92 Foam::fixedValueFvPatchField
93 Foam::Function1Types
94 Foam::flowRateOutletVelocityFvPatchVectorField
95
96SourceFiles
97 flowRateInletVelocityFvPatchVectorField.C
98
99\*---------------------------------------------------------------------------*/
100
101#ifndef flowRateInletVelocityFvPatchVectorField_H
102#define flowRateInletVelocityFvPatchVectorField_H
103
105#include "Function1.H"
106
107// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
108
109namespace Foam
110{
111
112/*---------------------------------------------------------------------------*\
113 Class flowRateInletVelocityFvPatchVectorField Declaration
114\*---------------------------------------------------------------------------*/
115
116class flowRateInletVelocityFvPatchVectorField
117:
118 public fixedValueFvPatchVectorField
119{
120 // Private Data
121
122 //- Inlet integral flow rate
123 autoPtr<Function1<scalar>> flowRate_;
124
125 //- Name of the density field used to normalize the mass flux
126 word rhoName_;
127
128 //- Rho initialisation value (for start; if value not supplied)
129 scalar rhoInlet_;
130
131 //- Is volumetric?
132 bool volumetric_;
133
134 //- Set true to extrapolate the velocity profile from the interior
135 Switch extrapolateProfile_;
136
137
138 // Private Member Functions
139
140 //- Update the patch values given the appropriate density type and value
141 template<class RhoType>
142 void updateValues(const RhoType& rho);
143
144
145public:
146
147 //- Runtime type information
148 TypeName("flowRateInletVelocity");
149
150
151 // Constructors
152
153 //- Construct from patch and internal field
155 (
156 const fvPatch&,
158 );
159
160 //- Construct from patch, internal field and dictionary
162 (
163 const fvPatch&,
165 const dictionary&
166 );
167
168 //- Construct by mapping given
169 // flowRateInletVelocityFvPatchVectorField
170 // onto a new patch
172 (
174 const fvPatch&,
176 const fvPatchFieldMapper&
177 );
178
179 //- Construct as copy
181 (
183 );
184
185 //- Construct and return a clone
186 virtual tmp<fvPatchVectorField> clone() const
187 {
189 (
191 );
192 }
193
194 //- Construct as copy setting internal field reference
196 (
199 );
200
201 //- Construct and return a clone setting internal field reference
203 (
205 ) const
206 {
208 (
210 );
211 }
212
213
214 // Member Functions
216 //- Update the coefficients associated with the patch field
217 virtual void updateCoeffs();
218
219 //- Write
220 virtual void write(Ostream&) const;
221};
222
223
224// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
225
226} // End namespace Foam
227
228// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229
230#endif
232// ************************************************************************* //
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:62
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:78
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Velocity inlet boundary condition either correcting the extrapolated velocity or creating a uniform v...
TypeName("flowRateInletVelocity")
Runtime type information.
virtual tmp< fvPatchVectorField > clone(const DimensionedField< vector, volMesh > &iF) const
Construct and return a clone setting internal field reference.
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A FieldMapper for finite-volume patch fields.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:71
A class for managing temporary objects.
Definition: tmp.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73