patchMeanVelocityForce.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) 2015-2021 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::fv::patchMeanVelocityForce
26 
27 Description
28  Calculates and applies the force necessary to maintain the specified mean
29  velocity averaged over the specified patch.
30 
31 Usage
32  Example usage:
33  \verbatim
34  patchMeanVelocityForce1
35  {
36  type patchMeanVelocityForce;
37 
38  selectionMode all;
39 
40  U U; // Name of velocity field
41 
42  patch inlet; // Name of the patch
43 
44  Ubar (10.0 0 0); // Desired mean velocity
45  relaxation 0.2; // Optional relaxation factor
46  }
47  \endverbatim
48 
49 Note
50  Currently only handles kinematic pressure (incompressible solvers).
51 
52 SourceFiles
53  patchMeanVelocityForce.C
54 
55 \*---------------------------------------------------------------------------*/
56 
57 #ifndef patchMeanVelocityForce_H
58 #define patchMeanVelocityForce_H
59 
60 #include "meanVelocityForce.H"
61 
62 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
63 
64 namespace Foam
65 {
66 namespace fv
67 {
68 
69 /*---------------------------------------------------------------------------*\
70  Class patchMeanVelocityForce Declaration
71 \*---------------------------------------------------------------------------*/
72 
74 :
75  public meanVelocityForce
76 {
77  // Private data
78 
79  //- Patch name
80  word patch_;
81 
82 
83  // Private Member Functions
84 
85  //- Non-virtual read
86  void readCoeffs();
87 
88  //- Calculate and return the magnitude of the mean velocity
89  // averaged over the specified patch
90  virtual scalar magUbarAve(const volVectorField& U) const;
91 
92 
93 public:
94 
95  //- Runtime type information
96  TypeName("patchMeanVelocityForce");
97 
98 
99  // Constructors
100 
101  //- Construct from explicit source name and mesh
103  (
104  const word& sourceName,
105  const word& modelType,
106  const dictionary& dict,
107  const fvMesh& mesh
108  );
109 
110 
111  // Member Functions
112 
113  // IO
114 
115  //- Read dictionary
116  virtual bool read(const dictionary& dict);
117 };
118 
119 
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121 
122 } // End namespace fv
123 } // End namespace Foam
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 #endif
128 
129 // ************************************************************************* //
patchMeanVelocityForce(const word &sourceName, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from explicit source name and mesh.
dictionary dict
Calculates and applies the force necessary to maintain the specified mean velocity averaged over the ...
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvConstraintI.H:34
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
A class for handling words, derived from string.
Definition: word.H:59
labelList fv(nPoints)
TypeName("patchMeanVelocityForce")
Runtime type information.
U
Definition: pEqn.H:72
virtual bool read(const dictionary &dict)
Read dictionary.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Calculates and applies the force necessary to maintain the specified mean velocity.
Namespace for OpenFOAM.