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-2022 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 [m^3/s or kg/s]
43  S_f | patch face area vectors [m^2]
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 as copy setting internal field reference
140  (
143  );
144 
145  //- Construct and return a clone setting internal field reference
147  (
149  ) const
150  {
152  (
154  );
155  }
156 
157 
158  // Member Functions
159 
160  //- Evaluate the patch field
161  virtual void evaluate
162  (
164  );
165 
166  //- Write
167  virtual void write(Ostream&) const;
168 };
169 
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 } // End namespace Foam
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 #endif
178 
179 // ************************************************************************* //
commsTypes
Types of communications.
Definition: UPstream.H:64
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:63
virtual tmp< fvPatchVectorField > clone(const DimensionedField< vector, volMesh > &iF) const
Construct and return a clone setting internal field reference.
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:54
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.