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 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::fluxCorrectedVelocityFvPatchVectorField
28 
29 Group
30  grpOutletBoundaryConditions
31 
32 Description
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 
69 Note
70  If reverse flow is possible or expected use the
71  pressureInletOutletVelocity condition instead.
72 
73 See also
74  Foam::zeroGradientFvPatchField
75  Foam::pressureInletOutletVelocityFvPatchVectorField
76 
77 SourceFiles
78  fluxCorrectedVelocityFvPatchVectorField.C
79 
80 \*---------------------------------------------------------------------------*/
81 
82 #ifndef fluxCorrectedVelocityFvPatchVectorField_H
83 #define fluxCorrectedVelocityFvPatchVectorField_H
84 
85 #include "fvPatchFields.H"
87 
88 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
89 
90 namespace Foam
91 {
92 
93 /*---------------------------------------------------------------------------*\
94  Class fluxCorrectedVelocityFvPatchVectorField Declaration
95 \*---------------------------------------------------------------------------*/
96 
97 class fluxCorrectedVelocityFvPatchVectorField
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 
110 public:
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
127  (
128  const fvPatch&,
129  const DimensionedField<vector, volMesh>&,
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 and return a clone
144  virtual tmp<fvPatchVectorField> clone() const
145  {
147  (
149  );
150  }
151 
152  //- Construct as copy setting internal field reference
154  (
157  );
158 
159  //- Construct and return a clone setting internal field reference
161  (
163  ) const
164  {
166  (
168  );
169  }
170 
171 
172  // Member functions
173 
174  //- Evaluate the patch field
175  virtual void evaluate
176  (
178  );
179 
180  //- Write
181  virtual void write(Ostream&) const;
182 };
183 
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 } // End namespace Foam
188 
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 
191 #endif
192 
193 // ************************************************************************* //
Foam::fluxCorrectedVelocityFvPatchVectorField::write
virtual void write(Ostream &) const
Write.
Definition: fluxCorrectedVelocityFvPatchVectorField.C:141
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::fluxCorrectedVelocityFvPatchVectorField::fluxCorrectedVelocityFvPatchVectorField
fluxCorrectedVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Definition: fluxCorrectedVelocityFvPatchVectorField.C:39
Foam::fluxCorrectedVelocityFvPatchVectorField
This boundary condition provides a velocity outlet boundary condition for patches where the pressure ...
Definition: fluxCorrectedVelocityFvPatchVectorField.H:131
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::fluxCorrectedVelocityFvPatchVectorField::evaluate
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
Evaluate the patch field.
Definition: fluxCorrectedVelocityFvPatchVectorField.C:98
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:69
fvPatchFields.H
Foam::fluxCorrectedVelocityFvPatchVectorField::TypeName
TypeName("fluxCorrectedVelocity")
Runtime type information.
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::fluxCorrectedVelocityFvPatchVectorField::clone
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
Definition: fluxCorrectedVelocityFvPatchVectorField.H:178
zeroGradientFvPatchFields.H
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54
Foam::UPstream::commsTypes::blocking