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

decay 2d turbulence - the initial field

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 18, 2013, 10:53
Default
  #21
New Member
 
Dhruv Mehta
Join Date: Jun 2012
Posts: 22
Rep Power: 13
anzillo is on a distinguished road
Thank you !
I will try to run it
anzillo is offline   Reply With Quote

Old   October 24, 2013, 05:50
Default
  #22
New Member
 
Dhruv Mehta
Join Date: Jun 2012
Posts: 22
Rep Power: 13
anzillo is on a distinguished road
Hello Reza

I had another question regarding the 3D field generated with Rogallo's code and would be very thankful if you could help me.

The spectrum of the velocity field that the code generates is not matching the spectrum that the velocity field is expected to have, which is also an input to the code for generating the velocity field.

There is a dampening of the spectrum by a large factor, especially at low wavenumbers. I was wondering if you would know why is this happening. I checked my code and could not find anything wrong in the formulae that I use.

Thank you.

Regards
anzillo is offline   Reply With Quote

Old   October 24, 2013, 22:14
Default
  #23
Senior Member
 
Reza
Join Date: Mar 2009
Location: Appleton, WI
Posts: 116
Rep Power: 17
triple_r is on a distinguished road
I don't remember such a difference. How are you calculating the spectrum? At higher frequencies because of aliasing you might get a bit higher energy, but can't think of a reason for a difference in lower frequencies. It was a long time ago when I was playing with DNS.
triple_r is offline   Reply With Quote

Old   December 14, 2013, 21:12
Default
  #24
New Member
 
Dhruv Mehta
Join Date: Jun 2012
Posts: 22
Rep Power: 13
anzillo is on a distinguished road
Hello Reza

I tried using the code that you gave me. It does indeed help make enforce the conjugate symmetry. However, I noticed that using ifftn (in MATLAB) with 'symmetric' defining the type of ifft, also delivers the same result.

With that done, I have a big problem. Although the velocity field is divergence free in wavenumber space, it loses its solenoidal character when the ifft is used to convert it into physical space.

Would you know why this happens or if there is a way of correcting this?

Thank you !

Kind regards
Dhruv
anzillo is offline   Reply With Quote

Old   December 15, 2013, 00:15
Default
  #25
Super Moderator
 
Praveen. C
Join Date: Mar 2009
Location: Bangalore
Posts: 342
Blog Entries: 6
Rep Power: 18
praveen is on a distinguished road
How do you compute divergence in physical space ? using finite differences will not be accurate. You have to take divergence of the spectral interpolation of the velocity field, which should then give you zero divergence upto machine precision, since it is constructed to be solenoidal in fourier space.
FMDenaro likes this.
praveen is offline   Reply With Quote

Old   December 15, 2013, 03:54
Default
  #26
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,768
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
yes, this problem is quite usual .... just think about a simulation performend in the physical space, for example an exact projection with second order discretization. You will have a diverge-free solution up to machine precision but only when the divergence of the velocity is computed on the compact stencil with central second order formula. If you try to compute the divergence using different discretizations (even higher order discretizations) you have no longer a divergence-free results.

This example explains why when the solution is divergence-free in wavenumber space you can not ensure the same result (in discrete sense) in physical space. You can try different formulas of various accuracy but you have to accept some tolerance.
FMDenaro is offline   Reply With Quote

Old   December 15, 2013, 08:22
Default
  #27
New Member
 
Dhruv Mehta
Join Date: Jun 2012
Posts: 22
Rep Power: 13
anzillo is on a distinguished road
Quote:
Originally Posted by praveen View Post
How do you compute divergence in physical space ? using finite differences will not be accurate. You have to take divergence of the spectral interpolation of the velocity field, which should then give you zero divergence upto machine precision, since it is constructed to be solenoidal in fourier space.

Hello Praveen

Thank you for your reply. However, I still did not understand whether it converting Rogallo's spectral field into a divergence free field in physical space is possible or not.

I did get zero divergence in spectral space using kx*u + ky*v + kz*w, you mean that is all I can get?

Thanks again !

Regards
Dhruv
anzillo is offline   Reply With Quote

Old   December 15, 2013, 10:16
Default
  #28
Senior Member
 
Reza
Join Date: Mar 2009
Location: Appleton, WI
Posts: 116
Rep Power: 17
triple_r is on a distinguished road
They are mathematically equal. So divergence free-ness in physical space, means kx ux+ky uy+kz uz = 0 in the Fourier space. But this doesn't mean they are numerically the same. For example, if you calculate du/dx in physical space by central difference with a grid size of h, then the equivalent wave-form will have a k of sin(kh)/h. So, if you want your physical space to be divergence-free with central difference, then you should have:

sin(k_x h)/h u_x+sin(k_y h)/h u_y+sin(k_z h)/h u_z=0

in Fourier space.

Last edited by triple_r; December 15, 2013 at 10:17. Reason: typo
triple_r is offline   Reply With Quote

Old   December 15, 2013, 10:39
Default
  #29
New Member
 
Dhruv Mehta
Join Date: Jun 2012
Posts: 22
Rep Power: 13
anzillo is on a distinguished road
Thank you very much
I will try to edit the code to satisfy the 'sine' condition you mentioned.
anzillo is offline   Reply With Quote

Old   December 15, 2013, 10:44
Default
  #30
Senior Member
 
Reza
Join Date: Mar 2009
Location: Appleton, WI
Posts: 116
Rep Power: 17
triple_r is on a distinguished road
That is a work-around though. And it just converts your spectral code to a central finite difference code.
triple_r is offline   Reply With Quote

Old   December 15, 2013, 10:47
Default
  #31
New Member
 
Dhruv Mehta
Join Date: Jun 2012
Posts: 22
Rep Power: 13
anzillo is on a distinguished road
So, I can use the velocity field generated with Rogallo's code after converting it to physical space for a normal simulation?

I would then expect the field to readjust itself (to a possibly lower values of divergence) in physical space after a few turnover times after evolving in accordance with the navier stokes equation?
anzillo is offline   Reply With Quote

Old   December 15, 2013, 10:51
Default
  #32
Senior Member
 
Reza
Join Date: Mar 2009
Location: Appleton, WI
Posts: 116
Rep Power: 17
triple_r is on a distinguished road
I see. So you are not using a spectral code to solve the problem, and just need an initial velocity for your non-sectral method? If that is the case, then you can use the sine relation I gave above to get the physical velocity field that better satisfies the continuity. But you need to change the velocity field given by Rogallo as it won't be divergence-free in the sense that you are after.
triple_r is offline   Reply With Quote

Old   December 15, 2013, 10:56
Default
  #33
New Member
 
Dhruv Mehta
Join Date: Jun 2012
Posts: 22
Rep Power: 13
anzillo is on a distinguished road
Yes, I have started changing the code to satisfy

sum( sin(h*kx)/h * ux ) = 0

and obtain u,v,w in spectral space. Then I will convert these into physical space for my simulations. I know it is weird to use a physical space code for LES, but I am working with energy-conserving schemes.

Thank you again for helping me with this
anzillo is offline   Reply With Quote

Reply


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
problem with Min/max rho tH3f0rC3 OpenFOAM 8 July 31, 2019 09:48
pisoFoam - unstable pressure residual Industrial_CFD OpenFOAM Running, Solving & CFD 21 February 24, 2013 15:39
Error while running rhoPisoFoam.. nileshjrane OpenFOAM Running, Solving & CFD 8 August 26, 2010 12:50
lift and drag on ship superstructures vaina74 OpenFOAM Running, Solving & CFD 3 June 8, 2010 12:30
ForcesCoeffs ronaldo OpenFOAM 4 September 14, 2009 07:11


All times are GMT -4. The time now is 21:13.