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-2016 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  patchMeanVelocityForceCoeffs
37  {
38  selectionMode all; // Apply force to all cells
39  fields (U); // Name of velocity field
40  patch inlet; // Name of the patch
41  Ubar (10.0 0 0); // Desired mean velocity
42  relaxation 0.2; // Optional relaxation factor
43  }
44  \endverbatim
45 
46 SourceFiles
47  patchMeanVelocityForce.C
48 
49 \*---------------------------------------------------------------------------*/
50 
51 #ifndef patchMeanVelocityForce_H
52 #define patchMeanVelocityForce_H
53 
54 #include "meanVelocityForce.H"
55 
56 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57 
58 namespace Foam
59 {
60 namespace fv
61 {
62 
63 /*---------------------------------------------------------------------------*\
64  Class patchMeanVelocityForce Declaration
65 \*---------------------------------------------------------------------------*/
66 
68 :
69  public meanVelocityForce
70 {
71 protected:
72 
73  // Protected data
74 
75  //- Patch name
76  word patch_;
77 
78  //- Patch index
79  label patchi_;
80 
81 
82  // Protected Member Functions
83 
84  //- Calculate and return the magnitude of the mean velocity
85  // averaged over the specified patch
86  virtual scalar magUbarAve(const volVectorField& U) const;
87 
88 
89 private:
90 
91  // Private Member Functions
92 
93  //- Disallow default bitwise copy construct
95 
96  //- Disallow default bitwise assignment
97  void operator=(const patchMeanVelocityForce&);
98 
99 
100 public:
101 
102  //- Runtime type information
103  TypeName("patchMeanVelocityForce");
104 
105 
106  // Constructors
107 
108  //- Construct from explicit source name and mesh
110  (
111  const word& sourceName,
112  const word& modelType,
113  const dictionary& dict,
114  const fvMesh& mesh
115  );
116 };
117 
118 
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 
121 } // End namespace fv
122 } // End namespace Foam
123 
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 
126 #endif
127 
128 // ************************************************************************* //
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
A class for handling words, derived from string.
Definition: word.H:59
labelList fv(nPoints)
TypeName("patchMeanVelocityForce")
Runtime type information.
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvOptionI.H:34
virtual scalar magUbarAve(const volVectorField &U) const
Calculate and return the magnitude of the mean velocity.
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.