limitVelocity.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) 2016-2018 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::limitVelocity
26 
27 Description
28  Limits the maximum velocity magnitude to the specified \c max value.
29 
30 Usage
31  Example usage:
32  \verbatim
33  limitU
34  {
35  type limitVelocity;
36  active yes;
37 
38  selectionMode all;
39  max 100;
40  }
41  \endverbatim
42 
43 SourceFiles
44  limitVelocity.C
45 
46 \*---------------------------------------------------------------------------*/
47 
48 #ifndef limitVelocity_H
49 #define limitVelocity_H
50 
51 #include "cellSetOption.H"
52 
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 
55 namespace Foam
56 {
57 namespace fv
58 {
59 
60 /*---------------------------------------------------------------------------*\
61  Class limitVelocity Declaration
62 \*---------------------------------------------------------------------------*/
63 
64 class limitVelocity
65 :
66  public cellSetOption
67 {
68 
69 protected:
70 
71  // Protected data
72 
73  //- Velocity field name, default = U
74  word UName_;
75 
76  //- Maximum velocity magnitude
77  scalar max_;
78 
79 
80 private:
81 
82  // Private Member Functions
83 
84  //- Disallow default bitwise copy construct
86 
87  //- Disallow default bitwise assignment
88  void operator=(const limitVelocity&);
89 
90 
91 public:
92 
93  //- Runtime type information
94  TypeName("limitVelocity");
95 
96 
97  // Constructors
98 
99  //- Construct from components
101  (
102  const word& name,
103  const word& modelType,
104  const dictionary& dict,
105  const fvMesh& mesh
106  );
107 
108 
109  //- Destructor
110  virtual ~limitVelocity()
111  {}
112 
113 
114  // Member Functions
115 
116  //- Read dictionary
117  virtual bool read(const dictionary& dict);
118 
119  //- Correct the energy field
120  virtual void correct(volVectorField& U);
121 };
122 
123 
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 
126 } // End namespace fv
127 } // End namespace Foam
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 #endif
132 
133 // ************************************************************************* //
word UName_
Velocity field name, default = U.
Definition: limitVelocity.H:73
dictionary dict
Limits the maximum velocity magnitude to the specified max value.
Definition: limitVelocity.H:63
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
TypeName("limitVelocity")
Runtime type information.
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvOptionI.H:34
virtual bool read(const dictionary &dict)
Read dictionary.
Definition: limitVelocity.C:68
A class for handling words, derived from string.
Definition: word.H:59
labelList fv(nPoints)
virtual ~limitVelocity()
Destructor.
const word & name() const
Return const access to the source name.
Definition: fvOptionI.H:28
U
Definition: pEqn.H:72
scalar max_
Maximum velocity magnitude.
Definition: limitVelocity.H:76
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Cell-set options abtract base class. Provides a base set of controls, e.g.:
Definition: cellSetOption.H:69
virtual void correct(volVectorField &U)
Correct the energy field.
Definition: limitVelocity.C:83
Namespace for OpenFOAM.