Hanning.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) 2016 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::windowModels::Hanning
28 
29 Description
30  Hanning window
31 
32  The window is described by the function
33  \f[
34  wf = (1 - \alpha) - \alpha cos(2 \pi t/m);
35  \f]
36 
37  Where:
38  \vartable
39  \alpha | Coefficient with a default value of 0.5
40  t | time
41  m | window width
42  \endvartable
43 
44  The window can be further manipulated by the controls:
45  - \c symmetric: force the window to be symmetric
46  - \c extended: extend the window by 1 element at start and end to produce
47  non-zero values at the start and end positions. Note: window is
48  normalised to preserve energy content
49 
50 SourceFiles
51  Hanning.C
52 
53 \*---------------------------------------------------------------------------*/
54 
55 #ifndef Hanning_H
56 #define Hanning_H
57 
58 #include "autoPtr.H"
59 #include "runTimeSelectionTables.H"
60 #include "windowModel.H"
61 
62 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
63 
64 namespace Foam
65 {
66 namespace windowModels
67 {
68 
69 /*---------------------------------------------------------------------------*\
70  Class Hanning Declaration
71 \*---------------------------------------------------------------------------*/
72 
73 class Hanning
74 :
75  public windowModel
76 {
77 
78 protected:
79 
80  // Protected Member Data
81 
82  //- Symmetric switch
83  bool symmetric_;
84 
85  //- Extended switch
86  bool extended_;
87 
88  //- Window coefficient, default = 0.5
89  scalar alpha_;
90 
91 
92 public:
93 
94  //- Runtime type information
95  TypeName("Hanning");
96 
97 
98  //- Construct from dictionary
99  Hanning(const dictionary& dict, const label nSamples);
100 
101  //- Destructor
102  virtual ~Hanning() = default;
103 
104 
105  // Public Member Functions
106 
107  //- Return the symmetric flag
108  bool symmetric() const;
109 
110  //- Return the extended flag
111  bool extended() const;
112 
113  //- Return the window coefficient
114  scalar alpha() const;
115 };
116 
117 
118 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119 
120 } // End namespace windowModels
121 } // End namespace Foam
122 
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 
125 #endif
126 
127 // ************************************************************************* //
Foam::windowModels::Hanning::alpha
scalar alpha() const
Return the window coefficient.
Definition: Hanning.C:107
windowModel.H
Foam::windowModels::Hanning::~Hanning
virtual ~Hanning()=default
Destructor.
Foam::windowModels::Hanning::Hanning
Hanning(const dictionary &dict, const label nSamples)
Construct from dictionary.
Definition: Hanning.C:47
Foam::windowModels::Hanning::symmetric
bool symmetric() const
Return the symmetric flag.
Definition: Hanning.C:95
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::windowModels::Hanning::extended_
bool extended_
Extended switch.
Definition: Hanning.H:97
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::windowModels::Hanning::alpha_
scalar alpha_
Window coefficient, default = 0.5.
Definition: Hanning.H:100
Foam::windowModels::Hanning::symmetric_
bool symmetric_
Symmetric switch.
Definition: Hanning.H:94
Foam::windowModels::Hanning::TypeName
TypeName("Hanning")
Runtime type information.
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
Foam::windowModel::nSamples
label nSamples() const
Return the number of samples in the window.
Definition: windowModel.C:56
Foam::windowModel
Base class for windowing models.
Definition: windowModel.H:52
Foam::windowModels::Hanning
Hanning window.
Definition: Hanning.H:84
Foam::windowModels::Hanning::extended
bool extended() const
Return the extended flag.
Definition: Hanning.C:101
autoPtr.H