noise.C
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) 2011-2015 OpenFOAM Foundation
9 Copyright (C) 2016-2021 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Application
28 noise
29
30Group
31 grpPostProcessingUtilities
32
33Description
34 Perform noise analysis of pressure data.
35
36 The utility provides a light wrapper around the run-time selectable
37 noise model. Current options include:
38 - point, and
39 - surface noise.
40
41Usage
42 \verbatim
43 noiseModel surfaceNoise; // pointNoise
44
45 surfaceNoiseCoeffs
46 {
47 windowModel Hanning;
48
49 HanningCoeffs
50 {
51 // Window overlap percentage
52 overlapPercent 50;
53 symmetric yes;
54 extended yes;
55
56 // Optional number of windows, default = all available
57 nWindow 5;
58 }
59
60
61 // Input files list
62 files ("postProcessing/faceSource1/surface/patch/patch.case";)
63
64 // Surface reader
65 reader ensight;
66
67 // Surface writer
68 writer ensight;
69
70 // Collate times for ensight output
71 // - ensures geometry is only written once
72 writeOptions
73 {
74 ensight
75 {
76 collateTimes true;
77 }
78 }
79
80 // Number of samples in sampling window, default = 2^16 (=65536)
81 N 4096;
82
83 // Write interval for FFT data, default = 1
84 fftWriteInterval 100;
85 }
86 \endverbatim
87
88
89See also
90 noiseModel.H
91 windowModel.H
92
93\*---------------------------------------------------------------------------*/
94
95#include "argList.H"
96#include "Time.H"
97#include "noiseModel.H"
98
99// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
100
101using namespace Foam;
102
103// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
104
105int main(int argc, char *argv[])
106{
107 argList::addNote
108 (
109 "Perform noise analysis of pressure data"
110 );
111
112 argList::noCheckProcessorDirectories();
113
114 argList::addOption("dict", "file", "Alternative noiseDict");
115
116 #include "setRootCase.H"
117
118 // As much as possible avoid synchronised operation
119 fileHandler().distributed(true);
120
121 #include "createTime.H"
122
123 const word dictName("noiseDict");
125
126 Info<< "Reading " << dictIO.name() << nl << endl;
127
129
130 autoPtr<noiseModel> model(noiseModel::New(dict));
131 model->calculate();
132
133 Info<< nl << "End\n" << endl;
134
135 return 0;
136}
137
138
139// ************************************************************************* //
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:57
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
bool distributed() const noexcept
Distributed roots (parallel run)
A class for handling words, derived from Foam::string.
Definition: word.H:68
const word dictName("faMeshDefinition")
Namespace for OpenFOAM.
const fileOperation & fileHandler()
Get current file handler.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:372
constexpr char nl
The newline '\n' character (0x0a)
Definition: Ostream.H:53
dictionary dict
IOobject dictIO