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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2015-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::fv::patchMeanVelocityForce
28 
29 Description
30  Calculates and applies the force necessary to maintain the specified mean
31  velocity averaged over the specified patch.
32 
33  Note: Currently only handles kinematic pressure (incompressible solvers).
34 
35 Usage
36  Example usage:
37  \verbatim
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  \endverbatim
44 
45 SourceFiles
46  patchMeanVelocityForce.C
47 
48 \*---------------------------------------------------------------------------*/
49 
50 #ifndef patchMeanVelocityForce_H
51 #define patchMeanVelocityForce_H
52 
53 #include "meanVelocityForce.H"
54 
55 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 
57 namespace Foam
58 {
59 namespace fv
60 {
61 
62 /*---------------------------------------------------------------------------*\
63  Class patchMeanVelocityForce Declaration
64 \*---------------------------------------------------------------------------*/
65 
67 :
68  public meanVelocityForce
69 {
70 protected:
71 
72  // Protected data
73 
74  //- Patch name
75  word patch_;
76 
77  //- Patch index
78  label patchi_;
79 
80 
81  // Protected Member Functions
82 
83  //- Calculate and return the magnitude of the mean velocity
84  // averaged over the specified patch
85  virtual scalar magUbarAve(const volVectorField& U) const;
86 
87 
88 private:
89 
90  // Private Member Functions
91 
92  //- No copy construct
94 
95  //- No copy assignment
96  void operator=(const patchMeanVelocityForce&) = delete;
97 
98 
99 public:
100 
101  //- Runtime type information
102  TypeName("patchMeanVelocityForce");
103 
104 
105  // Constructors
106 
107  //- Construct from explicit source name and mesh
109  (
110  const word& sourceName,
111  const word& modelType,
112  const dictionary& dict,
113  const fvMesh& mesh
114  );
115 
116 
117  //- Destructor
118  ~patchMeanVelocityForce() = default;
119 
120 };
121 
122 
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 
125 } // End namespace fv
126 } // End namespace Foam
127 
128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 
130 #endif
131 
132 // ************************************************************************* //
Foam::fv::patchMeanVelocityForce::TypeName
TypeName("patchMeanVelocityForce")
Runtime type information.
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::fv::patchMeanVelocityForce::~patchMeanVelocityForce
~patchMeanVelocityForce()=default
Destructor.
Foam::fv::patchMeanVelocityForce::magUbarAve
virtual scalar magUbarAve(const volVectorField &U) const
Calculate and return the magnitude of the mean velocity.
Definition: patchMeanVelocityForce.C:76
Foam::fv::patchMeanVelocityForce::patchi_
label patchi_
Patch index.
Definition: patchMeanVelocityForce.H:77
Foam::fv::patchMeanVelocityForce::patch_
word patch_
Patch name.
Definition: patchMeanVelocityForce.H:74
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:84
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
fv
labelList fv(nPoints)
Foam::fv::meanVelocityForce
Calculates and applies the force necessary to maintain the specified mean velocity.
Definition: meanVelocityForce.H:70
U
U
Definition: pEqn.H:72
Foam::fv::option::mesh
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvOptionI.H:36
meanVelocityForce.H
Foam::GeometricField< vector, fvPatchField, volMesh >
Foam::fv::patchMeanVelocityForce
Calculates and applies the force necessary to maintain the specified mean velocity averaged over the ...
Definition: patchMeanVelocityForce.H:65