Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
23af7e43
Commit
23af7e43
authored
Dec 29, 2017
by
Andrew Heather
Browse files
ENH: FFT - removed power-of-2 constraint on number of samples
parent
6f72f345
Changes
9
Hide whitespace changes
Inline
Side-by-side
applications/utilities/postProcessing/noise/noise.C
View file @
23af7e43
...
...
@@ -74,8 +74,7 @@ Usage
}
}
// Number of samples in sampling window
// Must be a power of 2, default = 2^16 (=65536)
// Number of samples in sampling window, default = 2^16 (=65536)
N 4096;
// Write interval for FFT data, default = 1
...
...
applications/utilities/postProcessing/noise/noiseDict
View file @
23af7e43
...
...
@@ -72,8 +72,7 @@ surfaceNoiseCoeffs
// Reference density (to convert from kinematic to static pressure)
rhoRef 1.205;
// Number of samples in sampling window
// Must be a power of 2, default = 2^16 (=65536)
// Number of samples in sampling window, default = 2^16 (=65536)
N 4096; // 8192; // 4096;
// Lower frequency limit, default = 25Hz
...
...
@@ -123,8 +122,7 @@ pointNoiseCoeffs
// Reference density (to convert from kinematic to static pressure)
rhoRef 1.2;
// Number of samples in sampling window
// Must be a power of 2, default = 2^16 (=65536)
// Number of samples in sampling window, default = 2^16 (=65536)
N 4096;
// Lower frequency limit, default = 25Hz
...
...
src/randomProcesses/fft/fft.C
View file @
23af7e43
...
...
@@ -95,20 +95,6 @@ void Foam::fft::transform
transformDirection
dir
)
{
forAll
(
nn
,
idim
)
{
// Check for power of two
unsigned
int
dimCount
=
nn
[
idim
];
if
(
!
dimCount
||
(
dimCount
&
(
dimCount
-
1
)))
{
FatalErrorInFunction
<<
"number of elements in direction "
<<
idim
<<
" is not a power of 2"
<<
endl
<<
" Number of elements in each direction = "
<<
nn
<<
abort
(
FatalError
);
}
}
// Copy field into fftw containers
const
label
N
=
field
.
size
();
fftw_complex
in
[
N
],
out
[
N
];
...
...
src/randomProcesses/noise/noiseModels/noiseModel/noiseModel.C
View file @
23af7e43
...
...
@@ -206,16 +206,6 @@ bool Foam::noiseModel::read(const dictionary& dict)
dict
.
readIfPresent
(
"maxPressure"
,
maxPressure_
);
dict
.
readIfPresent
(
"outputPrefix"
,
outputPrefix_
);
// Check number of samples - must be a power of 2 for our FFT
bool
powerOf2
=
((
nSamples_
!=
0
)
&&
!
(
nSamples_
&
(
nSamples_
-
1
)));
if
(
!
powerOf2
)
{
FatalIOErrorInFunction
(
dict
)
<<
"N: Number of samples in sampling windows must be a "
<<
"power of 2"
<<
exit
(
FatalIOError
);
}
if
(
fLower_
<
0
)
{
FatalIOErrorInFunction
(
dict
)
...
...
src/randomProcesses/noise/noiseModels/noiseModel/noiseModel.H
View file @
23af7e43
...
...
@@ -66,9 +66,6 @@ Description
writeOctaves | Write octaves data | no | yes
\endtable
Note
The number of samples in the sampling window must be a power of 2
SourceFiles
noiseModel.C
...
...
src/randomProcesses/noise/noiseModels/pointNoise/pointNoise.H
View file @
23af7e43
...
...
@@ -33,8 +33,7 @@ Description
// Pressure reference
pRef 0;
// Number of samples in sampling window
// Must be a power of 2, default = 2^16 (=65536)
// Number of samples in sampling window, default = 2^16 (=65536)
N 4096;
// Lower frequency bounds
...
...
src/randomProcesses/noise/noiseModels/surfaceNoise/surfaceNoise.H
View file @
23af7e43
...
...
@@ -33,8 +33,7 @@ Description
// Pressure reference
pRef 0;
// Number of samples in sampling window
// Must be a power of 2, default = 2^16 (=65536)
// Number of samples in sampling window, default = 2^16 (=65536)
N 4096;
// Lower frequency bounds
...
...
tutorials/incompressible/pimpleFoam/LES/vortexShed/system/noiseDict-point
View file @
23af7e43
...
...
@@ -45,7 +45,7 @@ pointNoiseCoeffs
separator " ";
// Number of samples in sampling window
//
Must be a power of 2,
default = 2^16 (=65536)
// default = 2^16 (=65536)
N 4096;
rhoRef 1.205;
...
...
tutorials/incompressible/pimpleFoam/LES/vortexShed/system/noiseDict-surface
View file @
23af7e43
...
...
@@ -56,7 +56,7 @@ surfaceNoiseCoeffs
p Curle;
// Number of samples in sampling window
//
Must be a power of 2,
default = 2^16 (=65536)
// default = 2^16 (=65536)
N 1024;
rhoRef 1.205;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment