mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Removed misleading PSD13 output
This commit is contained in:
@ -443,8 +443,7 @@ Foam::graph Foam::noiseFFT::PSD(const graph& gPSDf) const
|
||||
Foam::graph Foam::noiseFFT::octaves
|
||||
(
|
||||
const graph& g,
|
||||
const labelUList& freqBandIDs,
|
||||
bool integrate
|
||||
const labelUList& freqBandIDs
|
||||
) const
|
||||
{
|
||||
if (freqBandIDs.size() < 2)
|
||||
@ -478,8 +477,6 @@ Foam::graph Foam::noiseFFT::octaves
|
||||
|
||||
if (fb0 == fb1) continue;
|
||||
|
||||
if (integrate)
|
||||
{
|
||||
for (label freqI = fb0; freqI < fb1; ++freqI)
|
||||
{
|
||||
label f0 = f[freqI];
|
||||
@ -488,14 +485,6 @@ Foam::graph Foam::noiseFFT::octaves
|
||||
octData[bandI] += dataAve*(f1 - f0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (label freqI = fb0; freqI < fb1; ++freqI)
|
||||
{
|
||||
octData[bandI] += data[freqI];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return graph
|
||||
(
|
||||
|
||||
@ -177,8 +177,7 @@ public:
|
||||
graph octaves
|
||||
(
|
||||
const graph& g,
|
||||
const labelUList& freqBandIDs,
|
||||
bool integrate
|
||||
const labelUList& freqBandIDs
|
||||
) const;
|
||||
|
||||
//- Convert the db into Pa
|
||||
|
||||
@ -183,22 +183,8 @@ void pointNoise::processData
|
||||
// 1/3 octave data
|
||||
// ---------------
|
||||
|
||||
// PSD [Pa^2/Hz]
|
||||
graph PSD13f(nfft.octaves(PSDf, octave13BandIDs, false));
|
||||
|
||||
// Integrated PSD = P(rms)^2 [Pa^2]
|
||||
graph Prms13f2(nfft.octaves(PSDf, octave13BandIDs, true));
|
||||
|
||||
graph PSD13g
|
||||
(
|
||||
"PSD13_dB_Hz(fm)",
|
||||
"fm [Hz]",
|
||||
"PSD(fm) [dB_Hz]",
|
||||
octave13FreqCentre,
|
||||
noiseFFT::PSD(PSD13f.y())
|
||||
);
|
||||
Info<< " Creating graph for " << PSD13g.title() << endl;
|
||||
PSD13g.write(outDir, graph::wordify(PSD13g.title()), graphFormat_);
|
||||
graph Prms13f(nfft.octaves(PSDf, octave13BandIDs));
|
||||
|
||||
graph SPL13g
|
||||
(
|
||||
@ -206,7 +192,7 @@ void pointNoise::processData
|
||||
"fm [Hz]",
|
||||
"SPL(fm) [dB]",
|
||||
octave13FreqCentre,
|
||||
noiseFFT::SPL(Prms13f2.y())
|
||||
noiseFFT::SPL(Prms13f.y())
|
||||
);
|
||||
Info<< " Creating graph for " << SPL13g.title() << endl;
|
||||
SPL13g.write(outDir, graph::wordify(SPL13g.title()), graphFormat_);
|
||||
|
||||
@ -536,12 +536,10 @@ void surfaceNoise::calculate()
|
||||
bandSize = octave13BandIDs.size() - 1;
|
||||
}
|
||||
|
||||
List<scalarField> surfPSD13f(bandSize);
|
||||
List<scalarField> surfPrms13f2(bandSize);
|
||||
forAll(surfPSD13f, freqI)
|
||||
List<scalarField> surfPrms13f(bandSize);
|
||||
forAll(surfPrms13f, freqI)
|
||||
{
|
||||
surfPSD13f[freqI].setSize(nLocalFace);
|
||||
surfPrms13f2[freqI].setSize(nLocalFace);
|
||||
surfPrms13f[freqI].setSize(nLocalFace);
|
||||
}
|
||||
|
||||
const windowModel& win = windowModelPtr_();
|
||||
@ -566,17 +564,13 @@ void surfaceNoise::calculate()
|
||||
surfPSDf[i][faceI] = PSDf.y()[freqI];
|
||||
}
|
||||
|
||||
// PSD [Pa^2/Hz]
|
||||
graph PSD13f(nfft.octaves(PSDf, octave13BandIDs, false));
|
||||
|
||||
// Integrated PSD = P(rms)^2 [Pa^2]
|
||||
graph Prms13f2(nfft.octaves(PSDf, octave13BandIDs, true));
|
||||
graph Prms13f(nfft.octaves(PSDf, octave13BandIDs));
|
||||
|
||||
// Store the 1/3 octave results in slot for face of surface
|
||||
forAll(surfPSD13f, freqI)
|
||||
forAll(surfPrms13f, freqI)
|
||||
{
|
||||
surfPSD13f[freqI][faceI] = PSD13f.y()[freqI];
|
||||
surfPrms13f2[freqI][faceI] = Prms13f2.y()[freqI];
|
||||
surfPrms13f[freqI][faceI] = Prms13f.y()[freqI];
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -739,70 +733,35 @@ void surfaceNoise::calculate()
|
||||
{
|
||||
fileName outDir(outDirBase/"oneThirdOctave");
|
||||
|
||||
scalarField PSDfAve(surfPSD13f.size(), Zero);
|
||||
scalarField Prms13f2Ave(surfPSD13f.size(), Zero);
|
||||
scalarField PSDfAve(surfPrms13f.size(), Zero);
|
||||
scalarField Prms13fAve(surfPrms13f.size(), Zero);
|
||||
|
||||
forAll(surfPSD13f, i)
|
||||
forAll(surfPrms13f, i)
|
||||
{
|
||||
PSDfAve[i] = writeSurfaceData
|
||||
(
|
||||
outDir,
|
||||
fNameBase,
|
||||
"PSD13f",
|
||||
octave13FreqCentre[i],
|
||||
surfPSD13f[i],
|
||||
procFaceOffset,
|
||||
writeOctaves_
|
||||
);
|
||||
writeSurfaceData
|
||||
(
|
||||
outDir,
|
||||
fNameBase,
|
||||
"PSD13",
|
||||
octave13FreqCentre[i],
|
||||
noiseFFT::PSD(surfPSD13f[i]),
|
||||
procFaceOffset,
|
||||
writeOctaves_
|
||||
);
|
||||
writeSurfaceData
|
||||
(
|
||||
outDir,
|
||||
fNameBase,
|
||||
"SPL13",
|
||||
octave13FreqCentre[i],
|
||||
noiseFFT::SPL(surfPrms13f2[i]),
|
||||
noiseFFT::SPL(surfPrms13f[i]),
|
||||
procFaceOffset,
|
||||
writeOctaves_
|
||||
);
|
||||
|
||||
Prms13f2Ave[i] =
|
||||
surfaceAverage(surfPrms13f2[i], procFaceOffset);
|
||||
Prms13fAve[i] =
|
||||
surfaceAverage(surfPrms13f[i], procFaceOffset);
|
||||
}
|
||||
|
||||
if (Pstream::master())
|
||||
{
|
||||
graph PSD13g
|
||||
(
|
||||
"Average PSD13_dB_Hz(fm)",
|
||||
"fm [Hz]",
|
||||
"PSD(fm) [dB_Hz]",
|
||||
octave13FreqCentre,
|
||||
noiseFFT::PSD(PSDfAve)
|
||||
);
|
||||
PSD13g.write
|
||||
(
|
||||
outDir,
|
||||
graph::wordify(PSD13g.title()),
|
||||
graphFormat_
|
||||
);
|
||||
|
||||
graph SPL13g
|
||||
(
|
||||
"Average SPL13_dB(fm)",
|
||||
"fm [Hz]",
|
||||
"SPL(fm) [dB]",
|
||||
octave13FreqCentre,
|
||||
noiseFFT::SPL(Prms13f2Ave)
|
||||
noiseFFT::SPL(Prms13fAve)
|
||||
);
|
||||
SPL13g.write
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user