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-2022 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  \endverbatim
66 
67 SourceFiles
68  pointNoise.C
69 
70 SeeAlso
71  noiseModel.H
72  windowModel.H
73 
74 \*---------------------------------------------------------------------------*/
75 
76 #ifndef noiseModels_pointNoise_H
77 #define noiseModels_pointNoise_H
78 
79 #include "noiseModel.H"
80 #include "CSV.H"
81 
82 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
83 
84 namespace Foam
85 {
86 namespace noiseModels
87 {
88 
89 /*---------------------------------------------------------------------------*\
90  Class pointNoise Declaration
91 \*---------------------------------------------------------------------------*/
92 
93 class pointNoise
94 :
95  public noiseModel
96 {
97 
98 protected:
99 
100  // Protected data
101 
102  //- Input file names - optional
104 
105 
106  // Protected Member Functions
107 
108  void filterTimeData
109  (
110  const scalarField& t0,
111  const scalarField& p0,
112  scalarField& t,
113  scalarField& p
114  ) const;
115 
116  //- Process the CSV data
117  void processData
118  (
119  const label dataseti,
121  );
122 
123 
124 public:
125 
126  //- Runtime type information
127  TypeName("pointNoise");
128 
129  //- Constructor
130  pointNoise
131  (
132  const dictionary& dict,
133  const objectRegistry& obr,
134  const word& name = typeName,
135  const bool readFields = true
136  );
137 
138  //- Destructor
139  virtual ~pointNoise() = default;
140 
141 
142  // Public Member Functions
143 
144  //- Read from dictionary
145  virtual bool read(const dictionary& dict);
146 
147  //- Calculate
148  virtual void calculate();
149 };
150 
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 } // End namespace noiseModels
155 } // End namespace Foam
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 #endif
160 
161 // ************************************************************************* //
dictionary dict
virtual void calculate()
Calculate.
Definition: pointNoise.C:233
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:120
Templated CSV function.
Definition: CSV.H:71
pointNoise(const dictionary &dict, const objectRegistry &obr, const word &name=typeName, const bool readFields=true)
Constructor.
Definition: pointNoise.C:215
virtual bool read(const dictionary &dict)
Read from dictionary.
Definition: pointNoise.C:257
virtual ~pointNoise()=default
Destructor.
void filterTimeData(const scalarField &t0, const scalarField &p0, scalarField &t, scalarField &p) const
Definition: pointNoise.C:40
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:52
A class for handling words, derived from Foam::string.
Definition: word.H:63
Perform noise analysis on point-based pressure data.
Definition: pointNoise.H:88
Database for solution data, solver performance and other reduced data.
Definition: data.H:51
List< fileName > inputFileNames_
Input file names - optional.
Definition: pointNoise.H:100
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject *> &storedObjects)
Read the selected GeometricFields of the templated type.
volScalarField & p
Registry of regIOobjects.
void processData(const label dataseti, const Function1Types::CSV< scalar > &data)
Process the CSV data.
Definition: pointNoise.C:65
TypeName("pointNoise")
Runtime type information.
const volScalarField & p0
Definition: EEqn.H:36
Namespace for OpenFOAM.
Base class for noise models.
Definition: noiseModel.H:166