limitVelocity.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) 2016-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::limitVelocity
28 
29 Description
30  Limits the maximum velocity magnitude to the specified \c max value.
31 
32 Usage
33  Example usage:
34  \verbatim
35  limitU
36  {
37  type limitVelocity;
38  active yes;
39 
40  selectionMode all;
41  max 100;
42  }
43  \endverbatim
44 
45 SourceFiles
46  limitVelocity.C
47 
48 \*---------------------------------------------------------------------------*/
49 
50 #ifndef limitVelocity_H
51 #define limitVelocity_H
52 
53 #include "cellSetOption.H"
54 
55 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 
57 namespace Foam
58 {
59 namespace fv
60 {
61 
62 /*---------------------------------------------------------------------------*\
63  Class limitVelocity Declaration
64 \*---------------------------------------------------------------------------*/
65 
66 class limitVelocity
67 :
68  public cellSetOption
69 {
70 protected:
71 
72  // Protected data
73 
74  //- Velocity field name, default = U
75  word UName_;
76 
77  //- Maximum velocity magnitude
78  scalar max_;
79 
80 
81 private:
82 
83  // Private Member Functions
84 
85  //- No copy construct
86  limitVelocity(const limitVelocity&) = delete;
87 
88  //- No copy assignment
89  void operator=(const limitVelocity&) = delete;
90 
91 
92 public:
93 
94  //- Runtime type information
95  TypeName("limitVelocity");
96 
97 
98  // Constructors
99 
100  //- Construct from components
102  (
103  const word& name,
104  const word& modelType,
105  const dictionary& dict,
106  const fvMesh& mesh
107  );
108 
109 
110  //- Destructor
111  virtual ~limitVelocity() = default;
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 // ************************************************************************* //
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::fv::cellSetOption
Cell-set options abstract base class. Provides a base set of controls, e.g.:
Definition: cellSetOption.H:72
Foam::fv::option::name
const word & name() const
Return const access to the source name.
Definition: fvOptionI.H:30
Foam::fv::limitVelocity::~limitVelocity
virtual ~limitVelocity()=default
Destructor.
Foam::fv::limitVelocity
Limits the maximum velocity magnitude to the specified max value.
Definition: limitVelocity.H:65
cellSetOption.H
Foam::fv::limitVelocity::read
virtual bool read(const dictionary &dict)
Read dictionary.
Definition: limitVelocity.C:71
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::limitVelocity::correct
virtual void correct(volVectorField &U)
Correct the energy field.
Definition: limitVelocity.C:84
Foam::fv::limitVelocity::max_
scalar max_
Maximum velocity magnitude.
Definition: limitVelocity.H:77
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
Foam::fv::limitVelocity::UName_
word UName_
Velocity field name, default = U.
Definition: limitVelocity.H:74
Foam::GeometricField< vector, fvPatchField, volMesh >
Foam::fv::limitVelocity::TypeName
TypeName("limitVelocity")
Runtime type information.