Home
Downloads
Documentation
Installation
User Guide
man-pages
API Documentation
README
Release Notes
Changes
License
Support
SourceForge Project
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
finiteVolume
fields
fvPatchFields
derived
flowRateInletVelocity
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 | Copyright (C) 2006-2010 OpenCFD Ltd.
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::flowRateInletVelocityFvPatchVectorField
26
27
Description
28
Describes a volumetric/mass flow normal vector boundary condition by its
29
magnitude as an integral over its area.
30
31
The basis of the patch (volumetric or mass) is determined by the
32
dimensions of the flux, phi.
33
The current density is used to correct the velocity when applying the
34
mass basis.
35
36
Example of the boundary condition specification:
37
@verbatim
38
inlet
39
{
40
type flowRateInletVelocity;
41
flowRate 0.2; // Volumetric/mass flow rate [m3/s or kg/s]
42
value uniform (0 0 0); // placeholder
43
}
44
@endverbatim
45
46
Note
47
- The value is positive inwards
48
- May not work correctly for transonic inlets
49
- Strange behaviour with potentialFoam since the U equation is not solved
50
51
SourceFiles
52
flowRateInletVelocityFvPatchVectorField.C
53
54
\*---------------------------------------------------------------------------*/
55
56
#ifndef flowRateInletVelocityFvPatchVectorField_H
57
#define flowRateInletVelocityFvPatchVectorField_H
58
59
#include <
finiteVolume/fixedValueFvPatchFields.H
>
60
61
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
62
63
namespace
Foam
64
{
65
/*---------------------------------------------------------------------------*\
66
Class flowRateInletVelocityFvPatch Declaration
67
\*---------------------------------------------------------------------------*/
68
69
class
flowRateInletVelocityFvPatchVectorField
70
:
71
public
fixedValueFvPatchVectorField
72
{
73
// Private data
74
75
//- Inlet integral flow rate
76
scalar flowRate_;
77
78
//- Name of the flux transporting the field
79
word
phiName_;
80
81
//- Name of the density field used to normalize the mass flux
82
word
rhoName_;
83
84
85
public
:
86
87
//- Runtime type information
88
TypeName
(
"flowRateInletVelocity"
);
89
90
91
// Constructors
92
93
//- Construct from patch and internal field
94
flowRateInletVelocityFvPatchVectorField
95
(
96
const
fvPatch
&,
97
const
DimensionedField<vector, volMesh>
&
98
);
99
100
//- Construct from patch, internal field and dictionary
101
flowRateInletVelocityFvPatchVectorField
102
(
103
const
fvPatch
&,
104
const
DimensionedField<vector, volMesh>
&,
105
const
dictionary
&
106
);
107
108
//- Construct by mapping given
109
// flowRateInletVelocityFvPatchVectorField
110
// onto a new patch
111
flowRateInletVelocityFvPatchVectorField
112
(
113
const
flowRateInletVelocityFvPatchVectorField
&,
114
const
fvPatch
&,
115
const
DimensionedField<vector, volMesh>
&,
116
const
fvPatchFieldMapper
&
117
);
118
119
//- Construct as copy
120
flowRateInletVelocityFvPatchVectorField
121
(
122
const
flowRateInletVelocityFvPatchVectorField
&
123
);
124
125
//- Construct and return a clone
126
virtual
tmp<fvPatchVectorField>
clone
()
const
127
{
128
return
tmp<fvPatchVectorField>
129
(
130
new
flowRateInletVelocityFvPatchVectorField
(*
this
)
131
);
132
}
133
134
//- Construct as copy setting internal field reference
135
flowRateInletVelocityFvPatchVectorField
136
(
137
const
flowRateInletVelocityFvPatchVectorField
&,
138
const
DimensionedField<vector, volMesh>
&
139
);
140
141
//- Construct and return a clone setting internal field reference
142
virtual
tmp<fvPatchVectorField>
clone
143
(
144
const
DimensionedField<vector, volMesh>
& iF
145
)
const
146
{
147
return
tmp<fvPatchVectorField>
148
(
149
new
flowRateInletVelocityFvPatchVectorField
(*
this
, iF)
150
);
151
}
152
153
154
// Member functions
155
156
// Access
157
158
//- Return the flux
159
scalar
flowRate
()
const
160
{
161
return
flowRate_;
162
}
163
164
//- Return reference to the flux to allow adjustment
165
scalar&
flowRate
()
166
{
167
return
flowRate_;
168
}
169
170
171
//- Update the coefficients associated with the patch field
172
virtual
void
updateCoeffs
();
173
174
//- Write
175
virtual
void
write
(
Ostream
&)
const
;
176
177
};
178
179
180
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181
182
}
// End namespace Foam
183
184
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185
186
#endif
187
188
// ************************ vim: set sw=4 sts=4 et: ************************ //