CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

libAcoustics, fft not calculate

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree4Likes
  • 1 Post By don6alfonso
  • 1 Post By don6alfonso
  • 1 Post By xCFD
  • 1 Post By xCFD

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 19, 2016, 03:52
Default libAcoustics, fft not calculate
  #1
New Member
 
A Z
Join Date: Dec 2015
Posts: 16
Rep Power: 10
don6alfonso is on a distinguished road
Hey,
I have a problem and some questions about the libAcoustics library.
I simulate a pipe-flow.

My problem is:
-the the pressure fluctuation calculate but not the fft. I just copy the testcases and modify them for my problem.

My questions:
1. what is the effect of pRef in the observers options?
2. my results CurleAnalogy_1-time.dat are not really different? Is this realistic?
3. What is the meaning of the force which is calculated in the Curle.C? need this more settings?

Here are the files from my case:

Code:
application     pisoFoam;
startFrom       latestTime;
startTime       0;
stopAt          endTime;
endTime         0.0011;
deltaT          1e-6;
writeControl    timeStep;
writeInterval   100;
purgeWrite      0;
writeFormat     ascii;
writePrecision  6;
writeCompression off;
timeFormat      general;
timePrecision   6;
runTimeModifiable true;

functions
{

    CurleAnalogy_1
    {
    functionObjectLibs     ("libAcoustics.so");
    
    type                       Curle;
    log                          true;
    probeFrequency        1;
    patchNames              (Wall);
    timeStart                    1e-3;
    timeEnd                     1.1e-3;
    c0                               510;
    dRef                          -1; 
    pName                      p;
    rhoName                  none;
    rhoRef                      0.4097;
    
    observers
    {
        microphone-A
        {
        position    (3.8 0.1 0);
        pRef          2.0e-5;
        fftFreq        1024;
        }
    }
    } 
 
}
I started my simulation with potentialFoam then simpleFoam and after with pisoFoam.

Thank you.
Best, Adrian
Attached Images
File Type: png pic_1.png (19.8 KB, 45 views)
Attached Files
File Type: txt boundary.txt (1.3 KB, 21 views)
File Type: txt fvSchemes.txt (1.6 KB, 15 views)
File Type: txt fvSolution.txt (2.8 KB, 12 views)
File Type: txt CurleAnalogy_1-time.txt (1.8 KB, 18 views)
guanjiang.chen likes this.
don6alfonso is offline   Reply With Quote

Old   July 20, 2016, 02:56
Default
  #2
Member
 
Ilya
Join Date: Dec 2011
Location: Russia
Posts: 97
Blog Entries: 41
Rep Power: 14
skeptik is on a distinguished road
Do you use 2.3 version?

In this case you should compile FFTW lib and ensure that it's working
__________________
practice makes perfect
skeptik is offline   Reply With Quote

Old   July 21, 2016, 02:05
Default
  #3
New Member
 
A Z
Join Date: Dec 2015
Posts: 16
Rep Power: 10
don6alfonso is on a distinguished road
Quote:
Originally Posted by skeptik View Post
Do you use 2.3 version?

In this case you should compile FFTW lib and ensure that it's working
I'm using OF 3.0.1.

I think there is it include.
don6alfonso is offline   Reply With Quote

Old   July 21, 2016, 04:02
Default
  #4
Member
 
Ilya
Join Date: Dec 2011
Location: Russia
Posts: 97
Blog Entries: 41
Rep Power: 14
skeptik is on a distinguished road
Quote:
Originally Posted by don6alfonso View Post
I'm using OF 3.0.1.

I think there is it include.
Yes, it's included but libfftw.so also should present in proper location
__________________
practice makes perfect
skeptik is offline   Reply With Quote

Old   July 21, 2016, 04:32
Default
  #5
New Member
 
A Z
Join Date: Dec 2015
Posts: 16
Rep Power: 10
don6alfonso is on a distinguished road
Quote:
Originally Posted by skeptik View Post
Yes, it's included but libfftw.so also should present in proper location
I don't know what you mean with proper location. The information in the controleDict/functions/CurleAnalogy are not enough?

Now its working, I have nothing change only the number of iteration / time steps.
Need the Fourier transform a minimum number of values?
thegauravonline likes this.
don6alfonso is offline   Reply With Quote

Old   July 21, 2016, 05:29
Default
  #6
Member
 
Ilya
Join Date: Dec 2011
Location: Russia
Posts: 97
Blog Entries: 41
Rep Power: 14
skeptik is on a distinguished road
Quote:
Originally Posted by don6alfonso View Post
I don't know what you mean with proper location. The information in the controleDict/functions/CurleAnalogy are not enough?

Now its working, I have nothing change only the number of iteration / time steps.
Need the Fourier transform a minimum number of values?
Of course. It's basic thing. May be later we will add some lines to prevent such issues
__________________
practice makes perfect
skeptik is offline   Reply With Quote

Old   August 26, 2016, 07:03
Default
  #7
Member
 
Ilya
Join Date: Dec 2011
Location: Russia
Posts: 97
Blog Entries: 41
Rep Power: 14
skeptik is on a distinguished road
Really , we have troubles in SoundObserver::fft

Now, I'm fixing it
__________________
practice makes perfect
skeptik is offline   Reply With Quote

Old   February 27, 2021, 07:19
Default
  #8
Member
 
Guanjiang Chen
Join Date: Apr 2020
Location: Bristol, United Kingdom
Posts: 54
Rep Power: 6
guanjiang.chen is on a distinguished road
Quote:
Originally Posted by don6alfonso View Post
Hey,
I have a problem and some questions about the libAcoustics library.
I simulate a pipe-flow.

My problem is:
-the the pressure fluctuation calculate but not the fft. I just copy the testcases and modify them for my problem.

My questions:
1. what is the effect of pRef in the observers options?
2. my results CurleAnalogy_1-time.dat are not really different? Is this realistic?
3. What is the meaning of the force which is calculated in the Curle.C? need this more settings?

Here are the files from my case:

Code:
application     pisoFoam;
startFrom       latestTime;
startTime       0;
stopAt          endTime;
endTime         0.0011;
deltaT          1e-6;
writeControl    timeStep;
writeInterval   100;
purgeWrite      0;
writeFormat     ascii;
writePrecision  6;
writeCompression off;
timeFormat      general;
timePrecision   6;
runTimeModifiable true;

functions
{

    CurleAnalogy_1
    {
    functionObjectLibs     ("libAcoustics.so");
    
    type                       Curle;
    log                          true;
    probeFrequency        1;
    patchNames              (Wall);
    timeStart                    1e-3;
    timeEnd                     1.1e-3;
    c0                               510;
    dRef                          -1; 
    pName                      p;
    rhoName                  none;
    rhoRef                      0.4097;
    
    observers
    {
        microphone-A
        {
        position    (3.8 0.1 0);
        pRef          2.0e-5;
        fftFreq        1024;
        }
    }
    } 
 
}
I started my simulation with potentialFoam then simpleFoam and after with pisoFoam.

Thank you.
Best, Adrian
Hi,

Reference pressure pRef is always set 2E-5. It doesn't need too much change I think.

Do you know what fftFreq means? sample frequency or nfft.

For curle method, I find the number of frequency in the result is the same with fftFreq. But for farassat method, fftFreq seems to have no effects on the result frequency.

Regards,
Guanjiang
guanjiang.chen is offline   Reply With Quote

Old   November 3, 2021, 01:05
Default
  #9
New Member
 
Ammad
Join Date: Aug 2021
Posts: 8
Rep Power: 4
xCFD is on a distinguished road
Quote:
Originally Posted by skeptik View Post
Really , we have troubles in SoundObserver::fft

Now, I'm fixing it
Hello,

i am having the same problem. my case is working fine and i am getting pressure fluc w.r.t. time but fft is not calculated. it does nothing. Did you solve this problem? do you know what we have to do to overcome this problem?

regards,
Ammad
xCFD is offline   Reply With Quote

Old   November 3, 2021, 05:14
Default
  #10
Member
 
Guanjiang Chen
Join Date: Apr 2020
Location: Bristol, United Kingdom
Posts: 54
Rep Power: 6
guanjiang.chen is on a distinguished road
Hi,

Which version do you use? I think the latest version has solved this problem. By the way, there is a question panel about libAcoustics

https://github.com/unicfdlab/libAcoustics/issues

Regards,
Guanjiang
guanjiang.chen is offline   Reply With Quote

Old   November 4, 2021, 06:15
Default
  #11
New Member
 
Ammad
Join Date: Aug 2021
Posts: 8
Rep Power: 4
xCFD is on a distinguished road
Hello,

i found the solution, actually it was due to fftfreq. i set it to the correct value and now its working perfectly.

Thank you
xCFD is offline   Reply With Quote

Old   November 4, 2021, 06:30
Default
  #12
Member
 
Guanjiang Chen
Join Date: Apr 2020
Location: Bristol, United Kingdom
Posts: 54
Rep Power: 6
guanjiang.chen is on a distinguished road
Hi,

What value do you set for fftfreq? Could you share your fwh set file with me.

Regards,
Guanjiang
guanjiang.chen is offline   Reply With Quote

Old   November 4, 2021, 07:19
Default
  #13
New Member
 
Ammad
Join Date: Aug 2021
Posts: 8
Rep Power: 4
xCFD is on a distinguished road
Actually i had a look into the source code that what is triggering fft calculations. There i found that the fftfreq should be the value after which you want to calculate fft spectrum. for eg. if you want to calculate every 100 timesteps then set fftfreq to 100.

i hope this helps
guanjiang.chen likes this.
xCFD is offline   Reply With Quote

Old   November 4, 2021, 07:41
Default
  #14
Member
 
Guanjiang Chen
Join Date: Apr 2020
Location: Bristol, United Kingdom
Posts: 54
Rep Power: 6
guanjiang.chen is on a distinguished road
Thank you for your reply.

I calculate the SPL using the fluctuation pressure in the "xxx-time.dat" file. I don't understand the FFT process of libacoustic very well. Is the fftfreq related to the frequency range of your SPL result? what decides the SPL frequency range, the time steps?
guanjiang.chen is offline   Reply With Quote

Old   November 7, 2021, 13:15
Default
  #15
New Member
 
Ammad
Join Date: Aug 2021
Posts: 8
Rep Power: 4
xCFD is on a distinguished road
Quote:
Originally Posted by guanjiang.chen View Post
Thank you for your reply.

I calculate the SPL using the fluctuation pressure in the "xxx-time.dat" file. I don't understand the FFT process of libacoustic very well. Is the fftfreq related to the frequency range of your SPL result? what decides the SPL frequency range, the time steps?
Yes fft frequency range is calculated by simulation time step. ofcourse if you are simulating with 0.0001 sec of time step then the max frequency your fft can resolve is 10000 Hz.
guanjiang.chen likes this.
xCFD is offline   Reply With Quote

Reply

Tags
acoustic, fft, libacoustics

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
calculate velocity difference helly OpenFOAM Post-Processing 0 June 21, 2016 08:49
calculate values for eps and k from Re or u????? sbar OpenFOAM Pre-Processing 5 August 16, 2010 04:10
FFT solver for Poisson equation mranji1 Main CFD Forum 1 November 16, 2009 01:12
How to calculate Torque for francis turbine manish CFX 4 March 15, 2007 02:57
fft of unsteady solution K S Chang Main CFD Forum 6 January 15, 2004 06:42


All times are GMT -4. The time now is 07:48.