CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   decay 2d turbulence - the initial field (https://www.cfd-online.com/Forums/main/113739-decay-2d-turbulence-initial-field.html)

mp121209 February 25, 2013 18:21

decay 2d turbulence - the initial field
 
I've seen some videos that demonstrates the process of 2d turbulence decay. Here are some of them:
http://www.youtube.com/watch?v=boWeyfYs2EQ
http://www.youtube.com/watch?v=pNCst5-zPEQ
http://www.youtube.com/watch?v=-fDwnyi_EkM

I want to simulate this process by using the Euler system of equations. For this goal, I must have the initial field (rho, u, w, p).

Does anyone give me some ideas about this?

Thanks for helping!

FMDenaro February 26, 2013 03:45

Quote:

Originally Posted by mp121209 (Post 410059)
I've seen some videos that demonstrates the process of 2d turbulence decay. Here are some of them:
http://www.youtube.com/watch?v=boWeyfYs2EQ
http://www.youtube.com/watch?v=pNCst5-zPEQ
http://www.youtube.com/watch?v=-fDwnyi_EkM

I want to simulate this process by using the Euler system of equations. For this goal, I must have the initial field (rho, u, w, p).

Does anyone give me some ideas about this?

Thanks for helping!

try to see in the books of Lesieur ...
just to say that if you use the inviscid flow equation, you have no decay due to dissipation. Furthermore, in 2D you can have some inverse cascade as well as you can see small vortical structures forming bigger ones (e.g., the vortex merging)

mp121209 February 26, 2013 04:12

Can you give me the link to that book you sad?
I know that there is no decay due to physical dissipation in inviscid flow, but it's impossible to neglect the grid viscosity which is mesh-dependent factor. I don't know what kind of the final field will be, I'm interested in generating the initial field to initialize the test case.
Thanks for replying!

FMDenaro February 26, 2013 04:22

http://www.amazon.com/Turbulence-Flu...der_1402064349

mp121209 February 26, 2013 05:29

OK, that book explains the theory of turbulence very good and fully. But I still need particular specifically formulas for generating the initial field to initialize a simulation case. In the book I can't find out them.

FMDenaro February 26, 2013 05:34

see also:

http://onlinelibrary.wiley.com/doi/1...d.613/abstract

in the references you will find a paper of Lesiuer describing the details

mp121209 February 26, 2013 05:57

Can you tell the name of Lesiuer's paper describing the details of turbulence initial field for numerical simulations?
I couldn't download the journal.

FMDenaro February 26, 2013 06:05

Lesieur, M. Staquet C, Le Roy P, Comte P. The mixing layer and its coherence examined from the point of
view of two-dimensional turbulence. Journal of Fluid Mechanics 1986; 192:511–534.


you cna find the case of the initialization for a 2D micing layer

mp121209 February 26, 2013 06:59

Do you know that I don't need an initial field for 2D shear layer. I need an initial field for the exactly given above examples: decay of 2D turbulence flow with vortices. I've found out some articles, which describe the initial field for some different kind of Euler equations. They used the vortex-velocity transport equations to solve the problem. With that kind of Euler equations it's possible to define the exact field for all the vortices. I use the Euler equations in FV method to solve the problem, I need the initial state for all components of the velocity. This is my problem!
Thanks for helping!

FMDenaro February 26, 2013 08:14

Quote:

Originally Posted by mp121209 (Post 410181)
Do you know that I don't need an initial field for 2D shear layer. I need an initial field for the exactly given above examples: decay of 2D turbulence flow with vortices. I've found out some articles, which describe the initial field for some different kind of Euler equations. They used the vortex-velocity transport equations to solve the problem. With that kind of Euler equations it's possible to define the exact field for all the vortices. I use the Euler equations in FV method to solve the problem, I need the initial state for all components of the velocity. This is my problem!
Thanks for helping!


if you want to simulate only the homogeneous/isotropic decay, you can simply work in the x,y plane by using the initial 1D distribution (extended in the homogeneous 2D meaning and adjusting the coefficients to satisfy the continuity contraint) described here:

On the application of congruent upwind discretizations for large eddy simulations

Authors
Andrea Aprovitola, Filippo Maria Denaro

Publication date
2004/2/10

Journal name
Journal of Computational Physics

Volume
194

Issue
1

Pages
329-343

Publisher
Academic Press

mp121209 February 26, 2013 16:25

I want to solve the problem in the x,y plane, with the limited space [LxL] and periodic boundary conditions. I need the initial with vorticies like in the above videos. But I can't find out some formulas for this purpose. I've read the article you sad, but it didn't help me.
I think that in the videos, the vortex-velocity form of the Euler equations was used. It's possible to give the exact values of vorticies at the cell centers. I use the FV approach to solve the the Euler system of equations. It's no need to have a vorticity field at the beginning time. But I need the beginning values for the velocity components.
I have read many works, but I can't find out some of them helpful for me!

AHutchison May 7, 2013 00:39

@mp121209 did you have any luck with your simulation?

triple_r May 7, 2013 10:36

I don't know if you are still interested in this or not, but you can find an initial velocity field for homogenous turbulence in the following paper:

Numerical Experiments in Homogeneous Turbulence, by Robert S. Rogallo

It is a very old NASA report and a very good reference for DNS codes, so it is available on many sites. Just google the title and you should be able to get it. I can't remember which page :-p but it was near the end of the paper. It uses Fourier transform though, so you should be prepared to take inverse FFT of a spectral distribution, just a heads up :-)

Good luck.

anzillo October 16, 2013 07:45

Hello

Thank you for the information on Rogallo's code. I would be thankful if you could tell me how can I modify the code to generate a 2D field instead of the 3D field that the code is supposed to generate.

Thank you !

triple_r October 16, 2013 09:53

Why two-dimensional? Turbulence is intrinsically three-dimensional.

Anyhow, if you want a 2D initial field, you can either generate a 3D field and apply any averaging operator on the third dimension, or just generate the 2D spectral distribution first (Rogallo's distribution makes sure, for example, continuity is satisfied, so when modifying the equations, do not just remove the third component. You'll probably need to change the remaining two components as well) and then perform a two-dimensional IFFT.

It has been very long since last I saw that paper. Let us know if you have any specific problems converting it to 2D and I might be able to help.

At the end, again, I have to emphasize the inherent three-dimensionality of turbulence.

anzillo October 16, 2013 10:18

Thank you for your response.

I agree that turbulence is 3-D in nature. However, there are few numerical tests conducted on the decay of 2-D turbulence. I just wanted to verify a 2-D code and thus required the field.

I will try what you suggested and would let you know in case it works.

Thank you again for your prompt response.

Best !

anzillo October 18, 2013 09:47

Hello Reza

I modified the code to generate a 2D field that satisfies the continuity equation in wavenumber space, i.e. kx*ux + ky*uy = 0;

The field is indeed isotropic and divergence free (to machine precision, set to 10-8) in this case. However, on taking the inverse FFT of this field, the physical fields that results is not divergence free at all.

I am making a mistake in using the inverse FFT (I use MATLAB's iffn(symmetric) ). I would be thankful if you could help me with this.

To generate the 2D field I used: u = a*ky*(1/k) i - a*kx*(1/k) j

where, sqrt( kx^2 + ky^2 ) = k, i and j are the x and y unit vectors, u here is defined in wavenumber space.

This definition of u satisfies continuity as ux/uy = -ky/kx. Also, a is a function of the desired energy spectrum as used by Rogallo. I use

a = ( E(k) / 2*pi*k)^(0.5) * e^(iota*phi)

Thank you.

Regards
Dhruv

triple_r October 18, 2013 10:07

Hi,

Multi-dimensional IFFT can be a real headache sometimes, specially when you are generating values in frequency domain and you are hoping to get a real-valued function in physical space.

I'm not familiar with MATLAB's ifftn function, so I'll take a look at that as soon as a license becomes available for me to use :-)

However, by then, are you taking care of the wrap-around? Also, if you have to give MATLAB the whole spectral response, you need to make sure it satisfies the symmetry rules to guarantee a real function in the physical domain. These symmetries mainly come from the fact that:

\hat{f}_{(-k_x, -k_y)}=\hat{f}_{(k_x, k_y)}^*

where \hat{f} is the Fourier transform of f and a^* is the conjugate of a complex number a.

Because of this symmetry and wrap-around, some on the values have to be real, for example:

\hat{f}_{-(0,0)}=\hat{f}_{(0,0)}^*\Rightarrow\hat{f}_{(0,0)}\in\Re

and you can get some specific relations for (i,j) where i and j are equal to -\frac{N}{2}, 0, \frac{N}{2}-1, where N is the size of the grid that you are using.

anzillo October 18, 2013 10:17

Hello

Thank you for the explanation. As advised, I will go through some notes on FFT.

Regards

triple_r October 18, 2013 10:44

Yeah, as I mentioned, you need to make sure the frequency-domain field that you are generating is as MATLAB describes it "conjugate symmetric". Here is an octave code that I was able to dig from my archives that makes sure the field is symmetric:

Code:

for i = 1:M
    for j = 2:N/2
        E(i, j) = temp(i, j);
        E(mod(M-i+1, M)+1, mod(N-j+1, N)+1) = conj(temp(i, j));
    end
end
for i = 2:M/2
    E(i, 1) = temp(i, 1);
    E(mod(M-i+1, M)+1, 1) = conj(temp(i, 1));
end
for i = 2:M/2
    E(i, N/2+1) = temp(i, N/2+1);
    E(mod(M-i+1, M)+1, N/2+1) = conj(temp(i, N/2+1));
end

E(1,1) = real(temp(1,1));
E(M/2+1,1) = real(temp(M/2+1,1));
E(1,N/2+1) = real(temp(1,N/2+1));
E(M/2+1,N/2+1) = real(temp(M/2+1,N/2+1));

In this code, temp is a randomly generated field of complex numbers that can come from your relations for uhat and vhat, then E is the symmetric version of temp that will result in a real function after an IFFT. I don't know if it will work as it is in MATLAB, but if there is a need for change, it should be minimal.

Hope this helps.

anzillo October 18, 2013 10:53

Thank you !
I will try to run it :)

anzillo October 24, 2013 05:50

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

triple_r October 24, 2013 22:14

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.

anzillo December 14, 2013 21:12

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

praveen December 15, 2013 00:15

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 December 15, 2013 03:54

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.

anzillo December 15, 2013 08:22

Quote:

Originally Posted by praveen (Post 466425)
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

triple_r December 15, 2013 10:16

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.

anzillo December 15, 2013 10:39

Thank you very much :)
I will try to edit the code to satisfy the 'sine' condition you mentioned.

triple_r December 15, 2013 10:44

That is a work-around though. And it just converts your spectral code to a central finite difference code.

anzillo December 15, 2013 10:47

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?

triple_r December 15, 2013 10:51

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.

anzillo December 15, 2013 10:56

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 :)


All times are GMT -4. The time now is 16:26.