|
[Sponsors] |
July 25, 2017, 13:08 |
Plot the Energy Spectrum
|
#1 |
New Member
Elyas_Kermani
Join Date: Dec 2015
Location: Iran
Posts: 12
Rep Power: 11 |
Hello
I simulated a turbulent channel with (2pi,2,pi) and Re_tau=590 to evaluate dynamic smagorinsky model. I don't know how to plot the Energy spectrum! can anyone help me to plot that? Regards, Elyas |
|
July 29, 2017, 08:44 |
|
#2 |
Senior Member
Join Date: Jun 2012
Location: Germany, Bochum
Posts: 230
Rep Power: 16 |
What exactly do you mean by "energy spectrum"?
If we are talking about the energy spectral density, in general, I would take the time series of the value that you need and use Fourier Transform. From the squared FT you get the energy spectral density that you can plot over frequencies. |
|
July 29, 2017, 12:33 |
|
#3 |
New Member
Elyas_Kermani
Join Date: Dec 2015
Location: Iran
Posts: 12
Rep Power: 11 |
Hi Bazinga
Thank you for your reply. Can you tell me which type of the spectrum is common? I want to show that my results agree with the -5/3 like the following pictures. Which quantity have to extract to reach these figures. What steps should be taken to plot the best spectrum? regard |
|
July 29, 2017, 14:35 |
|
#4 |
Senior Member
Join Date: Jun 2012
Location: Germany, Bochum
Posts: 230
Rep Power: 16 |
Yes, this is a common one to plot.
You need to get time series of the velocity at each time step at the points in your channel where you want to obtain the spectrum. For this, you need to add probes* to the controlDict file. The rest is post processing these time series as very briefly explained in my first response. *You should find more than enough information on how to set up probes in the tutorials and this forum. |
|
July 30, 2017, 01:47 |
|
#5 |
New Member
Elyas_Kermani
Join Date: Dec 2015
Location: Iran
Posts: 12
Rep Power: 11 |
Thanks for your description.
Dear Bazinga I need to add probes* to the controlDict file? But I have only one week to report my thesis results and my simulations is ended. 1-Can I use the probeDict file inside the system folder instead of adding probes to the controlDict file? The legend of figures show that the energy spectral is plotted for the total resolved turbulent energy and you say I need to get time series of the velocity! 2-Which one have the best trend to -5/3?velocity or total resolved turbulent energy? Regard |
|
July 30, 2017, 02:54 |
|
#6 |
Senior Member
Join Date: Jun 2012
Location: Germany, Bochum
Posts: 230
Rep Power: 16 |
1. No. AFAIK you need to add probes before the simulation.
The way I see it it is the spectrum over the wavenumber. 2. I don't understand the question. 1 week?! Good luck. I suggest you talk to your supervisor. Sent from my SM-G950F using CFD Online Forum mobile app |
|
August 14, 2017, 12:27 |
|
#7 |
Senior Member
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22 |
Sorry for the late answer: You should be able to use the -postProcess command line option together with probes in your controlDict.
See: https://cfd.direct/openfoam/user-gui...rocessing-cli/ (the example is for simpleFoam but should work also for other solvers) I tested it for OpenFOAM 4.x and it seems to work. |
|
August 14, 2017, 14:12 |
|
#8 |
New Member
Elyas_Kermani
Join Date: Dec 2015
Location: Iran
Posts: 12
Rep Power: 11 |
Hi Joachim
Thank you for your reply. I plotted the Energy Spectrum for my new SGS model that I implemented in OpenFOAM Library. Do you think this trend is correct? Do you have any idea about that? regard |
|
March 28, 2019, 10:12 |
|
#9 |
New Member
Join Date: Jan 2017
Posts: 13
Rep Power: 9 |
Hi Elyas,
Can you please give me a guide that how you have calculated the E(k) value? Best, Ghazal |
|
March 29, 2019, 13:03 |
|
#10 |
New Member
Elyas_Kermani
Join Date: Dec 2015
Location: Iran
Posts: 12
Rep Power: 11 |
Dear Ghazal,
First, I used another version of pimpleFoam solver that is modified by Mr. Ehsan Askari. This solver writes UPrime [UPrime=(U-UMean)] for each time step. Then I extracted it for a period of time e.g. 40s with small time step (0.01s) which means I extracted the UPrime in each time step from 3200s to 3240s in my case with the probeLocations utility in four different locations. There are three components of UPrime for each location. Afterward I used this formulation [ 0.5*(POWER(X1,2)+POWER(X2,2)+POWER(X3,2))] to determine the turbulent kinetic energy value as a funtion of time. In the final step you need to transform variables to wave number environment. |
|
March 29, 2019, 13:05 |
|
#11 |
New Member
Elyas_Kermani
Join Date: Dec 2015
Location: Iran
Posts: 12
Rep Power: 11 |
Dear Ghazal,
First, I used another version of pimpleFoam solver that is modified by Mr. Ehsan Askari. This solver writes UPrime [UPrime=(U-UMean)] for each time step. Then I extracted it for a period of time e.g. 40s with small time step (0.01s) which means I extracted the UPrime in each time step from 3200s to 3240s in my case with the probeLocations utility in four different locations. There are three components of UPrime for each location. Afterward I used this formulation [ 0.5*(POWER(X1,2)+POWER(X2,2)+POWER(X3,2))] to determine the turbulent kinetic energy value as a funtion of time. In the final step you need to transform variables to wave number environment. |
|
May 13, 2019, 04:26 |
|
#12 | |
New Member
Join Date: Jan 2017
Posts: 13
Rep Power: 9 |
Quote:
Many thanks for your answer and so sorry for my late response. I also deeply appreciate if you please help me on the following questions. 1) In your answer, the variables of X1,X2,X3 are the fft(Fast Fourier Transformation) of UPrime, VPrime and WPrime? 2) In the final step, you refer to transform variables to wave numbers. Do you mean this formula? λf=c where λ is the wavelength, f is the frequency and c is the speed of sound in flow. With kind regards, Ghazaleh |
||
May 19, 2019, 03:02 |
|
#13 | |
New Member
Elyas_Kermani
Join Date: Dec 2015
Location: Iran
Posts: 12
Rep Power: 11 |
Quote:
My name is Elyas not Ehsan. 1- I used only UPrime, VPrime and WPrime for X1,X2,X3 respectively. 2- I used (2*pi*f)/(2*pi*dt) and (2*pi*dt*E(f))/(2*pi) For horizontal and vertical axis repectively. Like the following pic. Best, |
||
May 22, 2019, 06:11 |
|
#14 |
New Member
Join Date: Jan 2017
Posts: 13
Rep Power: 9 |
Hi,
Thank you for your reply. I think, in some point we need to use Fourier Transformation in order to convert time and rms of velocity into frequency and energy spectrum .. Best, Gh |
|
June 3, 2019, 14:46 |
|
#15 | |
Senior Member
Ehsan Asgari
Join Date: Apr 2010
Posts: 473
Rep Power: 18 |
Quote:
Syavash |
||
Tags |
energy spectrum, fft code, openfoam, turbulent channel |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Energy Spectrum !!! | stanking | Main CFD Forum | 107 | October 21, 2016 11:48 |
Energy Spectrum using Python | ChGr | Main CFD Forum | 0 | July 28, 2016 13:26 |
Plot values such as turbulent kinetic energy at the first grid point from the surface | eddykendo | OpenFOAM Post-Processing | 0 | July 1, 2016 06:27 |
Energy Spectrum | helly | Main CFD Forum | 4 | January 7, 2016 22:57 |
Energy spectrum from velocity histroy in time | Chang | Main CFD Forum | 1 | October 2, 2006 08:23 |