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-2023 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, internal field and dictionary
115  (
116  const fvPatch&,
117  const DimensionedField<vector, volMesh>&,
118  const dictionary&
119  );
120 
121  //- Construct by mapping given fluxCorrectedVelocityFvPatchVectorField
122  // onto a new patch
124  (
126  const fvPatch&,
128  const fvPatchFieldMapper&
129  );
130 
131  //- Construct as copy setting internal field reference
133  (
136  );
137 
138  //- Construct and return a clone setting internal field reference
140  (
142  ) const
143  {
145  (
147  );
148  }
149 
150 
151  // Member Functions
152 
153  //- Evaluate the patch field
154  virtual void evaluate
155  (
157  );
158 
159  //- Write
160  virtual void write(Ostream&) const;
161 };
162 
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 } // End namespace Foam
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 #endif
171 
172 // ************************************************************************* //
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:57
commsTypes
Types of communications.
Definition: UPstream.H:65
This boundary condition provides a velocity outlet boundary condition for patches where the pressure ...
virtual tmp< fvPatchVectorField > clone(const DimensionedField< vector, volMesh > &iF) const
Construct and return a clone setting internal field reference.
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
Evaluate the patch field.
TypeName("fluxCorrectedVelocity")
Runtime type information.
fluxCorrectedVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
Foam::fvPatchFieldMapper.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:64
A class for managing temporary objects.
Definition: tmp.H:55
Namespace for OpenFOAM.