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 -------------------------------------------------------------------------------
11 License
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 
27 Application
28  noise
29 
30 Group
31  grpPostProcessingUtilities
32 
33 Description
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 
41 Usage
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 
89 See 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 
101 using namespace Foam;
102 
103 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
104 
105 int main(int argc, char *argv[])
106 {
108  (
109  "Perform noise analysis of pressure data"
110  );
111 
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 
131  model->calculate();
132 
133  Info<< nl << "End\n" << endl;
134 
135  return 0;
136 }
137 
138 
139 // ************************************************************************* //
Foam::IOdictionary
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:54
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
setSystemRunTimeDictionaryIO.H
dictName
const word dictName("faMeshDefinition")
Foam::argList::addNote
static void addNote(const string &note)
Add extra notes for the usage information.
Definition: argList.C:412
Foam::fileHandler
const fileOperation & fileHandler()
Get current file handler.
Definition: fileOperation.C:1485
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:369
noiseModel.H
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
Foam::noiseModel::New
static autoPtr< noiseModel > New(const dictionary &dict)
Selector.
Definition: noiseModelNew.C:32
argList.H
Foam::argList::noCheckProcessorDirectories
static void noCheckProcessorDirectories()
Remove checking of processor directories.
Definition: argList.C:521
dict
dictionary dict
Definition: searchingEngine.H:14
dictIO
IOobject dictIO
Definition: setConstantMeshDictionaryIO.H:1
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::IOobject::name
const word & name() const noexcept
Return name.
Definition: IOobjectI.H:65
Time.H
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
setRootCase.H
Foam::nl
constexpr char nl
Definition: Ostream.H:404
createTime.H
Foam::argList::addOption
static void addOption(const word &optName, const string &param="", const string &usage="", bool advanced=false)
Add an option to validOptions with usage information.
Definition: argList.C:335
Foam::fileOperation::distributed
bool distributed() const noexcept
Distributed roots (parallel run)
Definition: fileOperation.H:239