forcing.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-2023 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::forcing
26 
27 Description
28  Base fvModel for forcing functions.
29 
30 See also
31  Foam::fv::isotropicDamping
32  Foam::fv::verticalDamping
33 
34 SourceFiles
35  forcing.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef forcing_H
40 #define forcing_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 forcing Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 class forcing
58 :
59  public fvModel
60 {
61 protected:
62 
63  // Protected Data
64 
65  //- Damping coefficient [1/s]
67 
68  //- Optional boundary 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 scale distribution
88 
89  //- Return the force coefficient given the scale distribution
91  (
93  ) const;
94 
95  //- Return the force coefficient
97 
98 
99 public:
100 
101  //- Runtime type information
102  TypeName("forcing");
103 
104 
105  // Constructors
106 
107  //- Construct from components
108  forcing
109  (
110  const word& name,
111  const word& modelType,
112  const fvMesh& mesh,
113  const dictionary& dict
114  );
115 
116 
117  //- Destructor
118  virtual ~forcing()
119  {}
120 
121 
122  // Member Functions
123 
124  // IO
125 
126  //- Read dictionary
127  virtual bool read(const dictionary& dict);
128 };
129 
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 } // End namespace fv
134 } // End namespace Foam
135 
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 
138 #endif
139 
140 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:101
Finite volume model abstract base class.
Definition: fvModel.H:59
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvModelI.H:34
const word & name() const
Return const access to the source name.
Definition: fvModelI.H:28
Base fvModel for forcing functions.
Definition: forcing.H:59
void readCoeffs()
Non-virtual read.
Definition: forcing.C:43
vectorField directions_
Directions of increasing scaling coordinate.
Definition: forcing.H:77
TypeName("forcing")
Runtime type information.
virtual ~forcing()
Destructor.
Definition: forcing.H:117
dimensionedScalar lambda_
Damping coefficient [1/s].
Definition: forcing.H:65
vectorField origins_
Origins of the scaling coordinate.
Definition: forcing.H:74
dimensionedScalar lambdaBoundary_
Optional boundary damping coefficient [1/s].
Definition: forcing.H:68
forcing(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from components.
Definition: forcing.C:203
virtual bool read(const dictionary &dict)
Read dictionary.
Definition: forcing.C:223
tmp< volScalarField::Internal > forceCoeff() const
Return the force coefficient.
Definition: forcing.C:194
tmp< volScalarField::Internal > scale() const
Return the scale distribution.
Definition: forcing.C:127
autoPtr< Function1< scalar > > scale_
The scaling function.
Definition: forcing.H:71
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
labelList fv(nPoints)
dictionary dict