Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
noiseModel Class Referenceabstract

Base class for noise models. More...

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

Classes

struct  octaveBandInfo
 
struct  planInfo
 

Public Types

enum  weightingType {
  none, dBA, dBB, dBC,
  dBD
}
 

Public Member Functions

 TypeName ("noiseModel")
 
 declareRunTimeSelectionTable (autoPtr, noiseModel, dictionary,(const dictionary &dict),(dict))
 
 noiseModel (const dictionary &dict, const bool readFields=true)
 
virtual ~noiseModel ()=default
 
virtual bool read (const dictionary &dict)
 
virtual void calculate ()=0
 
tmp< Foam::scalarFieldPSD (const scalarField &PSDf) const
 
tmp< scalarFieldSPL (const scalarField &Prms2, const scalar f) const
 
tmp< scalarFieldSPL (const scalarField &Prms2, const scalarField &f) const
 
void cleanFFTW ()
 
void writeWeightings () const
 

Static Public Member Functions

static autoPtr< noiseModelNew (const dictionary &dict)
 

Static Public Attributes

static const Enum< weightingTypeweightingTypeNames_
 

Protected Member Functions

void readWriteOption (const dictionary &dict, const word &lookup, bool &option) const
 
scalar checkUniformTimeStep (const scalarList &times) const
 
bool validateBounds (const scalarList &p) const
 
label findStartTimeIndex (const instantList &allTimes, const scalar startTime) const
 
fileName baseFileDir (const label dataseti) const
 
tmp< scalarFielduniformFrequencies (const scalar deltaT, const bool check) const
 
tmp< scalarFieldoctaves (const scalarField &data, const scalarField &f, const labelUList &freqBandIDs) const
 
tmp< scalarFieldPf (const scalarField &p) const
 
tmp< scalarFieldmeanPf (const scalarField &p) const
 
tmp< scalarFieldRMSmeanPf (const scalarField &p) const
 
tmp< scalarFieldPSDf (const scalarField &p, const scalar deltaT) const
 
scalar RAf (const scalar f) const
 
scalar gainA (const scalar f) const
 
scalar RBf (const scalar f) const
 
scalar gainB (const scalar f) const
 
scalar RCf (const scalar f) const
 
scalar gainC (const scalar f) const
 
scalar RDf (const scalar f) const
 
scalar gainD (const scalar f) const
 

Static Protected Member Functions

static void setOctaveBands (const scalarField &f, const scalar fLower, const scalar fUpper, const scalar octave, labelList &fBandIDs, scalarField &fCentre)
 

Protected Attributes

const dictionary dict_
 
scalar rhoRef_
 
label nSamples_
 
scalar fLower_
 
scalar fUpper_
 
scalar startTime_
 
autoPtr< windowModelwindowModelPtr_
 
word graphFormat_
 
weightingType SPLweighting_
 
scalar dBRef_
 
scalar minPressure_
 
scalar maxPressure_
 
fileName outputPrefix_
 
bool writePrmsf_
 
bool writeSPL_
 
bool writePSD_
 
bool writePSDf_
 
bool writeOctaves_
 
planInfo planInfo_
 

Detailed Description

Base class for noise models.

Data is read from a dictionary, e.g.

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

outputPrefix    "test1";

SPLweighting    dBA;

// 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 ''
SPLweighting Weighting: dBA, dBB, dBC, DBD no none
dBRef Reference for dB calculation no 2e-5
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 171 of file noiseModel.H.

Member Enumeration Documentation

◆ weightingType

enum weightingType
strong
Enumerator
none 
dBA 
dBB 
dBC 
dBD 

Definition at line 175 of file noiseModel.H.

Constructor & Destructor Documentation

◆ noiseModel()

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

◆ ~noiseModel()

virtual ~noiseModel ( )
virtualdefault

Member Function Documentation

◆ readWriteOption()

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

Definition at line 156 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

Definition at line 179 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

Definition at line 213 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

Definition at line 236 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

Definition at line 255 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:

◆ uniformFrequencies()

Foam::tmp< Foam::scalarField > uniformFrequencies ( const scalar  deltaT,
const bool  check 
) const
protected

Definition at line 270 of file noiseModel.C.

References Foam::check(), Foam::endl(), f(), forAll, N(), tmp::New(), WarningInFunction, and Foam::Zero.

Referenced by surfaceNoise::calculate().

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

◆ setOctaveBands()

void setOctaveBands ( const scalarField f,
const scalar  fLower,
const scalar  fUpper,
const scalar  octave,
labelList fBandIDs,
scalarField fCentre 
)
staticprotected

Definition at line 48 of file noiseModel.C.

References DynamicList::append(), Foam::endl(), f(), Foam::flatOutput(), forAll, HashSet::insert(), Foam::pow(), DynamicList::remove(), and WarningInFunction.

Referenced by surfaceNoise::calculate().

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

◆ octaves()

Foam::tmp< Foam::scalarField > octaves ( const scalarField data,
const scalarField f,
const labelUList freqBandIDs 
) const
protected

Definition at line 307 of file noiseModel.C.

References Foam::endl(), f(), bitSet::flip(), tmp::New(), bitSet::set(), UList::size(), PackedList::size(), bitSet::sortedToc(), WarningInFunction, and Foam::Zero.

Referenced by surfaceNoise::calculate().

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

◆ Pf()

Foam::tmp< Foam::scalarField > Pf ( const scalarField p) const
protected

Definition at line 358 of file noiseModel.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::mag(), n, tmp::New(), p, Foam::constant::atomic::re, fft::realTransform1D(), and Foam::sqrt().

Here is the call graph for this function:

◆ meanPf()

Foam::tmp< Foam::scalarField > meanPf ( const scalarField p) const
protected

Definition at line 401 of file noiseModel.C.

References N(), tmp::New(), p, and Foam::Zero.

Here is the call graph for this function:

◆ RMSmeanPf()

Foam::tmp< Foam::scalarField > RMSmeanPf ( const scalarField p) const
protected

Definition at line 422 of file noiseModel.C.

References N(), p, Foam::sqr(), Foam::sqrt(), and Foam::Zero.

Referenced by surfaceNoise::calculate().

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

◆ PSDf()

Foam::tmp< Foam::scalarField > PSDf ( const scalarField p,
const scalar  deltaT 
) const
protected

Definition at line 441 of file noiseModel.C.

References Foam::average(), Foam::expressions::patchExpr::debug, Foam::endl(), N(), tmp::New(), p, Foam::Pout, Foam::sqr(), and Foam::Zero.

Referenced by surfaceNoise::calculate().

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

◆ RAf()

Foam::scalar RAf ( const scalar  f) const
protected

Definition at line 476 of file noiseModel.C.

References Foam::constant::physicoChemical::c1, Foam::constant::physicoChemical::c2, f(), Foam::sqr(), and Foam::sqrt().

Here is the call graph for this function:

◆ gainA()

Foam::scalar gainA ( const scalar  f) const
protected

Definition at line 493 of file noiseModel.C.

References f(), and Foam::log10().

Here is the call graph for this function:

◆ RBf()

Foam::scalar RBf ( const scalar  f) const
protected

Definition at line 504 of file noiseModel.C.

References Foam::constant::physicoChemical::c1, Foam::constant::physicoChemical::c2, f(), Foam::sqr(), and Foam::sqrt().

Here is the call graph for this function:

◆ gainB()

Foam::scalar gainB ( const scalar  f) const
protected

Definition at line 520 of file noiseModel.C.

References f(), and Foam::log10().

Here is the call graph for this function:

◆ RCf()

Foam::scalar RCf ( const scalar  f) const
protected

Definition at line 531 of file noiseModel.C.

References Foam::constant::physicoChemical::c1, Foam::constant::physicoChemical::c2, f(), and Foam::sqr().

Here is the call graph for this function:

◆ gainC()

Foam::scalar gainC ( const scalar  f) const
protected

Definition at line 542 of file noiseModel.C.

References f(), and Foam::log10().

Here is the call graph for this function:

◆ RDf()

Foam::scalar RDf ( const scalar  f) const
protected

Definition at line 553 of file noiseModel.C.

References f(), Foam::sqr(), and Foam::sqrt().

Here is the call graph for this function:

◆ gainD()

Foam::scalar gainD ( const scalar  f) const
protected

Definition at line 566 of file noiseModel.C.

References f(), and Foam::log10().

Here is the call graph for this function:

◆ TypeName()

TypeName ( "noiseModel"  )

◆ declareRunTimeSelectionTable()

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

◆ New()

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

Definition at line 25 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

Reimplemented in surfaceNoise, and pointNoise.

Definition at line 617 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

Implemented in surfaceNoise, and pointNoise.

◆ PSD()

Foam::tmp< Foam::scalarField > PSD ( const scalarField PSDf) const

Definition at line 706 of file noiseModel.C.

References Foam::safeLog10(), and Foam::sqr().

Referenced by surfaceNoise::calculate().

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

◆ SPL() [1/2]

Foam::tmp< Foam::scalarField > SPL ( const scalarField Prms2,
const scalar  f 
) const

Definition at line 715 of file noiseModel.C.

References Foam::abort(), f(), Foam::FatalError, FatalErrorInFunction, Foam::BitOps::none(), tmp::ref(), Foam::safeLog10(), and Foam::sqr().

Referenced by surfaceNoise::calculate().

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

◆ SPL() [2/2]

Foam::tmp< Foam::scalarField > SPL ( const scalarField Prms2,
const scalarField f 
) const

Definition at line 762 of file noiseModel.C.

References Foam::abort(), f(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::BitOps::none(), tmp::ref(), Foam::safeLog10(), and Foam::sqr().

Here is the call graph for this function:

◆ cleanFFTW()

void cleanFFTW ( )

Definition at line 820 of file noiseModel.C.

◆ writeWeightings()

void writeWeightings ( ) const

Definition at line 831 of file noiseModel.C.

References f(), and Foam::nl.

Referenced by noiseModel::noiseModel().

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

Member Data Documentation

◆ weightingTypeNames_

const Foam::Enum< Foam::noiseModel::weightingType > weightingTypeNames_
static

Definition at line 184 of file noiseModel.H.

◆ dict_

const dictionary dict_
protected

Definition at line 226 of file noiseModel.H.

Referenced by pointNoise::calculate().

◆ rhoRef_

scalar rhoRef_
protected

Definition at line 229 of file noiseModel.H.

◆ nSamples_

label nSamples_
protected

Definition at line 232 of file noiseModel.H.

◆ fLower_

scalar fLower_
protected

Definition at line 235 of file noiseModel.H.

Referenced by surfaceNoise::calculate().

◆ fUpper_

scalar fUpper_
protected

Definition at line 238 of file noiseModel.H.

Referenced by surfaceNoise::calculate().

◆ startTime_

scalar startTime_
protected

Definition at line 241 of file noiseModel.H.

Referenced by surfaceNoise::initialise().

◆ windowModelPtr_

autoPtr<windowModel> windowModelPtr_
protected

Definition at line 244 of file noiseModel.H.

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

◆ graphFormat_

word graphFormat_
protected

Definition at line 247 of file noiseModel.H.

Referenced by surfaceNoise::calculate().

◆ SPLweighting_

weightingType SPLweighting_
protected

Definition at line 250 of file noiseModel.H.

◆ dBRef_

scalar dBRef_
protected

Definition at line 253 of file noiseModel.H.

◆ minPressure_

scalar minPressure_
protected

Definition at line 259 of file noiseModel.H.

Referenced by noiseModel::validateBounds().

◆ maxPressure_

scalar maxPressure_
protected

Definition at line 262 of file noiseModel.H.

Referenced by noiseModel::validateBounds().

◆ outputPrefix_

fileName outputPrefix_
protected

Definition at line 268 of file noiseModel.H.

◆ writePrmsf_

bool writePrmsf_
protected

Definition at line 271 of file noiseModel.H.

Referenced by surfaceNoise::calculate().

◆ writeSPL_

bool writeSPL_
protected

Definition at line 274 of file noiseModel.H.

Referenced by surfaceNoise::calculate().

◆ writePSD_

bool writePSD_
protected

Definition at line 277 of file noiseModel.H.

Referenced by surfaceNoise::calculate().

◆ writePSDf_

bool writePSDf_
protected

Definition at line 280 of file noiseModel.H.

Referenced by surfaceNoise::calculate().

◆ writeOctaves_

bool writeOctaves_
protected

Definition at line 283 of file noiseModel.H.

Referenced by surfaceNoise::calculate().

◆ planInfo_

planInfo planInfo_
mutableprotected

Definition at line 289 of file noiseModel.H.

Referenced by noiseModel::noiseModel().


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