1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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.
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
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/>.
28 FFT of the pressure field
33 \*---------------------------------------------------------------------------*/
38 #include "scalarField.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 /*---------------------------------------------------------------------------*\
47 Class noiseFFT Declaration
48 \*---------------------------------------------------------------------------*/
56 //- Time spacing of the raw data
62 //- Reference pressure
68 //- Construct from pressure field
72 const scalarField& pressure
75 //- Construct from Istream
78 //- Construct from pressure field file name
79 noiseFFT(const fileName& pFileName, const label skip = 0);
84 //- Return the graph of p(t)
87 //- Return the nth window
88 tmp<scalarField> window(const label N, const label n) const;
90 //- Return the Hanning window function
91 tmp<scalarField> Hanning(const label N) const;
93 //- Return the fft of the given pressure data
94 tmp<scalarField> Pf(const tmp<scalarField>& pn) const;
96 //- Return the multi-window mean fft of the complete pressure data
97 graph meanPf(const label N, const label nw) const;
99 //- Return the multi-window RMS mean fft of the complete pressure data
100 graph RMSmeanPf(const label N, const label nw) const;
102 //- Return the narrow-band PFL (pressure-fluctuation level) spectrum
103 graph Lf(const graph& gPf) const;
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;
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;
113 //- Return the total PFL as the sum of Lf over all frequencies
114 scalar Lsum(const graph& gLf) const;
116 //- Convert the db into Pa
117 scalar dbToPa(const scalar db) const;
119 //- Convert the db-field into Pa
120 tmp<scalarField> dbToPa(const tmp<scalarField>& db) const;
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 } // End namespace Foam
128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 // ************************************************************************* //