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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::fa::limitVelocity
28
29Description
30 Limits the maximum velocity magnitude to the specified \c max value.
31
32Usage
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
63SourceFiles
64 limitVelocity.C
65
66\*---------------------------------------------------------------------------*/
67
68#ifndef limitVelocity_H
69#define limitVelocity_H
70
71#include "faceSetOption.H"
72
73// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
74
75namespace Foam
76{
77namespace fa
78{
79
80/*---------------------------------------------------------------------------*\
81 Class limitVelocity Declaration
82\*---------------------------------------------------------------------------*/
83
84class limitVelocity
85:
86 public faceSetOption
87{
88protected:
89
90 // Protected Data
91
92 //- Name of operand velocity field
93 word UName_;
94
95 //- Maximum velocity magnitude
96 scalar max_;
97
98
99private:
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
110public:
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);
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// ************************************************************************* //
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Intermediate abstract class for handling face-set options for the derived faOptions.
Limits the maximum velocity magnitude to the specified max value.
word UName_
Name of operand velocity field.
virtual bool read(const dictionary &dict)
Read dictionary.
Definition: limitVelocity.C:69
scalar max_
Maximum velocity magnitude.
TypeName("limitVelocity")
Runtime type information.
virtual ~limitVelocity()=default
Destructor.
const word & name() const noexcept
Return const access to the source name.
Definition: faOptionI.H:30
const fvPatch & patch() const noexcept
Return const access to fvPatch.
Definition: faOptionI.H:42
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:71
A class for handling words, derived from Foam::string.
Definition: word.H:68
U
Definition: pEqn.H:72
thermo correct()
Namespace for OpenFOAM.
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73