Performs FFT of pressure field to generate noise data. More...
Public Member Functions | |
noiseFFT (const scalar deltaT, const label windowSize=-1) | |
Construct from pressure field. More... | |
~noiseFFT () | |
Destructor. Cleanup/destroy plan. More... | |
void | setData (scalarList &data) |
void | setData (const fileName &pFileName, const label skip=0) |
Set the pressure data by reading from file with an optional offset. More... | |
graph | pt () const |
Return the graph of pressure as a function of time. More... | |
tmp< scalarField > | Pf (const tmp< scalarField > &pn) const |
Return the fft of the given pressure data. More... | |
graph | meanPf (const windowModel &window) const |
Return the multi-window mean fft of the complete pressure data [Pa]. More... | |
graph | RMSmeanPf (const windowModel &window) const |
Return the multi-window RMS mean fft of the complete pressure. More... | |
graph | PSDf (const windowModel &window) const |
Return the multi-window PSD (power spectral density) of the complete. More... | |
graph | PSD (const graph &gPSDf) const |
Return the PSD [dB/Hz]. More... | |
graph | octaves (const graph &g, const labelUList &freqBandIDs) const |
Generate octave data. More... | |
scalar | dbToPa (const scalar db) const |
Convert the db into Pa. More... | |
tmp< scalarField > | dbToPa (const tmp< scalarField > &db) const |
Convert the db-field into Pa. More... | |
Public Member Functions inherited from Field< scalar > | |
constexpr | Field () noexcept |
Construct null. More... | |
Field (const label len) | |
Construct given size. More... | |
Field (const label len, const scalar &val) | |
Construct given size and initial value. More... | |
Field (const label len, const zero) | |
Construct given size and initial values of zero. More... | |
Field (const Field< scalar > &fld) | |
Copy construct. More... | |
Field (const UList< scalar > &list) | |
Copy construct from UList<Type> More... | |
Field (const IndirectListBase< scalar, Addr > &list) | |
Copy construct from IndirectList. More... | |
Field (Field< scalar > &&fld) | |
Move construct from Field. More... | |
Field (List< scalar > &&list) | |
Move construct from List. More... | |
Field (DynamicList< scalar, SizeMin > &&list) | |
Move construct from DynamicList. More... | |
Field (const UList< scalar > &mapF, const labelUList &mapAddressing) | |
Construct by 1 to 1 mapping from the given field. More... | |
Field (const tmp< Field< scalar >> &tmapF, const labelUList &mapAddressing) | |
Construct by 1 to 1 mapping from the given tmp field. More... | |
Field (const UList< scalar > &mapF, const labelListList &mapAddressing, const scalarListList &weights) | |
Construct by interpolative mapping from the given field. More... | |
Field (const tmp< Field< scalar >> &tmapF, const labelListList &mapAddressing, const scalarListList &weights) | |
Construct by interpolative mapping from the given tmp field. More... | |
Field (const UList< scalar > &mapF, const FieldMapper &map, const bool applyFlip=true) | |
Construct by mapping from the given field. More... | |
Field (const UList< scalar > &mapF, const FieldMapper &map, const scalar &defaultValue, const bool applyFlip=true) | |
Construct by mapping from the given field. More... | |
Field (const UList< scalar > &mapF, const FieldMapper &map, const UList< scalar > &defaultValues, const bool applyFlip=true) | |
Construct by mapping from the given field. More... | |
Field (const tmp< Field< scalar >> &tmapF, const FieldMapper &map, const bool applyFlip=true) | |
Construct by mapping from the given tmp field. More... | |
Field (const tmp< Field< scalar >> &tmapF, const FieldMapper &map, const scalar &defaultValue, const bool applyFlip=true) | |
Field (const tmp< Field< scalar >> &tmapF, const FieldMapper &map, const UList< scalar > &defaultValues, const bool applyFlip=true) | |
Field (Field< scalar > &fld, bool reuse) | |
Copy construct or re-use as specified. More... | |
Field (const tmp< Field< scalar >> &tfld) | |
Copy or move construct from tmp. More... | |
Field (Istream &is) | |
Construct from Istream. More... | |
Field (const word &keyword, const dictionary &dict, const label len) | |
Construct from a dictionary entry. More... | |
tmp< Field< scalar > > | clone () const |
Clone. More... | |
void | map (const UList< scalar > &mapF, const labelUList &mapAddressing) |
1 to 1 map from the given field More... | |
void | map (const tmp< Field< scalar >> &tmapF, const labelUList &mapAddressing) |
1 to 1 map from the given tmp field More... | |
void | map (const UList< scalar > &mapF, const labelListList &mapAddressing, const scalarListList &weights) |
Interpolative map from the given field. More... | |
void | map (const tmp< Field< scalar >> &tmapF, const labelListList &mapAddressing, const scalarListList &weights) |
Interpolative map from the given tmp field. More... | |
void | map (const UList< scalar > &mapF, const FieldMapper &map, const bool applyFlip=true) |
Map from the given field. More... | |
void | map (const tmp< Field< scalar >> &tmapF, const FieldMapper &map, const bool applyFlip=true) |
Map from the given tmp field. More... | |
void | autoMap (const FieldMapper &map, const bool applyFlip=true) |
Map from self. More... | |
void | rmap (const UList< scalar > &mapF, const labelUList &mapAddressing) |
1 to 1 reverse-map from the given field More... | |
void | rmap (const tmp< Field< scalar >> &tmapF, const labelUList &mapAddressing) |
1 to 1 reverse-map from the given tmp field More... | |
void | rmap (const UList< scalar > &mapF, const labelUList &mapAddressing, const UList< scalar > &weights) |
Interpolative reverse map from the given field. More... | |
void | rmap (const tmp< Field< scalar >> &tmapF, const labelUList &mapAddressing, const UList< scalar > &weights) |
Interpolative reverse map from the given tmp field. More... | |
void | negate () |
Negate this field (negative). More... | |
tmp< Field< cmptType > > | component (const direction) const |
Return a component field of the field. More... | |
void | replace (const direction, const UList< cmptType > &) |
Replace a component field of the field. More... | |
void | replace (const direction, const tmp< Field< cmptType >> &) |
Replace a component field of the field. More... | |
void | replace (const direction, const cmptType &) |
Replace a component field of the field. More... | |
VSForm | block (const label start) const |
tmp< Field< scalar > > | T () const |
Return the field transpose (only defined for second rank tensors) More... | |
void | writeEntry (const word &keyword, Ostream &os) const |
Write the field as a dictionary entry. More... | |
void | operator= (const Field< scalar > &) |
Copy assignment. More... | |
void | operator= (const tmp< Field< scalar >> &) |
void | operator= (const UList< scalar > &) |
void | operator= (const SubField< scalar > &) |
void | operator= (Field< scalar > &&rhs) |
Move assignment. More... | |
void | operator= (List< scalar > &&rhs) |
void | operator= (DynamicList< scalar, SizeMin > &&rhs) |
void | operator= (const scalar &val) |
Value assignment. More... | |
void | operator= (const zero) |
void | operator= (const VectorSpace< Form, Cmpt, nCmpt > &) |
void | operator= (const tmp< Field > &rhs) |
void | operator+= (const UList< scalar > &) |
void | operator+= (const tmp< Field< scalar >> &) |
void | operator+= (const scalar &) |
void | operator-= (const UList< scalar > &) |
void | operator-= (const tmp< Field< scalar >> &) |
void | operator-= (const scalar &) |
void | operator*= (const UList< scalar > &) |
void | operator*= (const tmp< Field< scalar >> &) |
void | operator*= (const scalar &) |
void | operator/= (const UList< scalar > &) |
void | operator/= (const tmp< Field< scalar >> &) |
void | operator/= (const scalar &) |
Static Public Member Functions | |
static tmp< scalarField > | frequencies (const label N, const scalar deltaT) |
Return the FFT frequencies. More... | |
static tmp< scalarField > | PSD (const scalarField &PSDf) |
Return the PSD [dB/Hz]. More... | |
static tmp< scalarField > | SPL (const scalarField &Prms2) |
Return the SPL [dB]. More... | |
static void | octaveBandInfo (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. More... | |
Static Public Member Functions inherited from Field< scalar > | |
static const Field< scalar > & | null () |
Return nullObject reference field. More... | |
static autoPtr< Field< scalar > > | New (Istream &is) |
Return a pointer to a new Field created on freestore. More... | |
static tmp< Field< scalar > > | NewCalculatedType (const Field< Type2 > &f) |
Static Public Attributes | |
static scalar | p0 = 2e-5 |
Reference pressure. More... | |
Additional Inherited Members | |
Public Types inherited from Field< scalar > | |
typedef pTraits< scalar >::cmptType | cmptType |
Component type. More... | |
typedef SubField< scalar > | subField |
Declare type of subField. More... | |
Performs FFT of pressure field to generate noise data.
Octave-based data:
Definition at line 69 of file noiseFFT.H.
noiseFFT | ( | const scalar | deltaT, |
const label | windowSize = -1 |
||
) |
Construct from pressure field.
Definition at line 144 of file noiseFFT.C.
~noiseFFT | ( | ) |
Destructor. Cleanup/destroy plan.
Definition at line 176 of file noiseFFT.C.
|
static |
Return the FFT frequencies.
Definition at line 44 of file noiseFFT.C.
References f(), forAll, N(), tmp< T >::New(), and Foam::Zero.
Referenced by surfaceNoise::calculate().
|
static |
Return the PSD [dB/Hz].
Input PSD in [Pa^2/Hz]
Definition at line 62 of file noiseFFT.C.
References Foam::log10(), p0, and Foam::sqr().
Referenced by surfaceNoise::calculate(), and pointNoise::processData().
|
static |
Return the SPL [dB].
Input P(rms)^2 in [Pa^2]
Definition at line 68 of file noiseFFT.C.
References Foam::log10(), p0, and Foam::sqr().
Referenced by surfaceNoise::calculate(), and pointNoise::processData().
|
static |
Return a list of the frequency indices wrt f field that.
correspond to the bands limits for a given octave
Definition at line 75 of file noiseFFT.C.
References f(), forAll, and Foam::pow().
Referenced by surfaceNoise::calculate(), and pointNoise::processData().
void setData | ( | scalarList & | data | ) |
Set the pressure data
Definition at line 189 of file noiseFFT.C.
References Foam::average(), and p.
Referenced by pointNoise::processData().
void setData | ( | const fileName & | pFileName, |
const label | skip = 0 |
||
) |
Set the pressure data by reading from file with an optional offset.
Definition at line 198 of file noiseFFT.C.
References Foam::average(), IOstream::eof(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, IOstream::good(), p, and T0.
Foam::graph pt | ( | ) | const |
Return the graph of pressure as a function of time.
Definition at line 256 of file noiseFFT.C.
References forAll.
Foam::tmp< Foam::scalarField > Pf | ( | const tmp< scalarField > & | pn | ) | const |
Return the fft of the given pressure data.
Definition at line 276 of file noiseFFT.C.
References Foam::abort(), tmp< T >::clear(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::mag(), n, tmp< T >::New(), Foam::constant::atomic::re, fft::realTransform1D(), and Foam::sqrt().
Foam::graph meanPf | ( | const windowModel & | window | ) | const |
Return the multi-window mean fft of the complete pressure data [Pa].
Definition at line 323 of file noiseFFT.C.
References windowModel::apply(), f(), forAll, N(), windowModel::nSamples(), windowModel::nWindow(), and Foam::Zero.
Foam::graph RMSmeanPf | ( | const windowModel & | window | ) | const |
Return the multi-window RMS mean fft of the complete pressure.
data [Pa]
Definition at line 355 of file noiseFFT.C.
References windowModel::apply(), f(), forAll, N(), windowModel::nSamples(), windowModel::nWindow(), Foam::sqr(), Foam::sqrt(), and Foam::Zero.
Foam::graph PSDf | ( | const windowModel & | window | ) | const |
Return the multi-window PSD (power spectral density) of the complete.
pressure data [Pa^2/Hz]
Definition at line 386 of file noiseFFT.C.
References windowModel::apply(), Foam::average(), Foam::endl(), f(), forAll, N(), windowModel::nSamples(), windowModel::nWindow(), Foam::Pout, Foam::sqr(), and Foam::Zero.
Foam::graph PSD | ( | const graph & | gPSDf | ) | const |
Return the PSD [dB/Hz].
Takes PSD in [Pa^2/Hz]
Definition at line 431 of file noiseFFT.C.
References Foam::log10(), p0, Foam::sqr(), graph::x(), and graph::y().
Foam::graph octaves | ( | const graph & | g, |
const labelUList & | freqBandIDs | ||
) | const |
Generate octave data.
Definition at line 445 of file noiseFFT.C.
References Foam::endl(), f(), g, UList< T >::size(), WarningInFunction, and Foam::Zero.
Foam::scalar dbToPa | ( | const scalar | db | ) | const |
Convert the db into Pa.
Definition at line 501 of file noiseFFT.C.
References p0, and Foam::pow().
Foam::tmp< Foam::scalarField > dbToPa | ( | const tmp< scalarField > & | db | ) | const |
Convert the db-field into Pa.
Definition at line 508 of file noiseFFT.C.
References p0, and Foam::pow().
|
static |
Reference pressure.
Definition at line 109 of file noiseFFT.H.