noiseModel Class Referenceabstract

Base class for noise models. More...

Inheritance diagram for noiseModel:
[legend]
Collaboration diagram for noiseModel:
[legend]

Public Member Functions

 TypeName ("noiseModel")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, noiseModel, dictionary,(const dictionary &dict),(dict))
 Run time selection table. More...
 
 noiseModel (const dictionary &dict, const bool readFields=true)
 Constructor. More...
 
virtual ~noiseModel ()=default
 Destructor. More...
 
virtual bool read (const dictionary &dict)
 Read from dictionary. More...
 
virtual void calculate ()=0
 Abstract call to calculate. More...
 

Static Public Member Functions

static autoPtr< noiseModelNew (const dictionary &dict)
 Selector. More...
 

Protected Member Functions

void readWriteOption (const dictionary &dict, const word &lookup, bool &option) const
 Helper function to read write options and provide info feedback. More...
 
scalar checkUniformTimeStep (const scalarList &times) const
 Check and return uniform time step. More...
 
bool validateBounds (const scalarList &p) const
 Return true if all pressure data is within min/max bounds. More...
 
label findStartTimeIndex (const instantList &allTimes, const scalar startTime) const
 Find and return start time index. More...
 
fileName baseFileDir (const label dataseti) const
 Return the base output directory. More...
 
 noiseModel (const noiseModel &)=delete
 No copy construct. More...
 
void operator= (const noiseModel &)=delete
 No copy assignment. More...
 

Protected Attributes

const dictionary dict_
 Copy of dictionary used for construction. More...
 
scalar rhoRef_
 Reference density (to convert from kinematic to static pressure) More...
 
label nSamples_
 Number of samples in sampling window, default = 2^16. More...
 
scalar fLower_
 Lower frequency limit, default = 25Hz. More...
 
scalar fUpper_
 Upper frequency limit, default = 10kHz. More...
 
bool customBounds_
 Flag to indicate that custom frequency bounds are being used. More...
 
scalar startTime_
 Start time, default = 0s. More...
 
autoPtr< windowModelwindowModelPtr_
 Window model. More...
 
word graphFormat_
 Graph format. More...
 
scalar minPressure_
 Min pressure value. More...
 
scalar maxPressure_
 Min pressure value. More...
 
fileName outputPrefix_
 Output file prefix, default = ''. More...
 
bool writePrmsf_
 Write Prmsf; default = yes. More...
 
bool writeSPL_
 Write SPL; default = yes. More...
 
bool writePSD_
 Write PSD; default = yes. More...
 
bool writePSDf_
 Write PSDf; default = yes. More...
 
bool writeOctaves_
 Write writeOctaves; default = yes. More...
 

Detailed Description

Base class for noise models.

Data is read from a dictionary, e.g.

rhoRef          0;
N               4096;
fl              25;
fu              25;
startTime       0;

outputPrefix    "test1";

// Optional write options dictionary
writeOptions
{
    writePrmsf  no;
    writeSPL    yes;
    writePSD    yes;
    writePSDf   no;
    writeOctaves yes;
}

where

Property Description Required Default value
rhoRef Reference density no 1
N Number of samples in sampling window no 65536 (2^16)
fl Lower frequency bounds no 25
fu Upper frequency bounds no 10000
startTime Start time no 0
outputPrefix Prefix applied to output files no ''
graphFormat Graph format no raw
writePrmsf Write Prmsf data no yes
writeSPL Write SPL data no yes
writePSD Write PSD data no yes
writePSDf Write PSDf data no yes
writeOctaves Write octaves data no yes
Source files

Definition at line 158 of file noiseModel.H.

Constructor & Destructor Documentation

◆ noiseModel() [1/2]

noiseModel ( const noiseModel )
protecteddelete

No copy construct.

◆ noiseModel() [2/2]

noiseModel ( const dictionary dict,
const bool  readFields = true 
)

Constructor.

Definition at line 160 of file noiseModel.C.

References dict, noiseModel::read(), and Foam::readFields().

Here is the call graph for this function:

◆ ~noiseModel()

virtual ~noiseModel ( )
virtualdefault

Destructor.

Member Function Documentation

◆ readWriteOption()

void readWriteOption ( const dictionary dict,
const word lookup,
bool option 
) const
protected

Helper function to read write options and provide info feedback.

Definition at line 43 of file noiseModel.C.

References dict, Foam::endl(), and Foam::Info.

Here is the call graph for this function:

◆ checkUniformTimeStep()

Foam::scalar checkUniformTimeStep ( const scalarList times) const
protected

Check and return uniform time step.

Definition at line 66 of file noiseModel.C.

References Foam::constant::electromagnetic::e, Foam::exit(), Foam::FatalError, FatalErrorInFunction, and Foam::mag().

Referenced by surfaceNoise::initialise().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ validateBounds()

bool validateBounds ( const scalarList p) const
protected

Return true if all pressure data is within min/max bounds.

Definition at line 102 of file noiseModel.C.

References Foam::endl(), forAll, noiseModel::maxPressure_, noiseModel::minPressure_, Foam::nl, p, and WarningInFunction.

Here is the call graph for this function:

◆ findStartTimeIndex()

Foam::label findStartTimeIndex ( const instantList allTimes,
const scalar  startTime 
) const
protected

Find and return start time index.

Definition at line 125 of file noiseModel.C.

References forAll, startTime, and Instant< T >::value().

Referenced by surfaceNoise::initialise().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ baseFileDir()

Foam::fileName baseFileDir ( const label  dataseti) const
protected

Return the base output directory.

Definition at line 144 of file noiseModel.C.

References argList::envGlobalPath(), Foam::name(), functionObject::outputPrefix, and Foam::type().

Referenced by surfaceNoise::calculate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

void operator= ( const noiseModel )
protecteddelete

No copy assignment.

◆ TypeName()

TypeName ( "noiseModel"  )

Runtime type information.

◆ declareRunTimeSelectionTable()

declareRunTimeSelectionTable ( autoPtr  ,
noiseModel  ,
dictionary  ,
(const dictionary &dict ,
(dict  
)

Run time selection table.

◆ New()

Foam::autoPtr< Foam::noiseModel > New ( const dictionary dict)
static

Selector.

Definition at line 32 of file noiseModelNew.C.

References dict, Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInLookup, and Foam::Info.

Here is the call graph for this function:

◆ read()

bool read ( const dictionary dict)
virtual

Read from dictionary.

Reimplemented in surfaceNoise, and pointNoise.

Definition at line 189 of file noiseModel.C.

References dict, Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, Foam::Info, windowModel::New(), Foam::nl, dictionary::readIfPresent(), and dictionary::subOrEmptyDict().

Referenced by noiseModel::noiseModel(), pointNoise::read(), and surfaceNoise::read().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ calculate()

virtual void calculate ( )
pure virtual

Abstract call to calculate.

Implemented in surfaceNoise, and pointNoise.

Member Data Documentation

◆ dict_

const dictionary dict_
protected

Copy of dictionary used for construction.

Definition at line 165 of file noiseModel.H.

Referenced by pointNoise::calculate().

◆ rhoRef_

scalar rhoRef_
protected

Reference density (to convert from kinematic to static pressure)

Definition at line 168 of file noiseModel.H.

◆ nSamples_

label nSamples_
protected

Number of samples in sampling window, default = 2^16.

Definition at line 171 of file noiseModel.H.

Referenced by surfaceNoise::calculate().

◆ fLower_

scalar fLower_
protected

Lower frequency limit, default = 25Hz.

Definition at line 174 of file noiseModel.H.

Referenced by surfaceNoise::calculate().

◆ fUpper_

scalar fUpper_
protected

Upper frequency limit, default = 10kHz.

Definition at line 177 of file noiseModel.H.

Referenced by surfaceNoise::calculate().

◆ customBounds_

bool customBounds_
protected

Flag to indicate that custom frequency bounds are being used.

Definition at line 180 of file noiseModel.H.

◆ startTime_

scalar startTime_
protected

Start time, default = 0s.

Definition at line 183 of file noiseModel.H.

Referenced by surfaceNoise::initialise().

◆ windowModelPtr_

autoPtr<windowModel> windowModelPtr_
protected

Window model.

Definition at line 186 of file noiseModel.H.

Referenced by surfaceNoise::calculate(), and surfaceNoise::initialise().

◆ graphFormat_

word graphFormat_
protected

Graph format.

Definition at line 189 of file noiseModel.H.

Referenced by surfaceNoise::calculate().

◆ minPressure_

scalar minPressure_
protected

Min pressure value.

Definition at line 195 of file noiseModel.H.

Referenced by noiseModel::validateBounds().

◆ maxPressure_

scalar maxPressure_
protected

Min pressure value.

Definition at line 198 of file noiseModel.H.

Referenced by noiseModel::validateBounds().

◆ outputPrefix_

fileName outputPrefix_
protected

Output file prefix, default = ''.

Definition at line 204 of file noiseModel.H.

◆ writePrmsf_

bool writePrmsf_
protected

Write Prmsf; default = yes.

Definition at line 207 of file noiseModel.H.

Referenced by surfaceNoise::calculate().

◆ writeSPL_

bool writeSPL_
protected

Write SPL; default = yes.

Definition at line 210 of file noiseModel.H.

Referenced by surfaceNoise::calculate().

◆ writePSD_

bool writePSD_
protected

Write PSD; default = yes.

Definition at line 213 of file noiseModel.H.

Referenced by surfaceNoise::calculate().

◆ writePSDf_

bool writePSDf_
protected

Write PSDf; default = yes.

Definition at line 216 of file noiseModel.H.

Referenced by surfaceNoise::calculate().

◆ writeOctaves_

bool writeOctaves_
protected

Write writeOctaves; default = yes.

Definition at line 219 of file noiseModel.H.

Referenced by surfaceNoise::calculate().


The documentation for this class was generated from the following files: