
[Sponsors] 
July 19, 2016, 03:52 
libAcoustics, fft not calculate

#1 
New Member
A Z
Join Date: Dec 2015
Posts: 16
Rep Power: 9 
Hey,
I have a problem and some questions about the libAcoustics library. I simulate a pipeflow. 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_1time.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 1e6; 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 1e3; timeEnd 1.1e3; c0 510; dRef 1; pName p; rhoName none; rhoRef 0.4097; observers { microphoneA { position (3.8 0.1 0); pRef 2.0e5; fftFreq 1024; } } } } Thank you. Best, Adrian 

July 21, 2016, 02:05 

#3 
New Member
A Z
Join Date: Dec 2015
Posts: 16
Rep Power: 9 

July 21, 2016, 04:02 

#4 
Member

Yes, it's included but libfftw.so also should present in proper location
__________________
practice makes perfect 

July 21, 2016, 04:32 

#5  
New Member
A Z
Join Date: Dec 2015
Posts: 16
Rep Power: 9 
Quote:
Now its working, I have nothing change only the number of iteration / time steps. Need the Fourier transform a minimum number of values? 

July 21, 2016, 05:29 

#6  
Member

Quote:
__________________
practice makes perfect 

February 27, 2021, 07:19 

#8  
Member
Guanjiang Chen
Join Date: Apr 2020
Location: Bristol, United Kingdom
Posts: 49
Rep Power: 4 
Quote:
Reference pressure pRef is always set 2E5. 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 

November 3, 2021, 01:05 

#9  
New Member
Ammad
Join Date: Aug 2021
Posts: 8
Rep Power: 3 
Quote:
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 

November 3, 2021, 05:14 

#10 
Member
Guanjiang Chen
Join Date: Apr 2020
Location: Bristol, United Kingdom
Posts: 49
Rep Power: 4 
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 

November 4, 2021, 06:15 

#11 
New Member
Ammad
Join Date: Aug 2021
Posts: 8
Rep Power: 3 
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 

November 4, 2021, 06:30 

#12 
Member
Guanjiang Chen
Join Date: Apr 2020
Location: Bristol, United Kingdom
Posts: 49
Rep Power: 4 
Hi,
What value do you set for fftfreq? Could you share your fwh set file with me. Regards, Guanjiang 

November 4, 2021, 07:19 

#13 
New Member
Ammad
Join Date: Aug 2021
Posts: 8
Rep Power: 3 
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 

November 4, 2021, 07:41 

#14 
Member
Guanjiang Chen
Join Date: Apr 2020
Location: Bristol, United Kingdom
Posts: 49
Rep Power: 4 
Thank you for your reply.
I calculate the SPL using the fluctuation pressure in the "xxxtime.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? 

November 7, 2021, 13:15 

#15  
New Member
Ammad
Join Date: Aug 2021
Posts: 8
Rep Power: 3 
Quote:


Tags 
acoustic, fft, libacoustics 
Thread Tools  Search this Thread 
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
calculate velocity difference  helly  OpenFOAM PostProcessing  0  June 21, 2016 08:49 
calculate values for eps and k from Re or u?????  sbar  OpenFOAM PreProcessing  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 