All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
limitVelocity.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2016-2021 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::fv::limitVelocity
26 
27 Description
28  Limits the velocity magnitude to the specified \c max value.
29 
30 Usage
31  Example usage:
32  \verbatim
33  limitU
34  {
35  type limitVelocity;
36 
37  selectionMode all;
38 
39  max 100;
40  }
41  \endverbatim
42 
43 SourceFiles
44  limitVelocity.C
45 
46 \*---------------------------------------------------------------------------*/
47 
48 #ifndef limitVelocity_H
49 #define limitVelocity_H
50 
51 #include "fvConstraint.H"
52 #include "fvCellSet.H"
53 
54 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55 
56 namespace Foam
57 {
58 namespace fv
59 {
60 
61 /*---------------------------------------------------------------------------*\
62  Class limitVelocity Declaration
63 \*---------------------------------------------------------------------------*/
64 
65 class limitVelocity
66 :
67  public fvConstraint
68 {
69  // Private data
70 
71  //- The set of cells the fvConstraint applies to
72  fvCellSet set_;
73 
74  //- Velocity field name, default = U
75  word UName_;
76 
77  //- Maximum velocity magnitude
78  scalar max_;
79 
80 
81  // Private Member Functions
82 
83  //- Non-virtual read
84  void readCoeffs();
85 
86 
87 public:
88 
89  //- Runtime type information
90  TypeName("limitVelocity");
91 
92 
93  // Constructors
94 
95  //- Construct from components
97  (
98  const word& name,
99  const word& modelType,
100  const dictionary& dict,
101  const fvMesh& mesh
102  );
103 
104  //- Disallow default bitwise copy construction
105  limitVelocity(const limitVelocity&) = delete;
106 
107 
108  //- Destructor
109  virtual ~limitVelocity()
110  {}
111 
112 
113  // Member Functions
114 
115  //- Return the list of fields constrained by the fvConstraint
116  virtual wordList constrainedFields() const;
117 
118  //- Constrain the velocity field
119  virtual bool constrain(volVectorField& U) const;
120 
121  //- Update for mesh changes
122  virtual void updateMesh(const mapPolyMesh&);
123 
124  //- Read dictionary
125  virtual bool read(const dictionary& dict);
126 
127 
128  // Member Operators
129 
130  //- Disallow default bitwise assignment
131  void operator=(const limitVelocity&) = delete;
132 };
133 
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 } // End namespace fv
138 } // End namespace Foam
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 #endif
143 
144 // ************************************************************************* //
dictionary dict
virtual bool constrain(volVectorField &U) const
Constrain the velocity field.
Definition: limitVelocity.C:83
Limits the velocity magnitude to the specified max value.
Definition: limitVelocity.H:64
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvConstraintI.H:34
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
Cell-set fvConstraint abstract base class. Provides a base set of controls regarding the location whe...
virtual wordList constrainedFields() const
Return the list of fields constrained by the fvConstraint.
Definition: limitVelocity.C:77
virtual void updateMesh(const mapPolyMesh &)
Update for mesh changes.
TypeName("limitVelocity")
Runtime type information.
virtual bool read(const dictionary &dict)
Read dictionary.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
void operator=(const limitVelocity &)=delete
Disallow default bitwise assignment.
const word & name() const
Return const access to the source name.
Definition: fvConstraintI.H:28
A class for handling words, derived from string.
Definition: word.H:59
labelList fv(nPoints)
virtual ~limitVelocity()
Destructor.
U
Definition: pEqn.H:72
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
limitVelocity(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
Definition: limitVelocity.C:59
Finite volume options abstract base class.
Definition: fvConstraint.H:54
Namespace for OpenFOAM.