Home
Downloads
Documentation
Installation
User Guide
man-pages
API Documentation
README
Release Notes
Changes
License
Support
SourceForge Project
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
randomProcesses
noise
noiseFFT.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 | Copyright (C) 1991-2010 OpenCFD Ltd.
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::noiseFFT
26
27
Description
28
FFT of the pressure field
29
30
SourceFiles
31
noiseFFT.C
32
33
\*---------------------------------------------------------------------------*/
34
35
#ifndef noiseFFT_H
36
#define noiseFFT_H
37
38
#include <
OpenFOAM/scalarField.H
>
39
#include <
OpenFOAM/graph.H
>
40
41
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42
43
namespace
Foam
44
{
45
46
/*---------------------------------------------------------------------------*\
47
Class noiseFFT Declaration
48
\*---------------------------------------------------------------------------*/
49
50
class
noiseFFT
51
:
52
public
scalarField
53
{
54
// Private data
55
56
//- Time spacing of the raw data
57
scalar deltat_;
58
59
60
public
:
61
62
//- Reference pressure
63
static
scalar
p0
;
64
65
66
// Constructors
67
68
//- Construct from pressure field
69
noiseFFT
70
(
71
const
scalar deltat,
72
const
scalarField
& pressure
73
);
74
75
//- Construct from Istream
76
noiseFFT
(
Istream
&);
77
78
//- Construct from pressure field file name
79
noiseFFT
(
const
fileName
& pFileName,
const
label skip = 0);
80
81
82
// Member Functions
83
84
//- Return the graph of p(t)
85
graph
pt
()
const
;
86
87
//- Return the nth window
88
tmp<scalarField>
window
(
const
label N,
const
label n)
const
;
89
90
//- Return the Hanning window function
91
tmp<scalarField>
Hanning
(
const
label N)
const
;
92
93
//- Return the fft of the given pressure data
94
tmp<scalarField>
Pf
(
const
tmp<scalarField>
& pn)
const
;
95
96
//- Return the multi-window mean fft of the complete pressure data
97
graph
meanPf
(
const
label N,
const
label nw)
const
;
98
99
//- Return the multi-window RMS mean fft of the complete pressure data
100
graph
RMSmeanPf
(
const
label N,
const
label nw)
const
;
101
102
//- Return the narrow-band PFL (pressure-fluctuation level) spectrum
103
graph
Lf
(
const
graph
& gPf)
const
;
104
105
//- Return the one-third-octave-band PFL spectrum
106
// starting at octave with mean frequency f1
107
graph
Ldelta
(
const
graph
& gLf,
const
scalar f1,
const
scalar fU)
const
;
108
109
//- Return the one-third-octave-band pressure spectrum
110
// starting at octave with mean frequency f1
111
graph
Pdelta
(
const
graph
& gLf,
const
scalar f1,
const
scalar fU)
const
;
112
113
//- Return the total PFL as the sum of Lf over all frequencies
114
scalar
Lsum
(
const
graph
& gLf)
const
;
115
116
//- Convert the db into Pa
117
scalar
dbToPa
(
const
scalar db)
const
;
118
119
//- Convert the db-field into Pa
120
tmp<scalarField>
dbToPa
(
const
tmp<scalarField>
& db)
const
;
121
};
122
123
124
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125
126
}
// End namespace Foam
127
128
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129
130
#endif
131
132
// ************************ vim: set sw=4 sts=4 et: ************************ //