patchMeanVelocityForce.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 | Copyright (C) 2015-2017 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  Note: Currently only handles kinematic pressure (incompressible solvers).
32 
33 Usage
34  Example usage:
35  \verbatim
36  selectionMode all; // Apply force to all cells
37  fields (U); // Name of velocity field
38  patch inlet; // Name of the patch
39  Ubar (10.0 0 0); // Desired mean velocity
40  relaxation 0.2; // Optional relaxation factor
41  \endverbatim
42 
43 SourceFiles
44  patchMeanVelocityForce.C
45 
46 \*---------------------------------------------------------------------------*/
47 
48 #ifndef patchMeanVelocityForce_H
49 #define patchMeanVelocityForce_H
50 
51 #include "meanVelocityForce.H"
52 
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 
55 namespace Foam
56 {
57 namespace fv
58 {
59 
60 /*---------------------------------------------------------------------------*\
61  Class patchMeanVelocityForce Declaration
62 \*---------------------------------------------------------------------------*/
63 
65 :
66  public meanVelocityForce
67 {
68 protected:
69 
70  // Protected data
71 
72  //- Patch name
73  word patch_;
74 
75  //- Patch index
76  label patchi_;
77 
78 
79  // Protected Member Functions
80 
81  //- Calculate and return the magnitude of the mean velocity
82  // averaged over the specified patch
83  virtual scalar magUbarAve(const volVectorField& U) const;
84 
85 
86 private:
87 
88  // Private Member Functions
89 
90  //- Disallow default bitwise copy construct
92 
93  //- Disallow default bitwise assignment
94  void operator=(const patchMeanVelocityForce&);
95 
96 
97 public:
98 
99  //- Runtime type information
100  TypeName("patchMeanVelocityForce");
101 
102 
103  // Constructors
104 
105  //- Construct from explicit source name and mesh
107  (
108  const word& sourceName,
109  const word& modelType,
110  const dictionary& dict,
111  const fvMesh& mesh
112  );
113 };
114 
115 
116 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117 
118 } // End namespace fv
119 } // End namespace Foam
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 #endif
124 
125 // ************************************************************************* //
dictionary dict
U
Definition: pEqn.H:83
Calculates and applies the force necessary to maintain the specified mean velocity averaged over the ...
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
virtual scalar magUbarAve(const volVectorField &U) const
Calculate and return the magnitude of the mean velocity.
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvOptionI.H:34
A class for handling words, derived from string.
Definition: word.H:59
labelList fv(nPoints)
TypeName("patchMeanVelocityForce")
Runtime type information.
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.