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