Loading...
Searching...
No Matches
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
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
128 const fvPatch&,
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 as copy setting internal field reference
145 (
148 );
150 //- Return a clone
151 virtual tmp<fvPatchField<vector>> clone() const
152 {
153 return fvPatchField<vector>::Clone(*this);
154 }
155
156 //- Clone with an internal field reference
158 (
160 ) const
161 {
162 return fvPatchField<vector>::Clone(*this, iF);
163 }
164
165
166 // Member functions
167
168 //- Evaluate the patch field
169 virtual void evaluate
170 (
172 );
173
174 //- Write
175 virtual void write(Ostream&) const;
176};
177
178
179// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180
181} // End namespace Foam
182
183// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184
185#endif
186
187// ************************************************************************* //
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
commsTypes
Communications types.
Definition UPstream.H:81
@ buffered
"buffered" : (MPI_Bsend, MPI_Recv)
Definition UPstream.H:82
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
This boundary condition provides a velocity outlet boundary condition for patches where the pressure ...
TypeName("fluxCorrectedVelocity")
Runtime type information.
virtual tmp< fvPatchField< vector > > clone() const
Return a clone.
fluxCorrectedVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
virtual tmp< fvPatchField< vector > > clone(const DimensionedField< vector, volMesh > &iF) const
Clone with an internal field reference.
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::buffered)
Evaluate the patch field.
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
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