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) 2021-2022 OpenCFD Ltd.
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::fa::limitVelocity
28 
29 Description
30  Limits the maximum velocity magnitude to the specified \c max value.
31 
32 Usage
33  Minimal example by using \c constant/faOptions:
34  \verbatim
35  <faOption>
36  {
37  // Mandatory entries
38  type limitVelocity;
39  active yes;
40  selectionMode all;
41  max <maxValue>;
42 
43  // Optional entries
44  U <UName>;
45 
46  // Inherited entries
47  ...
48  }
49  \endverbatim
50 
51  where the entries mean:
52  \table
53  Property | Description | Type | Reqd | Deflt
54  type | Type name: limitVelocity | word | yes | -
55  max | Maximum velocity limit [m/s] | scalar | yes | -
56  U | Name of operand velocity field | word | no | U
57  \endtable
58 
59  The inherited entries are elaborated in:
60  - \link fvOption.H \endlink
61  - \link faceSetOption.H \endlink
62 
63 SourceFiles
64  limitVelocity.C
65 
66 \*---------------------------------------------------------------------------*/
67 
68 #ifndef Foam_fa_limitVelocity_H
69 #define Foam_fa_limitVelocity_H
70 
71 #include "faceSetOption.H"
72 
73 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
74 
75 namespace Foam
76 {
77 namespace fa
78 {
79 
80 /*---------------------------------------------------------------------------*\
81  Class limitVelocity Declaration
82 \*---------------------------------------------------------------------------*/
83 
84 class limitVelocity
85 :
86  public fa::faceSetOption
87 {
88 protected:
89 
90  // Protected Data
91 
92  //- Name of operand velocity field
93  word UName_;
94 
95  //- Maximum velocity magnitude
96  scalar max_;
97 
98 
99 public:
100 
101  //- Runtime type information
102  TypeName("limitVelocity");
104 
105  // Constructors
106 
107  //- Construct from components
109  (
110  const word& name,
111  const word& modelType,
112  const dictionary& dict,
113  const fvMesh& mesh
114  );
115 
116  //- No copy construct
117  limitVelocity(const limitVelocity&) = delete;
118 
119  //- No copy assignment
120  void operator=(const limitVelocity&) = delete;
121 
122 
123  //- Destructor
124  virtual ~limitVelocity() = default;
125 
126 
127  // Member Functions
128 
129  //- Read dictionary
130  virtual bool read(const dictionary& dict);
131 
132  //- Correct the velocity field
133  virtual void correct(areaVectorField& U);
134 };
135 
136 
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 
139 } // End namespace fv
140 } // End namespace Foam
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 #endif
145 
146 // ************************************************************************* //
virtual void correct(areaVectorField &U)
Correct the velocity field.
Definition: limitVelocity.C:75
const fvMesh & mesh() const noexcept
Return const access to the mesh database.
Definition: faOptionI.H:29
dictionary dict
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
virtual bool read(const dictionary &dict)
Read dictionary.
Definition: limitVelocity.C:62
void operator=(const limitVelocity &)=delete
No copy assignment.
A class for handling words, derived from Foam::string.
Definition: word.H:63
scalar max_
Maximum velocity magnitude.
limitVelocity(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
Definition: limitVelocity.C:44
const word & name() const noexcept
Return const access to the source name.
Definition: faOptionI.H:23
TypeName("limitVelocity")
Runtime type information.
virtual ~limitVelocity()=default
Destructor.
U
Definition: pEqn.H:72
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Limits the maximum velocity magnitude to the specified max value.
word UName_
Name of operand velocity field.
Namespace for OpenFOAM.