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