1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 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, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 FFT of the pressure field
34 \*---------------------------------------------------------------------------*/
39 #include "scalarField.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 /*---------------------------------------------------------------------------*\
48 Class noiseFFT Declaration
49 \*---------------------------------------------------------------------------*/
57 //- Time spacing of the raw data
63 //- Reference pressure
69 //- Construct from pressure field
73 const scalarField& pressure
76 //- Construct from Istream
79 //- Construct from pressure field file name
80 noiseFFT(const fileName& pFileName, const label skip = 0);
85 //- Return the graph of p(t)
88 //- Return the nth window
89 tmp<scalarField> window(const label N, const label n) const;
91 //- Return the Hanning window function
92 tmp<scalarField> Hanning(const label N) const;
94 //- Return the fft of the given pressure data
95 tmp<scalarField> Pf(const tmp<scalarField>& pn) const;
97 //- Return the multi-window mean fft of the complete pressure data
98 graph meanPf(const label N, const label nw) const;
100 //- Return the multi-window RMS mean fft of the complete pressure data
101 graph RMSmeanPf(const label N, const label nw) const;
103 //- Return the narrow-band PFL (pressure-fluctuation level) spectrum
104 graph Lf(const graph& gPf) const;
106 //- Return the one-third-octave-band PFL spectrum
107 // starting at octave with mean frequency f1
108 graph Ldelta(const graph& gLf, const scalar f1, const scalar fU) const;
110 //- Return the one-third-octave-band pressure spectrum
111 // starting at octave with mean frequency f1
112 graph Pdelta(const graph& gLf, const scalar f1, const scalar fU) const;
114 //- Return the total PFL as the sum of Lf over all frequencies
115 scalar Lsum(const graph& gLf) const;
117 //- Convert the db into Pa
118 scalar dbToPa(const scalar db) const;
120 //- Convert the db-field into Pa
121 tmp<scalarField> dbToPa(const tmp<scalarField>& db) const;
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 } // End namespace Foam
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133 // ************************************************************************* //