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