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())
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void append(const T &val)
Copy append an element to the end of this list.
virtual const fileName & fName() const
Return const access to the file name.
virtual tmp< scalarField > x() const
Return the reference values.
virtual tmp< Field< Type > > y() const
Return the dependent values.
void transfer(List< T > &list)
Transfer the contents of the argument List into this list and annul the argument list.
void resize(const label len)
Adjust allocated size of list.
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.
T & first()
Access first element of the list, position [0].
void size(const label n)
Older name for setAddressableSize.
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
static fileName envGlobalPath()
Global case (directory) from environment variable.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A class for handling file names.
static std::string stem(const std::string &str)
Return the basename, without extension.
static bool isAbsolute(const std::string &str)
Return true if filename starts with a '/' or '\' or (windows-only) with a filesystem-root.
fileName baseFileDir() const
Return the base directory for output.
virtual autoPtr< OFstream > newFile(const fileName &fName) const
Return autoPtr to a new file using file name.
const objectRegistry & fileObr_
Reference to the region objectRegistry.
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 rhoRef_
Reference density (to convert from kinematic to static pressure).
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].
scalar fUpper_
Upper frequency limit, default = 10kHz.
tmp< Foam::scalarField > PSD(const scalarField &PSDf) const
PSD [dB/Hz].
bool writePSD_
Write PSD; default = yes.
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.
noiseModel(const noiseModel &)=delete
No copy construct.
tmp< scalarField > SPL(const scalarField &Prms2, const scalar f) const
SPL [dB].
autoPtr< windowModel > windowModelPtr_
Window model.
static const Enum< weightingType > weightingTypeNames_
bool writeSPL_
Write SPL; default = yes.
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.
weightingType SPLweighting_
Weighting.
scalar checkUniformTimeStep(const scalarList ×) const
Check and return uniform time step.
bool writePSDf_
Write PSDf; default = yes.
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 startTime_
Start time, default = 0s.
scalar sampleFreq_
Prescribed sample frequency.
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.
Perform noise analysis on point-based pressure data.
pointNoise(const dictionary &dict, const objectRegistry &obr, const word &name=typeName, const bool readFields=true)
Constructor.
void filterTimeData(const scalarField &t0, const scalarField &p0, scalarField &t, scalarField &p) const
void processData(const label dataseti, const Function1Types::CSV< scalar > &data)
Process the CSV data.
virtual bool read(const dictionary &dict)
Read from dictionary.
List< fileName > inputFileNames_
Input file names - optional.
virtual void calculate()
Calculate.
Registry of regIOobjects.
const Time & time() const noexcept
Return time registry.
string & expand(const bool allowEmpty=false)
Inplace expand initial tags, tildes, and all occurrences of environment variables as per stringOps::e...
Base class for windowing models.
label nSamples() const
Return the number of samples in the window.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
const volScalarField & p0
OBJstream os(runTime.globalPath()/outputName)
#define WarningInFunction
Report a warning using Foam::Warning.
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.
messageStream Info
Information stream (stdout output on master, null elsewhere).
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &f1, const label comm)
constexpr char nl
The newline '\n' character (0x0a).
#define forAll(list, i)
Loop across all elements in list.
autoPtr< OFstream > filePtr