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-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::fv::limitVelocity
29
30Description
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
44Usage
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
75See also
76 - Foam::fv::velocityDampingConstraint
77
78SourceFiles
79 limitVelocity.C
80
81\*---------------------------------------------------------------------------*/
82
83#ifndef limitVelocity_H
84#define limitVelocity_H
85
86#include "cellSetOption.H"
87
88// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
89
90namespace Foam
91{
92namespace fv
93{
94
95/*---------------------------------------------------------------------------*\
96 Class limitVelocity Declaration
97\*---------------------------------------------------------------------------*/
98
99class limitVelocity
100:
101 public fv::cellSetOption
102{
103protected:
104
105 // Protected Data
106
107 //- Name of operand velocity field
108 word UName_;
109
110 //- Maximum velocity magnitude
111 scalar max_;
112
113
114public:
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;
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// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159#endif
160
161// ************************************************************************* //
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Intermediate abstract class for handling cell-set options for the derived fvOptions.
Corrects velocity field (i.e. T) within a specified region by applying a given maximum velocity magni...
word UName_
Name of operand velocity field.
virtual bool read(const dictionary &dict)
Read dictionary.
Definition: limitVelocity.C:66
void operator=(const limitVelocity &)=delete
No copy assignment.
scalar max_
Maximum velocity magnitude.
TypeName("limitVelocity")
Runtime type information.
virtual ~limitVelocity()=default
Destructor.
limitVelocity(const limitVelocity &)=delete
No copy construct.
const word & name() const noexcept
Return const access to the source name.
Definition: fvOptionI.H:31
const fvMesh & mesh() const noexcept
Return const access to the mesh database.
Definition: fvOptionI.H:37
A class for handling words, derived from Foam::string.
Definition: word.H:68
U
Definition: pEqn.H:72
thermo correct()
Namespace for OpenFOAM.
labelList fv(nPoints)
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73