pointNoise.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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2015-2016 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::noiseModels::pointNoise
28 
29 Description
30  Perform noise analysis on point-based pressure data.
31 
32  Input data is read from a dictionary, e.g.
33 
34  \verbatim
35  // Pressure reference
36  pRef 0;
37 
38  // Number of samples in sampling window, default = 2^16 (=65536)
39  N 4096;
40 
41  // Lower frequency bounds
42  fl 25;
43 
44  // Upper frequency bounds
45  fu 25;
46 
47  // Start time
48  startTime 0;
49 
50  windowModel <modelType>
51  <modelType>Coeffs
52  {
53  ...
54  }
55 
56  // Pressure data supplied in CSV file format
57  file "pressureData";
58  //files ("pressureData1" "pressureData2");
59  nHeaderLine 1;
60  refColumn 0;
61  componentColumns (1);
62  separator " ";
63  mergeSeparators yes;
64 
65  graphFormat raw;
66 
67  \endverbatim
68 
69 SourceFiles
70  pointNoise.C
71 
72 SeeAlso
73  noiseModel.H
74  windowModel.H
75 
76 \*---------------------------------------------------------------------------*/
77 
78 #ifndef noiseModels_pointNoise_H
79 #define noiseModels_pointNoise_H
80 
81 #include "noiseModel.H"
82 #include "CSV.H"
83 
84 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
85 
86 namespace Foam
87 {
88 namespace noiseModels
89 {
90 
91 /*---------------------------------------------------------------------------*\
92  Class pointNoise Declaration
93 \*---------------------------------------------------------------------------*/
94 
95 class pointNoise
96 :
97  public noiseModel
98 {
99 
100 protected:
101 
102  // Protected data
103 
104  //- Input file names - optional
106 
107 
108  // Protected Member Functions
109 
110  void filterTimeData
111  (
112  const scalarField& t0,
113  const scalarField& p0,
114  scalarField& t,
115  scalarField& p
116  ) const;
117 
118  //- Process the CSV data
119  void processData
120  (
121  const label dataseti,
123  );
124 
125 
126 public:
127 
128  //- Runtime type information
129  TypeName("pointNoise");
130 
131  //- Constructor
132  pointNoise(const dictionary& dict, const bool readFields = true);
133 
134  //- Destructor
135  virtual ~pointNoise() = default;
136 
137 
138  // Public Member Functions
139 
140  //- Read from dictionary
141  virtual bool read(const dictionary& dict);
142 
143  //- Calculate
144  virtual void calculate();
145 };
146 
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 } // End namespace noiseModels
151 } // End namespace Foam
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 #endif
156 
157 // ************************************************************************* //
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::noiseModels::pointNoise::pointNoise
pointNoise(const dictionary &dict, const bool readFields=true)
Constructor.
Definition: pointNoise.C:225
Foam::noiseModel
Base class for noise models.
Definition: noiseModel.H:175
Foam::noiseModels::pointNoise::~pointNoise
virtual ~pointNoise()=default
Destructor.
Foam::Function1Types::CSV
Templated CSV function.
Definition: CSV.H:75
Foam::noiseModels::pointNoise::inputFileNames_
List< fileName > inputFileNames_
Input file names - optional.
Definition: pointNoise.H:104
noiseModel.H
Foam::noiseModels::pointNoise::TypeName
TypeName("pointNoise")
Runtime type information.
Foam::Field< scalar >
Foam::noiseModels::pointNoise::read
virtual bool read(const dictionary &dict)
Read from dictionary.
Definition: pointNoise.C:262
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::readFields
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type.
Definition: ReadFieldsTemplates.C:312
CSV.H
Foam::noiseModels::pointNoise
Perform noise analysis on point-based pressure data.
Definition: pointNoise.H:94
Foam::List< fileName >
Foam::noiseModels::pointNoise::calculate
virtual void calculate()
Calculate.
Definition: pointNoise.C:238
p0
const volScalarField & p0
Definition: EEqn.H:36
Foam::noiseModels::pointNoise::processData
void processData(const label dataseti, const Function1Types::CSV< scalar > &data)
Process the CSV data.
Definition: pointNoise.C:72
Foam::noiseModels::pointNoise::filterTimeData
void filterTimeData(const scalarField &t0, const scalarField &p0, scalarField &t, scalarField &p) const
Definition: pointNoise.C:47
Foam::data
Database for solution data, solver performance and other reduced data.
Definition: data.H:55