flowRateOutletVelocityFvPatchVectorField.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) 2017 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::flowRateOutletVelocityFvPatchVectorField
28
29Group
30 grpOutletBoundaryConditions
31
32Description
33 Velocity outlet boundary condition which corrects the extrapolated velocity
34 to match the specified flow rate.
35
36 For a mass-based flux:
37 - the flow rate should be provided in kg/s
38 - if \c rho is "none" the flow rate is in m^3/s
39 - otherwise \c rho should correspond to the name of the density field
40 - if the density field cannot be found in the database, the user must
41 specify the outlet density using the \c rhoOutlet entry
42
43 For a volumetric-based flux:
44 - the flow rate is in m^3/s
45
46Usage
47 \table
48 Property | Description | Required | Default value
49 massFlowRate | mass flow rate [kg/s] | no |
50 volumetricFlowRate | volumetric flow rate [m^3/s]| no |
51 rho | density field name | no | rho
52 rhoOutlet | outlet density | no |
53 \endtable
54
55 Example of the boundary condition specification for a volumetric flow rate:
56 \verbatim
57 <patchName>
58 {
59 type flowRateOutletVelocity;
60 volumetricFlowRate 0.2;
61 value uniform (0 0 0);
62 }
63 \endverbatim
64
65 Example of the boundary condition specification for a mass flow rate:
66 \verbatim
67 <patchName>
68 {
69 type flowRateOutletVelocity;
70 massFlowRate 0.2;
71 rhoOutlet 1.0;
72 value uniform (0 0 0);
73 }
74 \endverbatim
75
76 The \c flowRate entry is a \c Function1 of time, see Foam::Function1Types.
77
78Note
79 - \c rhoOutlet is required for the case of a mass flow rate, where the
80 density field is not available at start-up
81 - The value is positive out of the domain (as an outlet)
82 - May not work correctly for transonic outlets
83 - Strange behaviour with potentialFoam since the U equation is not solved
84
85See also
86 Foam::fixedValueFvPatchField
87 Foam::Function1Types
88 Foam::flowRateInletVelocityFvPatchVectorField
89
90SourceFiles
91 flowRateOutletVelocityFvPatchVectorField.C
92
93\*---------------------------------------------------------------------------*/
94
95#ifndef flowRateOutletVelocityFvPatchVectorField_H
96#define flowRateOutletVelocityFvPatchVectorField_H
97
99#include "Function1.H"
100
101// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
102
103namespace Foam
104{
105
106/*---------------------------------------------------------------------------*\
107 Class flowRateOutletVelocityFvPatchVectorField Declaration
108\*---------------------------------------------------------------------------*/
109
110class flowRateOutletVelocityFvPatchVectorField
111:
112 public fixedValueFvPatchVectorField
113{
114 // Private data
115
116 //- Outlet integral flow rate
117 autoPtr<Function1<scalar>> flowRate_;
118
119 //- Is volumetric?
120 bool volumetric_;
121
122 //- Name of the density field used to normalize the mass flux
123 word rhoName_;
124
125 //- Rho initialisation value (for start; if value not supplied)
126 scalar rhoOutlet_;
127
128
129 // Private member functions
130
131 //- Update the patch values given the appropriate density type and value
132 template<class RhoType>
133 void updateValues(const RhoType& rho);
135
136public:
137
138 //- Runtime type information
139 TypeName("flowRateOutletVelocity");
140
141
142 // Constructors
143
144 //- Construct from patch and internal field
146 (
147 const fvPatch&,
149 );
150
151 //- Construct from patch, internal field and dictionary
153 (
154 const fvPatch&,
156 const dictionary&
157 );
158
159 //- Construct by mapping given
160 // flowRateOutletVelocityFvPatchVectorField
161 // onto a new patch
165 const fvPatch&,
167 const fvPatchFieldMapper&
168 );
169
170 //- Construct as copy
172 (
174 );
175
176 //- Construct and return a clone
177 virtual tmp<fvPatchVectorField> clone() const
178 {
180 (
182 );
183 }
184
185 //- Construct as copy setting internal field reference
187 (
190 );
191
192 //- Construct and return a clone setting internal field reference
194 (
196 ) const
197 {
199 (
201 );
202 }
203
204
205 // Member functions
206
207 //- Update the coefficients associated with the patch field
208 virtual void updateCoeffs();
209
210 //- Write
211 virtual void write(Ostream&) const;
212};
213
214
215// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216
217} // End namespace Foam
218
219// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
220
221#endif
222
223// ************************************************************************* //
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
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 outlet boundary condition which corrects the extrapolated velocity to match the specified fl...
virtual tmp< fvPatchVectorField > clone(const DimensionedField< vector, volMesh > &iF) const
Construct and return a clone setting internal field reference.
TypeName("flowRateOutletVelocity")
Runtime type information.
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