velocityDampingConstraint.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) 2015 OpenFOAM Foundation
9 Copyright (C) 2015-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::velocityDampingConstraint
29
30Group
31 grpFvOptionsConstraints
32
33Description
34 Constrain given velocity fields to dampen velocity
35 fluctuations exceeding a given value within a specified region.
36
37 This constraint is primarily used to dampen velocity fluctuations in
38 the start-up phase of simulations. When the local velocity magnitude
39 exceeds the user-supplied maximum value a sink term is activated in
40 the affected region to lower the velocity to the limiting value.
41
42 Constraints applied to:
43 \verbatim
44 U | Velocity [m/s]
45 \endverbatim
46
47 Required fields:
48 \verbatim
49 U | Velocity [m/s]
50 \endverbatim
51
52Usage
53 Minimal example by using \c constant/fvOptions:
54 \verbatim
55 velocityDampingConstraint1
56 {
57 // Mandatory entries (unmodifiable)
58 type velocityDampingConstraint;
59
60 // Mandatory entries (runtime modifiable)
61 UMax 200;
62
63 // Optional entries (runtime modifiable)
64 UNames (<Uname1> <Uname2> ... <UnameN>);
65
66 // Conditional optional entries (runtime modifiable)
67
68 // when UNames entry is not present
69 U U;
70
71 // Mandatory/Optional (inherited) entries
72 ...
73 }
74 \endverbatim
75
76 where the entries mean:
77 \table
78 Property | Description | Type | Reqd | Dflt
79 type | Type name: velocityDampingConstraint | word | yes | -
80 UMax | Maximum velocity magnitude | scalar | yes | -
81 UNames | Names of operand velocity fields | wordList | no | -
82 U | Name of operand velocity field | word | cndtnl | U
83 \endtable
84
85 The inherited entries are elaborated in:
86 - \link fvOption.H \endlink
87 - \link cellSetOption.H \endlink
88
89Note
90 - When active, this constraint manipulates the system of equations.
91 Users should ensure that it is not active when the case is converged
92 (steady-state) or during the period of interest (transient) to ensure
93 that its presence does not pollute the results.
94
95See also
96 - Foam::fv::limitVelocity
97
98SourceFiles
99 velocityDampingConstraint.C
100
101\*---------------------------------------------------------------------------*/
102
103#ifndef velocityDampingConstraint_H
104#define velocityDampingConstraint_H
105
106#include "cellSetOption.H"
107
108// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
109
110namespace Foam
111{
112namespace fv
113{
114
115/*---------------------------------------------------------------------------*\
116 Class velocityDampingConstraint Declaration
117\*---------------------------------------------------------------------------*/
118
119class velocityDampingConstraint
120:
121 public fv::cellSetOption
122{
123protected:
124
125 // Protected Data
126
127 //- Maximum velocity magnitude
128 scalar UMax_;
129
130
131 // Protected Member Functions
132
133 //- Constrain the given velocity fields by a given maximum value
134 void addDamping(fvMatrix<vector>& eqn);
135
136
137public:
138
139 //- Runtime type information
140 TypeName("velocityDampingConstraint");
141
142
143 // Constructors
144
145 //- Construct from components
147 (
148 const word& name,
149 const word& modelType,
150 const dictionary& dict,
151 const fvMesh& mesh
152 );
153
154 //- No copy construct
156
157 //- No copy assignment
158 void operator=(const velocityDampingConstraint&) = delete;
159
160
161 //- Destructor
162 virtual ~velocityDampingConstraint() = default;
163
164
165 // Member Functions
166
167 // Set values directly
168
169 //- Constrain vector matrix
170 virtual void constrain(fvMatrix<vector>& eqn, const label fieldi);
171
172
173 // I-O
174
175 //- Write data
176 virtual void writeData(Ostream& os) const;
177
178 //- Read dictionary
179 virtual bool read(const dictionary& dict);
180};
181
182
183// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185} // End namespace fv
186} // End namespace Foam
188// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189
190#endif
192// ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvMatrix.H:121
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.
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
Constrain given velocity fields to dampen velocity fluctuations exceeding a given value within a spec...
scalar UMax_
Maximum velocity magnitude.
virtual void writeData(Ostream &os) const
Write data.
velocityDampingConstraint(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
void addDamping(fvMatrix< vector > &eqn)
Constrain the given velocity fields by a given maximum value.
virtual bool read(const dictionary &dict)
Read dictionary.
TypeName("velocityDampingConstraint")
Runtime type information.
virtual void constrain(fvMatrix< vector > &eqn, const label fieldi)
Constrain vector matrix.
velocityDampingConstraint(const velocityDampingConstraint &)=delete
No copy construct.
virtual ~velocityDampingConstraint()=default
Destructor.
void operator=(const velocityDampingConstraint &)=delete
No copy assignment.
A class for handling words, derived from Foam::string.
Definition: word.H:68
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
labelList fv(nPoints)
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73