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 Members List Search Today's Posts Mark Forums Read

Like Tree3Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 13, 2021, 12:56
Default
  #21
Senior Member
 
Lucky Tran
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 4,130
Rep Power: 50
LuckyTran 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, 08:41
Default
  #22
New Member
 
Fab
Join Date: Nov 2020
Posts: 25
Rep Power: 2
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

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


All times are GMT -4. The time now is 03:59.