Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::noiseModels::pointNoise
28
29Description
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
67SourceFiles
68 pointNoise.C
69
70SeeAlso
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
84namespace Foam
85{
86namespace noiseModels
87{
89/*---------------------------------------------------------------------------*\
90 Class pointNoise Declaration
91\*---------------------------------------------------------------------------*/
92
93class pointNoise
94:
95 public noiseModel
96{
97
98protected:
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,
114 ) const;
115
116 //- Process the CSV data
117 void processData
118 (
119 const label dataseti,
121 );
122
123
124public:
125
126 //- Runtime type information
127 TypeName("pointNoise");
129 //- Constructor
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// ************************************************************************* //
Templated CSV function.
Definition CSV.H:74
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition List.H:72
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
noiseModel(const noiseModel &)=delete
No copy construct.
pointNoise(const dictionary &dict, const objectRegistry &obr, const word &name=typeName, const bool readFields=true)
Constructor.
Definition pointNoise.C:220
void filterTimeData(const scalarField &t0, const scalarField &p0, scalarField &t, scalarField &p) const
Definition pointNoise.C:40
void processData(const label dataseti, const Function1Types::CSV< scalar > &data)
Process the CSV data.
Definition pointNoise.C:65
TypeName("pointNoise")
Runtime type information.
virtual bool read(const dictionary &dict)
Read from dictionary.
Definition pointNoise.C:262
List< fileName > inputFileNames_
Input file names - optional.
Definition pointNoise.H:100
virtual ~pointNoise()=default
Destructor.
virtual void calculate()
Calculate.
Definition pointNoise.C:238
Registry of regIOobjects.
A class for handling words, derived from Foam::string.
Definition word.H:66
volScalarField & p
const volScalarField & p0
Definition EEqn.H:36
Namespace for OpenFOAM.
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const NameMatchPredicate &selectedFields, DynamicList< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type and store on the objectRegistry.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68