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 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 limitVelocity_H
69 #define 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 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 private:
100 
101  // Private Member Functions
102 
103  //- No copy construct
104  limitVelocity(const limitVelocity&) = delete;
105 
106  //- No copy assignment
107  void operator=(const limitVelocity&) = delete;
108 
109 
110 public:
111 
112  //- Runtime type information
113  TypeName("limitVelocity");
114 
115 
116  // Constructors
117 
118  //- Construct from components
120  (
121  const word& name,
122  const word& modelType,
123  const dictionary& dict,
124  const fvPatch& patch
125  );
126 
127 
128  //- Destructor
129  virtual ~limitVelocity() = default;
130 
131 
132  // Member Functions
133 
134  //- Read dictionary
135  virtual bool read(const dictionary& dict);
136 
137  //- Correct the velocity field
138  virtual void correct(areaVectorField& U);
139 };
140 
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 } // End namespace fv
145 } // End namespace Foam
146 
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 
149 #endif
150 
151 // ************************************************************************* //
Foam::fa::limitVelocity
Limits the maximum velocity magnitude to the specified max value.
Definition: limitVelocity.H:107
Foam::fa::option::name
const word & name() const noexcept
Return const access to the source name.
Definition: faOptionI.H:30
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::fa::option::patch
const fvPatch & patch() const noexcept
Return const access to fvPatch.
Definition: faOptionI.H:42
Foam::fa::faceSetOption
Intermediate abstract class for handling face-set options for the derived faOptions.
Definition: faceSetOption.H:134
Foam::fa::limitVelocity::read
virtual bool read(const dictionary &dict)
Read dictionary.
Definition: limitVelocity.C:69
Foam::fa::limitVelocity::TypeName
TypeName("limitVelocity")
Runtime type information.
Foam::fa::limitVelocity::~limitVelocity
virtual ~limitVelocity()=default
Destructor.
Foam::fa::limitVelocity::max_
scalar max_
Maximum velocity magnitude.
Definition: limitVelocity.H:119
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
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:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
faceSetOption.H
Foam::fa::limitVelocity::correct
virtual void correct(areaVectorField &U)
Correct the velocity field.
Definition: limitVelocity.C:82
U
U
Definition: pEqn.H:72
Foam::fa::limitVelocity::UName_
word UName_
Name of operand velocity field.
Definition: limitVelocity.H:116
Foam::GeometricField< vector, faPatchField, areaMesh >