83#ifndef Foam_noiseModel_H
84#define Foam_noiseModel_H
306 scalar
RAf(
const scalar
f)
const;
312 scalar
RBf(
const scalar
f)
const;
315 scalar
gainB(
const scalar
f)
const;
318 scalar
RCf(
const scalar
f)
const;
321 scalar
gainC(
const scalar
f)
const;
324 scalar
RDf(
const scalar
f)
const;
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A class for handling file names.
Base class for writing single files from the function objects.
fileName baseFileDir() const
Return the base directory for output.
static label findStart(const UList< instant > ×, const scalar timeVal)
Find and return index of given start time (linear search).
Base class for noise models.
tmp< scalarField > uniformFrequencies(const scalar deltaT, const bool check) const
Create a field of equally spaced frequencies for the current set of data - assumes a constant time st...
scalar RAf(const scalar f) const
A weighting function.
scalar rhoRef_
Reference density (to convert from kinematic to static pressure).
label nSamples_
Number of samples in sampling window, default = 2^16.
declareRunTimeSelectionTable(autoPtr, noiseModel, dictionary,(const dictionary &dict, const objectRegistry &obr),(dict, obr))
Run time selection table.
tmp< scalarField > octaves(const scalarField &data, const scalarField &f, const labelUList &freqBandIDs) const
Generate octave data.
tmp< scalarField > RMSmeanPf(const scalarField &p) const
Return the multi-window RMS mean fft of the complete pressure data [Pa].
virtual void calculate()=0
Abstract call to calculate.
scalar fUpper_
Upper frequency limit, default = 10kHz.
scalar gainC(const scalar f) const
C weighting as gain in dB.
tmp< Foam::scalarField > PSD(const scalarField &PSDf) const
PSD [dB/Hz].
static autoPtr< noiseModel > New(const dictionary &dict, const objectRegistry &obr)
Selector.
tmp< scalarField > meanPf(const scalarField &p) const
Return the multi-window mean fft of the complete pressure data [Pa].
scalar maxPressure_
Min pressure value.
bool writePSD_
Write PSD; default = yes.
scalar gainA(const scalar f) const
A weighting as gain in dB.
scalar minPressure_
Min pressure value.
static void setOctaveBands(const scalarField &f, const scalar fLower, const scalar fUpper, const scalar octave, labelList &fBandIDs, scalarField &fCentre)
Return a list of the frequency indices wrt f field that correspond to the bands limits for a given oc...
virtual bool read(const dictionary &dict)
Read from dictionary.
bool writeOctaves_
Write writeOctaves; default = yes.
fileName outputPrefix_
Output file prefix, default = ''.
scalar RDf(const scalar f) const
D weighting function.
tmp< scalarField > Pf(const scalarField &p) const
Return the fft of the given pressure data.
scalar RCf(const scalar f) const
C weighting function.
noiseModel(const noiseModel &)=delete
No copy construct.
tmp< scalarField > SPL(const scalarField &Prms2, const scalar f) const
SPL [dB].
planInfo planInfo_
Plan information for FFTW.
static label findStartTimeIndex(const instantList &allTimes, const scalar startTime)
Find and return start time index.
void operator=(const noiseModel &)=delete
No copy assignment.
autoPtr< windowModel > windowModelPtr_
Window model.
static const Enum< weightingType > weightingTypeNames_
bool writeSPL_
Write SPL; default = yes.
TypeName("noiseModel")
Runtime type information.
const dictionary dict_
Copy of dictionary used for construction.
void writeFileHeader(Ostream &os, const string &x, const string &y, const UList< Tuple2< string, token > > &headerValues=UList< Tuple2< string, token > >::null()) const
Write output file header.
bool writePrmsf_
Write Prmsf; default = yes.
virtual ~noiseModel()=default
Destructor.
weightingType SPLweighting_
Weighting.
scalar checkUniformTimeStep(const scalarList ×) const
Check and return uniform time step.
bool writePSDf_
Write PSDf; default = yes.
scalar gainD(const scalar f) const
D weighting as gain in dB.
tmp< scalarField > PSDf(const scalarField &p, const scalar deltaT) const
Return the multi-window Power Spectral Density (PSD) of the complete pressure data [Pa^2/Hz].
void writeWeightings() const
Helper function to check weightings.
scalar startTime_
Start time, default = 0s.
scalar sampleFreq_
Prescribed sample frequency.
void cleanFFTW()
Clean up the FFTW.
scalar dBRef_
Reference for dB calculation, default = 2e-5.
void writeFreqDataToFile(Ostream &os, const scalarField &f, const scalarField &fx) const
bool validateBounds(const scalarList &p) const
Return true if all pressure data is within min/max bounds.
scalar fLower_
Lower frequency limit, default = 25Hz.
scalar gainB(const scalar f) const
B weighting as gain in dB.
scalar RBf(const scalar f) const
B weighting function.
Registry of regIOobjects.
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
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.
List< label > labelList
A List of labels.
static void check(const int retVal, const char *what)
List< instant > instantList
List of instants.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
UList< label > labelUList
A UList of labels.
List< scalar > scalarList
List of scalar.
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes).
#define FOAM_DEPRECATED_FOR(since, replacement)
FFTW planner information.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.