81 <<
"Currently only to be called from master process..." <<
endl;
85 Info<<
"Reading data file: " 88 const word fNameBase(data.
fName().stem());
94 Info<<
" read " << t.size() <<
" values" <<
nl <<
endl;
98 Info<<
"No noise data generated" <<
endl;
102 Info<<
"Creating noise FFT" <<
endl;
104 const scalar deltaT =
118 const scalar deltaf = 1.0/(deltaT*win.nSamples());
119 const fileName outDir(
baseFileDir(dataseti)/fNameBase);
147 Info<<
" Writing " <<
os.relativeName() <<
endl;
159 Info<<
" Writing " <<
os.relativeName() <<
endl;
171 Info<<
" Writing " <<
os.relativeName() <<
endl;
206 Info<<
" Writing " <<
os.relativeName() <<
endl;
218 SPL(Prms13f, octave13FreqCentre)
258 if (!fName.isAbsolute())
void size(const label n)
Older name for setAddressableSize.
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &f1)
virtual void calculate()
Calculate.
void resize(const label len)
Adjust allocated size of list.
void transfer(List< T > &list)
Transfer the contents of the argument List into this list and annul the argument list.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
autoPtr< windowModel > windowModelPtr_
Window model.
pointNoise(const dictionary &dict, const objectRegistry &obr, const word &name=typeName, const bool readFields=true)
Constructor.
bool writeOctaves_
Write writeOctaves; default = yes.
constexpr char nl
The newline '\n' character (0x0a)
virtual bool read(const dictionary &dict)
Read from dictionary.
T & first()
Access first element of the list, position [0].
Ostream & endl(Ostream &os)
Add newline and flush stream.
fileName relativePath(const fileName &input, const bool caseTag=false) const
Return the input relative to the globalPath by stripping off a leading value of the globalPath...
virtual autoPtr< OFstream > newFile(const fileName &fName) const
Return autoPtr to a new file using file name.
bool validateBounds(const scalarList &p) const
Return true if all pressure data is within min/max bounds.
defineTypeNameAndDebug(pointNoise, 0)
bool writePrmsf_
Write Prmsf; default = yes.
Macros for easy insertion into run-time selection tables.
scalar startTime_
Start time, default = 0s.
scalar rhoRef_
Reference density (to convert from kinematic to static pressure)
void filterTimeData(const scalarField &t0, const scalarField &p0, scalarField &t, scalarField &p) const
#define forAll(list, i)
Loop across all elements in list.
scalar fUpper_
Upper frequency limit, default = 10kHz.
scalar checkUniformTimeStep(const scalarList ×) const
Check and return uniform time step.
autoPtr< OFstream > filePtr
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.
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.
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.
const Time & time() const noexcept
Return time registry.
Perform noise analysis on point-based pressure data.
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]...
virtual tmp< scalarField > x() const
Return the reference values.
void writeFreqDataToFile(Ostream &os, const scalarField &f, const scalarField &fx) const
tmp< Foam::scalarField > PSD(const scalarField &PSDf) const
PSD [dB/Hz].
bool writeSPL_
Write SPL; default = yes.
virtual tmp< Field< Type > > y() const
Return the dependent values.
OBJstream os(runTime.globalPath()/outputName)
weightingType SPLweighting_
Weighting.
fileName baseFileDir() const
Return the base directory for output.
const dictionary dict_
Copy of dictionary used for construction.
static fileName envGlobalPath()
Global case (directory) from environment variable.
List< fileName > inputFileNames_
Input file names - optional.
#define WarningInFunction
Report a warning using Foam::Warning.
virtual const fileName & fName() const
Return const access to the file name.
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.
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
addToRunTimeSelectionTable(noiseModel, pointNoise, dictionary)
const objectRegistry & fileObr_
Reference to the region objectRegistry.
tmp< scalarField > SPL(const scalarField &Prms2, const scalar f) const
SPL [dB].
messageStream Info
Information stream (stdout output on master, null elsewhere)
bool writePSD_
Write PSD; default = yes.
List< label > labelList
A List of labels.
Registry of regIOobjects.
void processData(const label dataseti, const Function1Types::CSV< scalar > &data)
Process the CSV data.
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.
const volScalarField & p0
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.
Base class for noise models.