fluxCorrectedVelocityFvPatchVectorField.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-------------------------------------------------------------------------------
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::fluxCorrectedVelocityFvPatchVectorField
28
29Group
30 grpOutletBoundaryConditions
31
32Description
33 This boundary condition provides a velocity outlet boundary condition for
34 patches where the pressure is specified. The outflow velocity is obtained
35 by "zeroGradient" and then corrected from the flux:
36
37 \f[
38 U_p = U_c - n (n \cdot U_c) + \frac{n \phi_p}{|S_f|}
39 \f]
40
41 where
42
43 \vartable
44 U_p | velocity at the patch [m/s]
45 U_c | velocity in cells adjacent to the patch [m/s]
46 n | patch normal vectors
47 \phi_p | flux at the patch [m3/s or kg/s]
48 S_f | patch face area vectors [m2]
49 \endvartable
50
51 where
52
53 \table
54 Property | Description | Required | Default value
55 phi | name of flux field | no | phi
56 rho | name of density field | no | rho
57 \endtable
58
59 Example of the boundary condition specification:
60 \verbatim
61 <patchName>
62 {
63 type fluxCorrectedVelocity;
64 phi phi;
65 rho rho;
66 }
67 \endverbatim
68
69Note
70 If reverse flow is possible or expected use the
71 pressureInletOutletVelocity condition instead.
72
73See also
74 Foam::zeroGradientFvPatchField
75 Foam::pressureInletOutletVelocityFvPatchVectorField
76
77SourceFiles
78 fluxCorrectedVelocityFvPatchVectorField.C
79
80\*---------------------------------------------------------------------------*/
81
82#ifndef fluxCorrectedVelocityFvPatchVectorField_H
83#define fluxCorrectedVelocityFvPatchVectorField_H
84
85#include "fvPatchFields.H"
87
88// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
89
90namespace Foam
91{
92
93/*---------------------------------------------------------------------------*\
94 Class fluxCorrectedVelocityFvPatchVectorField Declaration
95\*---------------------------------------------------------------------------*/
96
97class fluxCorrectedVelocityFvPatchVectorField
98:
99 public zeroGradientFvPatchVectorField
100{
101 // Private data
102
103 //- Name of flux field
104 word phiName_;
105
106 //- Name of density field
107 word rhoName_;
108
109
110public:
111
112 //- Runtime type information
113 TypeName("fluxCorrectedVelocity");
114
115
116 // Constructors
117
118 //- Construct from patch and internal field
120 (
121 const fvPatch&,
122 const DimensionedField<vector, volMesh>&
123 );
124
125 //- Construct from patch, internal field and dictionary
127 (
128 const fvPatch&,
129 const DimensionedField<vector, volMesh>&,
130 const dictionary&
131 );
132
133 //- Construct by mapping given fluxCorrectedVelocityFvPatchVectorField
134 // onto a new patch
136 (
138 const fvPatch&,
140 const fvPatchFieldMapper&
141 );
142
143 //- Construct and return a clone
144 virtual tmp<fvPatchVectorField> clone() const
145 {
149 );
150 }
151
152 //- Construct as copy setting internal field reference
154 (
157 );
158
159 //- Construct and return a clone setting internal field reference
161 (
163 ) const
164 {
166 (
168 );
169 }
170
171
172 // Member functions
173
174 //- Evaluate the patch field
175 virtual void evaluate
176 (
178 );
179
180 //- Write
181 virtual void write(Ostream&) const;
182};
183
184
185// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186
187} // End namespace Foam
188
189// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190
191#endif
192
193// ************************************************************************* //
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
commsTypes
Types of communications.
Definition: UPstream.H:67
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
This boundary condition provides a velocity outlet boundary condition for patches where the pressure ...
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
Evaluate the patch field.
TypeName("fluxCorrectedVelocity")
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.
fluxCorrectedVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal 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