Loading...
Searching...
No Matches
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-2025 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 Foam_fa_limitVelocity_H
69#define Foam_fa_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 fa::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
99public:
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,
115 const word& defaultAreaName = word()
116 );
117
118 //- No copy construct
119 limitVelocity(const limitVelocity&) = delete;
120
121 //- No copy assignment
122 void operator=(const limitVelocity&) = delete;
123
124
125 //- Destructor
126 virtual ~limitVelocity() = default;
128
129 // Member Functions
130
131 //- Read dictionary
132 virtual bool read(const dictionary& dict);
133
134 //- Correct the velocity field
135 virtual void correct(areaVectorField& U);
136};
137
138
139// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140
141} // End namespace fv
142} // End namespace Foam
143
144// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145
146#endif
147
148// ************************************************************************* //
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
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.
limitVelocity(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh, const word &defaultAreaName=word())
Construct from components.
virtual bool read(const dictionary &dict)
Read dictionary.
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 fvMesh & mesh() const noexcept
Return const access to the volume mesh.
Definition faOption.H:385
const word & name() const noexcept
The source name.
Definition faOption.H:380
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
A class for handling words, derived from Foam::string.
Definition word.H:66
U
Definition pEqn.H:72
thermo correct()
Namespace for finite-area.
Definition limitHeight.C:30
Namespace for OpenFOAM.
GeometricField< vector, faPatchField, areaMesh > areaVectorField
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68