Acoustic Post Processing in MATLAB for results from OpenFOAM.
Hey All,
There is this Curle analogy that is provided in post#10 http://www.cfd-online.com/Forums/ope...-openfoam.html I have successfully implemented it the provided utility and got my results in Freq Vs SPL - does anybody know how to perform 1/3 octave filtering for a data sets with Freq Vs SPL there is some information here http://www.mathworks.co.uk/help/dsp/...d-filters.html but for some reason I am not able to perform it Thanks for your time Hasan K.J |
Hi Hasan,
Sooo... what happens exactly? More specifically, when you copy-paste the instructions from the MATLAB help, does everything work as intended? Keep in mind that we are not able to see what you're seeing, unless you share it with us ;) Best regards, Bruno |
2 Attachment(s)
Hey Bruno,
wish you a happy new year now on the attached image - the graph similar to that on the left is what i am able to create from OpenFOAM, I am supposed to filter to make the one on the right !!! The codes on Matlab site that i shared, the first two graphs work on my Matlab i have 2011, I.e creating and designing the octave and 1/3 octave filters. (dunno how to use them for filtering) -but the welch function doesn't work in my Matlab i think its a newly implemented function in Matlab 2012/13 and but I don't even require welch function because it is used to calculate the SPL and frequency.I have the SPL and frequency - I have the SPL and Frequency data Sets, I just want it filtered and for some reason i am not able to make it happen i tired for 2 weeks, also posted it on Matlab forum [totally inactive forum] - I have attached the data that i am trying to filter below swell. Thanks, Hasan K.J |
Mmm... well, frequency analysis strongly depends on the sampling period of your data. In other words: what is the smallest period of time between each two data points in time in your datasets? And is that period the same between every consecutive data point?
edit: And the other question is: are you applying the 1/3 filter to the first filter or directly to the original data? |
this is going to sound weird 1200Khz I sounds a bit too high, i just rechecked my calculations in case. it is 1200Khz
edit: I am not actually getting your question - It should be applied to the first filter from what i know, i haven't successfully applied anything, my graphs are off the charts after the filtering Thanks, Hasan K.J |
Quote:
OK, then it should not be for the lack of enough data. Quote:
In this case, if you apply the 1/3 band filter to the original filter, you don't get what you want. In a diagram-like-list:
|
you are right about the Frequency the time step is 8.3 e-7s
I haven't tried paraview and with the size of my case paraview is really slow. hence i stick to MATLAB i have 3 cases and 17 sets of data per case The data i get out of openFOAM is after the FFT, what it does is gets the p' from the surface and calculates Curles and then performs FFT before delivering it to me in the form i have uploaded in Post #3. -so you mean to say if i perform 1/3 filtering for it my results would be bad ? -but the data i received is exactly similar to pic on Post #3 - the funny bit is that picture is from FLUENT and in that you just have to select 1/3 octave instead of SPL and already i was soo much time with matlab trying to figure it out. Thanks, Hasan K.J |
Hey Bruno,
my actual struggle is that I am not able to perform 1/3 filtering I am doing something drastically wrong. by any chance did u get what was going on in the matlab link ? Thanks, Hasan K.J |
I only mentioned ParaView because certain work-flow habits are inherited from it.
I don't have MATLAB to test this, so I'm not sure what each step does. And AFAIK about frequency analysis is that you must always apply the filters to the original data, not to the FFT data. One analogy is that we cannot make purified flour from a cereal that has already been completely boiled in water and is still wet. |
1 Attachment(s)
Hey Bruno,
By any chance do you know what it means by extracting SPL for delta f = 3.15 Hz in the image below ? Kind Regards, Hasan K.J |
Hi Hasan,
What a long search I did... all because you didn't provide me with all of the necessary information :rolleyes: And when it's basically explained on this paper: http://www.mb.uni-siegen.de/iftsm/fo..._etal_fn07.pdf So, first, what I found:
So... in theory, it can tell you the dB SPL for the frequencies that are a multiple of 3.125 Hz, up to 6400~12000 Hz. If it still seems strange to you, it's rather simple: the measurements are actually histograms :rolleyes: Best regards, Bruno |
1 Attachment(s)
Hey Bruno,
Thanks a lot for the trouble you went through, I know they are hardly scientific. well i knew about the mic sampling rate. - They don't explain anywhere how things are done :( then how am i supposed to learn :(. 12 days more to go 15k words and post processing left .. phewwww -the problem is when the same author performed the CFD he used a sampling rate of 100,000 HZ which is 5e-6 time steps - then he has shown his results in similar manner with ∆f =3.125 Hz (he filtered the data some how), I dunno how he managed to do that to his data that he received from the CFD - when it is necessary to sample the data in 100,000Khz to get all the fluctuations in the flow, on what basis can he filter with ∆f =3.125 Hz it is my doubt. - Any idea what i could do it to my data to get that type of filtering to my data. - coz say if Plot(1:10:end) that is plotting every 10 time steps to replicate a higher sampling rate. I will miss some important sounds right ? Kind Regards, Hasan K.J |
I was going to quote myself about the histograms... but then I remembered: if he still indicates that the sampling error is 3.125 Hz, but the sampling rate increased to 100000 Hz, then that means that he only increased the maximum frequency that can be found on the spectrum. In this case, somewhere between 25000-50000 Hz, instead of 6400-12000 Hz.
Of course, this is assuming he knows what he's doing... because least-worst-case scenario I can see is that in one paper he indicates the maximum registrable frequency, according to the microphone specifications, while on the other paper he talks about the sampling rate... Either way, I don't see any need to adjust the data from the CFD. What you might need to adjust is the way you calculated the SPL in CFD, where you should in fact use the 3.125 Hz information for binning, namely for creating an histogram... but then again, I have no idea how you calculated the SPL in CFD... |
Your absolutely right, there is no need to adjust the data at all that i acquire from the CFD nor to do the 1/3 octave for the data.
- but the 1/3 octave is a good practice for acoustic post processing is what i heard - and here since the experimental results are sampled for 3.125Hz due to the hardware restrictions, to plot my results with the experiments it would be presentable if filtered it. - but if i directly sample the data from CFD with 3.125 Hz i would miss a lot of highs and lows in the pressure fluctuation. - about SPL in CFD what we are essentially doing is using the utility i have mentioned above from that Korean openFOAM conference. what it does is uses the pressure fluctuation on the surface and uses an acoustic analogy called Curle's analogy (but there are several other analogies there like Amiets Howes and fFW-H analogies Fluent uses FW-H). This analogy calculates the pressure amplitude at a distance that you want and the good thing is you can keep this point outside the CFD domain because it uses the density of the propagation fluid and speed of sound in that fluid to calculate this pressure amplitude. we can easily calculate the SPL by 20*log10(pressureamplitude/reference pressure). -that said i dunno how to he did that 3.125 Hz filtering still lol. - I am more of an aerodynamics person dunno how got stuck with acoustics ;/ Thanks, Hasan K.J |
Quote:
since you had a glance at this paper, How do you think he performed that CFD between the wind tunnel and the C grid airfoil setup he has, has used RANS for the wind tunnel and LES for the small setup that I am trying to do. Because I am exactly trying to replicate his paper with open foam and i thought about it and went with Map Fields which has failed misarably. Thanks, Hasan |
Hi Hasan,
Quote:
Quote:
My guess is that only the flow at the entrance of the other mesh was used for the boundary conditions. Further thinking leads me to believe that the initial mesh were the two parts in a single mesh, for running the RANS simulation. Then they cut out the mesh with the airfoil and used the data from the boundaries for the LES simulation. And the paper also implies from the Figure 10.b, that the LES model has a wake that was pointing lower than the experimental data. mapFields is useless in this case, since all that matters is the boundaries... probably only the inlet matters the most. By the way, the mesh images seem to imply that the mesh was either manually created or with the assistance of a manual mesh generation GUI. Best regards, Bruno |
Hey Bruno,
Even initially i though the important bit was the only the inlet, I did a case with only inlet mapped and top and bottom as slip like 3 months ago and the results were off a lot, I managed to get the Cp results only after I used the top and bottom as inlet, Quote:
Quote:
Thanks, Regards, Hasan K.J |
Hi Hasan,
First a quick note to other readers - this thread is related to this other one: http://www.cfd-online.com/Forums/ope...-openfoam.html Now for the questions: Quote:
Quote:
Quote:
Nonetheless, there is a tutorial on OpenFOAM 2.2.2 that can give some ideas... it's the tutorial "heatTransfer/buoyantSimpleFoam/externalCoupledCavity". Using changeDictionary is another possibility, but that will only work if the two meshes are properly compatible with each other... in the sense that the order of the faces is identical. Best regards, Bruno |
All times are GMT -4. The time now is 23:44. |