CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

How to plot time dependent energy spectrum

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 13, 2021, 13:56
Default
  #21
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,754
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
The peak at 0 Hz is likely because you are forgetting to remove the means. You should be doing the fft of the velocity fluctuations only (which is equivalent of course to simply omitting the plot at 0 Hz).

If you are using matlab, you yourself don't need to zero-pad the data, just pass the proper arguments in the callout to the fft function which is fft(X,NFFT). NFFT is the number of frequency bins in the fft. The data (X) is automatically zero-padded if it's shorter than NFFT and truncated if it's longer than NFFT. zero padding doesn't actually do anything to the spectrum plot except that it allows the frequency bins to land on a desired number, i.e. a frequency of 30 Hz (nice and round) as opposed to 30.2312312312 Hz.
aero_head likes this.
LuckyTran is offline   Reply With Quote

Old   January 16, 2021, 09:41
Default
  #22
New Member
 
Fab
Join Date: Nov 2020
Posts: 25
Rep Power: 6
Falu is on a distinguished road
I didnt set periodic boundary conditions, so i guess the time-fft is the way to go.

Thanks LuckyTran for the remarks, i updated my script accordingly.
Falu is offline   Reply With Quote

Reply

Tags
energy, matlab, spectrum


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
[Other] Contribution a new utility: refine wall layer mesh based on yPlus field lakeat OpenFOAM Community Contributions 58 December 23, 2021 03:36
pressure in incompressible solvers e.g. simpleFoam chrizzl OpenFOAM Running, Solving & CFD 13 March 28, 2017 06:49
Stuck in a Rut- interDyMFoam! xoitx OpenFOAM Running, Solving & CFD 14 March 25, 2016 08:09
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 07:20
Upgraded from Karmic Koala 9.10 to Lucid Lynx10.04.3 bookie56 OpenFOAM Installation 8 August 13, 2011 05:03


All times are GMT -4. The time now is 22:08.