damping.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) 2017-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::damping
26 
27 Description
28  Base fvModel for damping functions.
29 
30 See also
31  Foam::fv::isotropicDamping
32  Foam::fv::verticalDamping
33 
34 SourceFiles
35  damping.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef damping_H
40 #define damping_H
41 
42 #include "fvModel.H"
43 #include "Function1.H"
44 #include "volFields.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 namespace fv
51 {
52 
53 /*---------------------------------------------------------------------------*\
54  Class damping Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 class damping
58 :
59  public fvModel
60 {
61 protected:
62 
63  // Protected Data
64 
65  //- Name of the velocity field
66  word UName_;
67 
68  //- Damping coefficient [1/s]
70 
71  //- The scaling function
73 
74  //- Origins of the scaling coordinate
76 
77  //- Directions of increasing scaling coordinate
79 
80 
81  // Protected Member Functions
82 
83  //- Non-virtual read
84  void readCoeffs();
85 
86  //- Return the force coefficient
88 
89 
90 public:
91 
92  //- Runtime type information
93  TypeName("damping");
94 
95 
96  // Constructors
97 
98  //- Construct from components
99  damping
100  (
101  const word& name,
102  const word& modelType,
103  const dictionary& dict,
104  const fvMesh& mesh
105  );
106 
107 
108  //- Destructor
109  virtual ~damping()
110  {}
111 
112 
113  // Member Functions
114 
115  // Checks
116 
117  //- Return the list of fields for which the fvModel adds source term
118  // to the transport equation
119  virtual wordList addSupFields() const;
120 
121 
122  // IO
123 
124  //- Read dictionary
125  virtual bool read(const dictionary& dict);
126 };
127 
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 } // End namespace fv
132 } // End namespace Foam
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 #endif
137 
138 // ************************************************************************* //
dictionary dict
autoPtr< Function1< scalar > > scale_
The scaling function.
Definition: damping.H:71
dimensionedScalar lambda_
Damping coefficient [1/s].
Definition: damping.H:68
vectorField origins_
Origins of the scaling coordinate.
Definition: damping.H:74
const word & name() const
Return const access to the source name.
Definition: fvModelI.H:28
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
void readCoeffs()
Non-virtual read.
Definition: damping.C:43
Finite volume model abstract base class.
Definition: fvModel.H:55
damping(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
Definition: damping.C:175
TypeName("damping")
Runtime type information.
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvModelI.H:34
virtual bool read(const dictionary &dict)
Read dictionary.
Definition: damping.C:201
word UName_
Name of the velocity field.
Definition: damping.H:65
A class for handling words, derived from string.
Definition: word.H:59
labelList fv(nPoints)
virtual wordList addSupFields() const
Return the list of fields for which the fvModel adds source term.
Definition: damping.C:195
virtual ~damping()
Destructor.
Definition: damping.H:108
Base fvModel for damping functions.
Definition: damping.H:56
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
A class for managing temporary objects.
Definition: PtrList.H:53
tmp< volScalarField::Internal > forceCoeff() const
Return the force coefficient.
Definition: damping.C:121
Namespace for OpenFOAM.
vectorField directions_
Directions of increasing scaling coordinate.
Definition: damping.H:77