Go to the documentation of this file.
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())
99 this->transfer(pData);
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;
149 pw[i] = operator[](i + offset);
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
227 MeanPf += Pf(Hwf*window(
N, wi));
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
273 RMSMeanPf +=
sqr(Pf(Hwf*window(
N, wi)));
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;
332 for (
label i = istart; i<Lf.size(); i++)
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);
388 for (
label i = istart; i<Pf.size(); i++)
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);
graph pt() const
Return the graph of p(t)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
tmp< scalarField > Hanning(const label N) const
Return the Hanning window function.
Class to create, store and output qgraph files.
A class for handling file names.
List< label > labelList
A List of labels.
#define forAll(list, i)
Loop across all elements in list.
A class for managing temporary objects.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
bool eof() const
Return true if end of input seen.
tmp< scalarField > window(const label N, const label n) const
Return the nth window.
graph RMSmeanPf(const label N, const label nw) const
Return the multi-window RMS mean fft of the complete pressure data.
complexField ReComplexField(const UList< scalar > &sf)
scalar deltat_
Time spacing of the raw data.
const scalarField & y() const
Ostream & endl(Ostream &os)
Add newline and flush stream.
const scalar twoPi(2 *pi)
const scalarField & x() const
dimensioned< scalar > mag(const dimensioned< Type > &)
scalar dbToPa(const scalar db) const
Convert the db into Pa.
Pre-declare related SubField type.
scalar Lsum(const graph &gLf) const
Return the total PFL as the sum of Lf over all frequencies.
static tmp< complexField > reverseTransform(const tmp< complexField > &field, const labelList &nn)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
dimensionedScalar log10(const dimensionedScalar &ds)
tmp< Field< Type > > T() const
Return the field transpose (only defined for second rank tensors)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
tmp< scalarField > Pf(const tmp< scalarField > &pn) const
Return the fft of the given pressure data.
graph meanPf(const label N, const label nw) const
Return the multi-window mean fft of the complete pressure data.
errorManipArg< error, int > exit(error &err, const int errNo=1)
graph Lf(const graph &gPf) const
Return the narrow-band PFL (pressure-fluctuation level) spectrum.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
static scalar p0
Reference pressure.
noiseFFT(const scalar deltat, const scalarField &pressure)
Construct from pressure field.
dimensionedScalar sqrt(const dimensionedScalar &ds)
volScalarField scalarField(fieldObject, mesh)
graph Ldelta(const graph &gLf, const scalar f1, const scalar fU) const
Return the one-third-octave-band PFL spectrum.
const dimensionedScalar e
Elementary charge.
graph Pdelta(const graph &gLf, const scalar f1, const scalar fU) const
Return the one-third-octave-band pressure spectrum.
bool good() const
Return true if next operation might succeed.
dimensionedScalar cbrt(const dimensionedScalar &ds)
void clear() const
If object pointer points to valid object:
dimensionedScalar cos(const dimensionedScalar &ds)