63 <<
"Cannot read file " << pFileName
69 scalar dummyt, dummyp;
71 for (
label i=0; i<skip; i++)
75 if (!pFile.
good() || pFile.
eof())
78 <<
"Number of points in file " << pFileName
79 <<
" is less than the number to be skipped = " << skip
91 while (!(pFile >> t).eof())
97 deltat_ =
T/pData.
size();
132 if ((N + ni*windowOffset) >
size())
135 <<
"Requested window is outside set of data" <<
endl 136 <<
"number of data = " <<
size() <<
endl 137 <<
"size of window = " << N <<
endl 145 label offset = ni*windowOffset;
164 scalar
T = N*deltat_;
198 Pn *= 2.0/
sqrt(scalar(tPn2().
size()));
214 <<
"Requested window is outside set of data" <<
nl 215 <<
"number of data = " <<
size() <<
nl 216 <<
"size of window = " << N <<
nl 233 scalar deltaf = 1.0/(N*deltat_);
260 <<
"Requested window is outside set of data" <<
endl 261 <<
"number of data = " <<
size() <<
endl 262 <<
"size of window = " << N <<
endl 276 RMSMeanPf =
sqrt(RMSMeanPf/nw);
279 scalar deltaf = 1.0/(N*deltat_);
323 scalar fratio =
cbrt(2.0);
324 scalar deltaf = 1.0/(2*Lf.
size()*deltat_);
326 scalar fl = f1/
sqrt(fratio);
327 scalar fu = fratio*fl;
334 scalar fmi =
sqrt(fu*fl);
336 if (fmi > fU + 1)
break;
341 ldelta[j] = 10*
log10(ldelta[j]);
349 ldelta[j] +=
pow(10, Lf[i]/10.0);
379 scalar fratio =
cbrt(2.0);
380 scalar deltaf = 1.0/(2*Pf.
size()*deltat_);
382 scalar fl = f1/
sqrt(fratio);
383 scalar fu = fratio*fl;
385 label istart =
label(fl/deltaf + 1.0 - small);
390 scalar fmi =
sqrt(fu*fl);
392 if (fmi > fU + 1)
break;
397 pdelta[j] =
sqrt((2.0/3.0)*pdelta[j]);
405 pdelta[j] +=
sqr(Pf[i]);
430 lsum +=
pow(10, Lf[i]/10.0);
433 lsum = 10*
log10(lsum);
441 return p0*
pow(10.0, db/20.0);
450 return p0*
pow(10.0, db/20.0);
noiseFFT(const scalar deltat, const scalarField &pressure)
Construct from pressure field.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A class for handling file names.
void clear() const
If object pointer points to valid object:
errorManipArg< error, int > exit(error &err, const int errNo=1)
scalar & operator[](const label)
Return element of UList.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
graph Pdelta(const graph &gLf, const scalar f1, const scalar fU) const
Return the one-third-octave-band pressure spectrum.
T & ref() const
Return non-const reference or generate a fatal error.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
const scalarField & y() const
void size(const label)
Override size to be inconsistent with allocated storage.
dimensionedScalar sqrt(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
tmp< scalarField > Pf(const tmp< scalarField > &pn) const
Return the fft of the given pressure data.
static tmp< complexField > reverseTransform(const tmp< complexField > &field, const labelList &nn)
Pre-declare related SubField type.
graph meanPf(const label N, const label nw) const
Return the multi-window mean fft of the complete pressure data.
bool good() const
Return true if next operation might succeed.
Class to create, store and output qgraph files.
tmp< scalarField > Hanning(const label N) const
Return the Hanning window function.
graph RMSmeanPf(const label N, const label nw) const
Return the multi-window RMS mean fft of the complete pressure data.
dimensionedScalar cos(const dimensionedScalar &ds)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
static scalar p0
Reference pressure.
dimensionedScalar cbrt(const dimensionedScalar &ds)
graph Ldelta(const graph &gLf, const scalar f1, const scalar fU) const
Return the one-third-octave-band PFL spectrum.
List< label > labelList
A List of labels.
bool eof() const
Return true if end of input seen.
const scalar twoPi(2 *pi)
volScalarField scalarField(fieldObject, mesh)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
complexField ReComplexField(const UList< scalar > &sf)
void setSize(const label)
Reset size of List.
graph pt() const
Return the graph of p(t)
scalar Lsum(const graph &gLf) const
Return the total PFL as the sum of Lf over all frequencies.
tmp< scalarField > window(const label N, const label n) const
Return the nth window.
tmp< Field< scalar > > T() const
Return the field transpose (only defined for second rank tensors)
dimensioned< scalar > mag(const dimensioned< Type > &)
A class for managing temporary objects.
label size() const
Return the number of elements in the UList.
dimensionedScalar log10(const dimensionedScalar &ds)
graph Lf(const graph &gPf) const
Return the narrow-band PFL (pressure-fluctuation level) spectrum.
void transfer(List< scalar > &)
Transfer the contents of the argument List into this list.
const scalarField & x() const
scalar dbToPa(const scalar db) const
Convert the db into Pa.
const dimensionedScalar e
Elementary charge.