Base class for noise models. More...
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< noiseModel > | New (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 ×) 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< windowModel > | windowModelPtr_ |
| 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... | |
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 |
Definition at line 158 of file noiseModel.H.
|
protecteddelete |
No copy construct.
| noiseModel | ( | const dictionary & | dict, |
| const bool | readFields = true |
||
| ) |
Constructor.
Definition at line 160 of file noiseModel.C.
References dict, noiseModel::read(), and Foam::readFields().
|
virtualdefault |
Destructor.
|
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.
|
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().
|
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.
|
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().
|
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().
|
protecteddelete |
No copy assignment.
| TypeName | ( | "noiseModel" | ) |
Runtime type information.
| declareRunTimeSelectionTable | ( | autoPtr | , |
| noiseModel | , | ||
| dictionary | , | ||
| (const dictionary &dict) | , | ||
| (dict) | |||
| ) |
Run time selection table.
|
static |
Selector.
Definition at line 32 of file noiseModelNew.C.
References dict, Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInLookup, and Foam::Info.
|
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().
|
pure virtual |
Abstract call to calculate.
Implemented in surfaceNoise, and pointNoise.
|
protected |
Copy of dictionary used for construction.
Definition at line 165 of file noiseModel.H.
Referenced by pointNoise::calculate().
|
protected |
Reference density (to convert from kinematic to static pressure)
Definition at line 168 of file noiseModel.H.
|
protected |
Number of samples in sampling window, default = 2^16.
Definition at line 171 of file noiseModel.H.
Referenced by surfaceNoise::calculate().
|
protected |
Lower frequency limit, default = 25Hz.
Definition at line 174 of file noiseModel.H.
Referenced by surfaceNoise::calculate().
|
protected |
Upper frequency limit, default = 10kHz.
Definition at line 177 of file noiseModel.H.
Referenced by surfaceNoise::calculate().
|
protected |
Flag to indicate that custom frequency bounds are being used.
Definition at line 180 of file noiseModel.H.
|
protected |
Start time, default = 0s.
Definition at line 183 of file noiseModel.H.
Referenced by surfaceNoise::initialise().
|
protected |
Window model.
Definition at line 186 of file noiseModel.H.
Referenced by surfaceNoise::calculate(), and surfaceNoise::initialise().
|
protected |
|
protected |
Min pressure value.
Definition at line 195 of file noiseModel.H.
Referenced by noiseModel::validateBounds().
|
protected |
Min pressure value.
Definition at line 198 of file noiseModel.H.
Referenced by noiseModel::validateBounds().
|
protected |
Output file prefix, default = ''.
Definition at line 204 of file noiseModel.H.
|
protected |
Write Prmsf; default = yes.
Definition at line 207 of file noiseModel.H.
Referenced by surfaceNoise::calculate().
|
protected |
Write SPL; default = yes.
Definition at line 210 of file noiseModel.H.
Referenced by surfaceNoise::calculate().
|
protected |
Write PSD; default = yes.
Definition at line 213 of file noiseModel.H.
Referenced by surfaceNoise::calculate().
|
protected |
Write PSDf; default = yes.
Definition at line 216 of file noiseModel.H.
Referenced by surfaceNoise::calculate().
|
protected |
Write writeOctaves; default = yes.
Definition at line 219 of file noiseModel.H.
Referenced by surfaceNoise::calculate().