Loading...
Searching...
No Matches
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
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 //- Name of the density field used to normalize the mass flux
86 word rhoName_;
87
88 //- Is volumetric?
89 bool volumetric_;
90
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 );
126
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 as copy setting internal field reference
146 (
149 );
150
151 //- Return a clone
152 virtual tmp<fvPatchField<vector>> clone() const
153 {
154 return fvPatchField<vector>::Clone(*this);
155 }
156
157 //- Clone with an internal field reference
159 (
161 ) const
162 {
163 return fvPatchField<vector>::Clone(*this, iF);
164 }
165
166
167 // Member functions
168
169 //- Update the coefficients associated with the patch field
170 virtual void updateCoeffs();
171
172 //- Write
173 virtual void write(Ostream&) const;
174};
175
176
177// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178
179} // End namespace Foam
180
181// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182
183#endif
184
185// ************************************************************************* //
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:59
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
A FieldMapper for finite-volume patch fields.
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
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< fvPatchField< vector > > clone() const
Return a clone.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual tmp< fvPatchField< vector > > clone(const DimensionedField< vector, volMesh > &iF) const
Clone with an internal field reference.
matchedFlowRateOutletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
A class for managing temporary objects.
Definition tmp.H:75
A class for handling words, derived from Foam::string.
Definition word.H:66
Namespace for OpenFOAM.
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68