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  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::fv::limitVelocity
29 
30 Description
31  Corrects velocity field (i.e. \c T) within a specified
32  region by applying a given maximum velocity magnitude limit.
33 
34  Corrections applied to:
35  \verbatim
36  U | Velocity [m/s]
37  \endverbatim
38 
39  Required fields:
40  \verbatim
41  U | Velocity [m/s]
42  \endverbatim
43 
44 Usage
45  Minimal example by using \c constant/fvOptions:
46  \verbatim
47  limitVelocity1
48  {
49  // Mandatory entries (unmodifiable)
50  type limitVelocity;
51 
52  // Mandatory entries (runtime modifiable)
53  max <maxValue>;
54 
55  // Optional entries (runtime modifiable)
56  U <Uname>;
57 
58  // Mandatory/Optional (inherited) entries
59  ...
60  }
61  \endverbatim
62 
63  where the entries mean:
64  \table
65  Property | Description | Type | Reqd | Dflt
66  type | Type name: limitVelocity | word | yes | -
67  max | Maximum velocity limit [m/s] | scalar | yes | -
68  U | Name of operand velocity field | word | no | U
69  \endtable
70 
71  The inherited entries are elaborated in:
72  - \link fvOption.H \endlink
73  - \link cellSetOption.H \endlink
74 
75 See also
76  - Foam::fv::velocityDampingConstraint
77 
78 SourceFiles
79  limitVelocity.C
80 
81 \*---------------------------------------------------------------------------*/
82 
83 #ifndef limitVelocity_H
84 #define limitVelocity_H
85 
86 #include "cellSetOption.H"
87 
88 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
89 
90 namespace Foam
91 {
92 namespace fv
93 {
94 
95 /*---------------------------------------------------------------------------*\
96  Class limitVelocity Declaration
97 \*---------------------------------------------------------------------------*/
98 
99 class limitVelocity
100 :
101  public fv::cellSetOption
102 {
103 protected:
104 
105  // Protected Data
106 
107  //- Name of operand velocity field
108  word UName_;
109 
110  //- Maximum velocity magnitude
111  scalar max_;
112 
113 
114 public:
115 
116  //- Runtime type information
117  TypeName("limitVelocity");
118 
119 
120  // Constructors
121 
122  //- Construct from components
124  (
125  const word& name,
126  const word& modelType,
127  const dictionary& dict,
128  const fvMesh& mesh
129  );
130 
131  //- No copy construct
132  limitVelocity(const limitVelocity&) = delete;
133 
134  //- No copy assignment
135  void operator=(const limitVelocity&) = delete;
136 
137 
138  //- Destructor
139  virtual ~limitVelocity() = default;
140 
141 
142  // Member Functions
143 
144  //- Read dictionary
145  virtual bool read(const dictionary& dict);
146 
147  //- Correct the velocity field
148  virtual void correct(volVectorField& U);
149 };
150 
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 } // End namespace fv
155 } // End namespace Foam
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 #endif
160 
161 // ************************************************************************* //
Foam::fv::option::name
const word & name() const noexcept
Return const access to the source name.
Definition: fvOptionI.H:31
Foam::fv::limitVelocity::operator=
void operator=(const limitVelocity &)=delete
No copy assignment.
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::fv::cellSetOption
Intermediate abstract class for handling cell-set options for the derived fvOptions.
Definition: cellSetOption.H:163
Foam::fv::limitVelocity::~limitVelocity
virtual ~limitVelocity()=default
Destructor.
Foam::fv::limitVelocity
Corrects velocity field (i.e. T) within a specified region by applying a given maximum velocity magni...
Definition: limitVelocity.H:122
cellSetOption.H
Foam::fv::limitVelocity::limitVelocity
limitVelocity(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
Definition: limitVelocity.C:48
Foam::fv::limitVelocity::read
virtual bool read(const dictionary &dict)
Read dictionary.
Definition: limitVelocity.C:66
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::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
fv
labelList fv(nPoints)
Foam::fv::limitVelocity::correct
virtual void correct(volVectorField &U)
Correct the velocity field.
Definition: limitVelocity.C:79
Foam::fv::limitVelocity::max_
scalar max_
Maximum velocity magnitude.
Definition: limitVelocity.H:134
U
U
Definition: pEqn.H:72
Foam::fv::option::mesh
const fvMesh & mesh() const noexcept
Return const access to the mesh database.
Definition: fvOptionI.H:37
Foam::fv::limitVelocity::UName_
word UName_
Name of operand velocity field.
Definition: limitVelocity.H:131
Foam::GeometricField< vector, fvPatchField, volMesh >
Foam::fv::limitVelocity::TypeName
TypeName("limitVelocity")
Runtime type information.