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-2019 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 protected:
69 
70  // Protected data
71 
72  //- Velocity field name, default = U
73  word UName_;
74 
75  //- Maximum velocity magnitude
76  scalar max_;
77 
78 
79 public:
80 
81  //- Runtime type information
82  TypeName("limitVelocity");
83 
84 
85  // Constructors
86 
87  //- Construct from components
89  (
90  const word& name,
91  const word& modelType,
92  const dictionary& dict,
93  const fvMesh& mesh
94  );
95 
96  //- Disallow default bitwise copy construction
97  limitVelocity(const limitVelocity&) = delete;
98 
99 
100  //- Destructor
101  virtual ~limitVelocity()
102  {}
103 
104 
105  // Member Functions
106 
107  //- Read dictionary
108  virtual bool read(const dictionary& dict);
109 
110  //- Correct the energy field
111  virtual void correct(volVectorField& U);
112 
113 
114  // Member Operators
115 
116  //- Disallow default bitwise assignment
117  void operator=(const limitVelocity&) = delete;
118 };
119 
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 } // End namespace fv
124 } // End namespace Foam
125 
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 
128 #endif
129 
130 // ************************************************************************* //
word UName_
Velocity field name, default = U.
Definition: limitVelocity.H:72
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:158
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
void operator=(const limitVelocity &)=delete
Disallow default bitwise assignment.
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:75
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Cell-set options abstract base class. Provides a base set of controls, e.g.:
Definition: cellSetOption.H:69
limitVelocity(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
Definition: limitVelocity.C:50
virtual void correct(volVectorField &U)
Correct the energy field.
Definition: limitVelocity.C:83
Namespace for OpenFOAM.