matchedFlowRateOutletVelocityFvPatchVectorField.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::matchedFlowRateOutletVelocityFvPatchVectorField
28
29Group
30 grpOutletBoundaryConditions
31
32Description
33 Velocity outlet boundary condition which corrects the extrapolated velocity
34 to match the flow rate of the specified corresponding inlet patch.
35
36Usage
37 \table
38 Property | Description | Required | Default value
39 inletPatch | Corresponding inlet patch name | yes |
40 volumetric | Set volumetric or mass flow-rate | no | false
41 rho | density field name | no | rho
42 \endtable
43
44 Example of the boundary condition specification for a volumetric flow rate:
45 \verbatim
46 <patchName>
47 {
48 type matchedFlowRateOutletVelocity;
49 inletPatch inlet;
50 value uniform (0 0 0);
51 }
52 \endverbatim
53
54See also
55 Foam::fixedValueFvPatchField
56
57SourceFiles
58 matchedFlowRateOutletVelocityFvPatchVectorField.C
59
60\*---------------------------------------------------------------------------*/
61
62#ifndef matchedFlowRateOutletVelocityFvPatchVectorField_H
63#define matchedFlowRateOutletVelocityFvPatchVectorField_H
64
66
67// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
68
69namespace Foam
70{
71
72/*---------------------------------------------------------------------------*\
73 Class matchedFlowRateOutletVelocityFvPatchVectorField Declaration
74\*---------------------------------------------------------------------------*/
75
76class matchedFlowRateOutletVelocityFvPatchVectorField
77:
78 public fixedValueFvPatchVectorField
79{
80 // Private data
81
82 //- Inlet patch name from which the corresponding flow rate is obtained
83 word inletPatchName_;
84
85 //- Is volumetric?
86 bool volumetric_;
87
88 //- Name of the density field used to normalize the mass flux
89 word rhoName_;
90
91
92 // Private member functions
93
94 //- Update the patch values given the appropriate density type and value
95 template<class RhoType>
96 void updateValues
97 (
98 const label inletPatchID,
99 const RhoType& rhoOutlet,
100 const RhoType& rhoInlet
101 );
102
103
104public:
105
106 //- Runtime type information
107 TypeName("matchedFlowRateOutletVelocity");
108
109
110 // Constructors
111
112 //- Construct from patch and internal field
114 (
115 const fvPatch&,
117 );
118
119 //- Construct from patch, internal field and dictionary
121 (
122 const fvPatch&,
124 const dictionary&
125 );
127 //- Construct by mapping given
128 // matchedFlowRateOutletVelocityFvPatchVectorField
129 // onto a new patch
131 (
133 const fvPatch&,
135 const fvPatchFieldMapper&
136 );
137
138 //- Construct as copy
140 (
142 );
143
144 //- Construct and return a clone
145 virtual tmp<fvPatchVectorField> clone() const
146 {
148 (
150 );
151 }
152
153 //- Construct as copy setting internal field reference
155 (
158 );
159
160 //- Construct and return a clone setting internal field reference
162 (
164 ) const
165 {
167 (
169 );
170 }
171
172
173 // Member functions
174
175 //- Update the coefficients associated with the patch field
176 virtual void updateCoeffs();
177
178 //- Write
179 virtual void write(Ostream&) const;
181
182
183// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184
185} // End namespace Foam
186
187// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188
189#endif
190
191// ************************************************************************* //
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 list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A FieldMapper for finite-volume patch fields.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:71
Velocity outlet boundary condition which corrects the extrapolated velocity to match the flow rate of...
TypeName("matchedFlowRateOutletVelocity")
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 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