CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   LES of turbulent channel flows (https://www.cfd-online.com/Forums/openfoam-solving/57889-les-turbulent-channel-flows.html)

Elham September 7, 2016 03:36

Quote:

Originally Posted by cedric_duprat (Post 616716)
Dear Elham,

You should have a look at the postChannel tool in applications/utilities/postProcessing/miscellaneous/postChannel
http://cpp.openfoam.org/v4/a04646.html

"
Post-processes data from channel flow calculations.
Original source file postChannel.C
For each time: calculate: txx, txy,tyy, txy, eps, prod, vorticity, enstrophy and helicity. Assuming that the mesh is periodic in the x and z directions, collapse Umeanx, Umeany, txx, txy and tyy to a line and print them as standard output.
"
I guess you'll find a usage of this tool in the tutorial related to channelFlow.


Best Regards,


Cedric

Dear Cedric,

I am still wondering what Txx, Txy, Tyx and Tyx are and how they relate to u_tau and y+. I used postChannel utility and it just created k, pPrime2Mean, u, Uf, uv, v and w files in graph folder. I do not have Txx , ...?
I will appreciate if you give me more clue.

Cheers,

Elham

cedric_duprat September 7, 2016 03:58

Dear Elham,

I don't know. OpenFoam is an opensource code and usually, postProcessing tools are not that hard to understand even for beginners.

Therefore, if you have a look at the source code of postChannel (source), you'll see in readFields.H that all the fields you had created had been read.

if you have a look at the source code, you'll also see that Txx, ... are calculated (not read). Hence, if you have a look in calculateFields.H, you'll see that the calculation is commented (that's why you don't have them output I guess). The formula used to calculate them is straightforward looking at the source code.

Best regards,

Cedric

tiam September 7, 2016 05:16

Quote:

Originally Posted by Elham (Post 616885)
Dear Cedric,

I am still wondering what Txx, Txy, Tyx and Tyx are and how they relate to u_tau and y+. I used postChannel utility and it just created k, pPrime2Mean, u, Uf, uv, v and w files in graph folder. I do not have Txx , ...?
I will appreciate if you give me more clue.

Cheers,

Elham

Hi!

You might want to try this utility I wrote.
https://bitbucket.org/lesituu/postchannelflow
It is pretty much the same as the one included in OF, but it lets you choose the fields you want to average, and also averages along the bottom and top patches.
There is a example-dictionary included.

Regarding y+. The function objects included in my controlDicts are mainly for looking and at how things go at run-time. I left them thremostly to showcase what one can do with swak, since it is always nice with more examples.
I think the best way to calculate y+ is to get the average profile of uMean using postChannelFlow and the compute the it directly.

Best,
Timofey

Elham September 8, 2016 23:36

The way that I calculate y+ and utau
 
Dear all,

After all my attempts to understand how to calculate utau and y+. I resulted to the following relations. Please correct me if you find any problem:

As dpw/dp is constant in a fully turbulent channel, by spacial averaging we can have it. I used foamCalc utility to have Grad p and then used sampleDict on wall to have dpw/dx.
utau= sqrt(h/2ro*dpw/dx)
h is the channel width.
So utau is a constant value.
y+=utau*y/nu
I am not sure about the method I used to calculate gradp. Please let me know if it is not correct.

Regards,

Elham

Elham September 9, 2016 01:37

postChannelFlow utility
 
Quote:

Originally Posted by tiam (Post 616914)
Hi!

You might want to try this utility I wrote.
https://bitbucket.org/lesituu/postchannelflow
It is pretty much the same as the one included in OF, but it lets you choose the fields you want to average, and also averages along the bottom and top patches.
There is a example-dictionary included.

Regarding y+. The function objects included in my controlDicts are mainly for looking and at how things go at run-time. I left them thremostly to showcase what one can do with swak, since it is always nice with more examples.
I think the best way to calculate y+ is to get the average profile of uMean using postChannelFlow and the compute the it directly.

Best,
Timofey

Dear Timofey,

I used R utility to have Reynolds Stress components and utilised postChannelFlow utility that you made to collapse it. It works well.

Thanks.

Cheers,

Elham

tiam September 9, 2016 05:43

Quote:

Originally Posted by Elham (Post 617196)
Dear all,

After all my attempts to understand how to calculate utau and y+. I resulted to the following relations. Please correct me if you find any problem:

As dpw/dp is constant in a fully turbulent channel, by spacial averaging we can have it. I used foamCalc utility to have Grad p and then used sampleDict on wall to have dpw/dx.
utau= sqrt(h/2ro*dpw/dx)
h is the channel width.
So utau is a constant value.
y+=utau*y/nu
I am not sure about the method I used to calculate gradp. Please let me know if it is not correct.

Regards,

Elham

I usually just use the mean streamwise velocity profile. Then you can get
u_tau = sqrt(nu*U[1]/y[1]), where by [1] I mean the first cell-centre.
It is just easier :).

Elham September 13, 2016 23:25

Quote:

Originally Posted by tiam (Post 617247)
I usually just use the mean streamwise velocity profile. Then you can get
u_tau = sqrt(nu*U[1]/y[1]), where by [1] I mean the first cell-centre.
It is just easier :).

Dear Timofey,

I have calculated y+ in the way you used, u_tau=sqrt(nu*U[1]/y[1]) but the value of y+ for the first cell, 3.3221, is much bigger than that I have got by using yPlusLES utility, 0.261426. What is wrong about my calculation?

Cheers,

Elham

tiam September 14, 2016 05:23

Quote:

Originally Posted by Elham (Post 617799)
Dear Timofey,

I have calculated y+ in the way you used, u_tau=sqrt(nu*U[1]/y[1]) but the value of y+ for the first cell, 3.3221, is much bigger than that I have got by using yPlusLES utility, 0.261426. What is wrong about my calculation?

Cheers,

Elham

yPlusLES uses the instanteneous velocity field U.

anishtain4 September 14, 2016 14:09

Elham,

Can you tell us which version of OF you are using? yPlusLES has been deprecated for a while now. To have the mean y+, simply change the U to Utmp, UMean to U, run yPlus utility and then rename them back.
You can also use this method to calculate wallGradU if you need to calculate wall shear stresses.

Elham September 14, 2016 21:30

Quote:

Originally Posted by anishtain4 (Post 617888)
Elham,

Can you tell us which version of OF you are using? yPlusLES has been deprecated for a while now. To have the mean y+, simply change the U to Utmp, UMean to U, run yPlus utility and then rename them back.
You can also use this method to calculate wallGradU if you need to calculate wall shear stresses.

Dear Mehdi,

I use OpenFOAm 2.3.0.
I searched in yPlusLES code to modify it and have the mean y+ but I couldn't find any UMean to change to U as you suggested.

I have two different values for utau with different methods:

1. utau= sqrt(h/2*dpw/dx)=0.1933
I've got dpw/dx by averaging over the wall and h is the channel width.

2. utau=sqrt(nu*U0/y1)=0.5237
which U0 is the average streamwise velocity and y1 is the first cell distance from the wall.

What is your idea about the methods that I use? Which is the correct one?

Cheers,

Elham

syavash September 15, 2016 07:23

Quote:

Originally Posted by Elham (Post 617907)
Dear Mehdi,

I use OpenFOAm 2.3.0.
I searched in yPlusLES code to modify it and have the mean y+ but I couldn't find any UMean to change to U as you suggested.

I have two different values for utau with different methods:

1. utau= sqrt(h/2*dpw/dx)=0.1933
I've got dpw/dx by averaging over the wall and h is the channel width.

2. utau=sqrt(nu*U0/y1)=0.5237
which U0 is the average streamwise velocity and y1 is the first cell distance from the wall.

What is your idea about the methods that I use? Which is the correct one?

Cheers,

Elham


Hi Elham,

The second approach is the one I use and is more reliable,

In the case of fully developped channel flow, it would be best averaging in both homogenous directions to obtain UMean.

I have modified yPlusLES to account for UMean instead of instantaneous one. I can share if you are interested.

Regards,

Syavash

Elham September 15, 2016 21:59

1 Attachment(s)
Quote:

Originally Posted by syavash (Post 617964)
Hi Elham,

The second approach is the one I use and is more reliable,

In the case of fully developped channel flow, it would be best averaging in both homogenous directions to obtain UMean.

I have modified yPlusLES to account for UMean instead of instantaneous one. I can share if you are interested.

Regards,

Syavash

Dear Siavash,

It would be your kindness if you send it to my email or attach here. My email address is elham.mohammadi@postgrad.curtin.edu.au.
I let my modified channel395 case to be run. After 1920sec of simulation which took around 65 hours it is not still fully turbulent. Do you think it needs more time to get fully turbulent or there is a problem in the settings.
general graph of y has been attached:

Cheers,

Elham

Elham September 21, 2016 02:23

Time-averaged velocity profile versus instantaneous one
 
Hello guys,

Is instantaneous velocity profile, in turbulent region, much different from time-averaged one? I mean is it possible that the time averaged profile looks like a fully developed channel but the instantaneous profile not?

Cheers,

Elham

tiam September 21, 2016 10:40

Quote:

Originally Posted by Elham (Post 618706)
Hello guys,

Is instantaneous velocity profile, in turbulent region, much different from time-averaged one? I mean is it possible that the time averaged profile looks like a fully developed channel but the instantaneous profile not?

Cheers,

Elham

Yes, sure. Look at this video iwth an animation of the streamwise velocity.
https://www.youtube.com/watch?v=t_5tEqa8rYs
Obviously a profile taken along y at a given x will look totally different from the average velocity.

anishtain4 September 21, 2016 15:31

I meant just renaming UMean to U in the time directories, not anywhere in the code.
I still don't understand why you are using yPlusLES? Are you recompiling that code from previous versions?
You can also run wallGradU after renaming Umean to U, so you will get the gradient on the wall, but calculating y+ from wallGradU and yPlus utility will not always be the same!
If you take a look at the code, you'll see there's an effective viscosity involved, the turbulent viscosity is supposed to be zero in the subgrid scale (when you resolve the wall) and your formulas are also for such a case. If the first cell is further than y+=5, then your formulas won't work.

dradenkovic October 5, 2016 08:42

Hello.

Is it always necessary to average fields in LES of turbulent channel flow in for example 100 flow through times, formed with mean velocity and length of a channel? Sometimes it would take a long time to carry out this simulation if Reynolds number is high, mesh is fine and time step is small.

Does anyone have experience that, for example, 10 flow through times were enough for statistically independent results of LES in channel?

Where could I find more information on this subject?

Regards,
Darko

cedric_duprat October 5, 2016 09:20

Hi Darko,

That's a weird question .... if your calculation is converged (averaged field, 2nd order statistics, ...) after 10 iterations then, no need to do 100 (but it won't, I can bet on that).

As you said, if Reynolds number is high, mesh is fine and time step is small, then process needs lot's of time (iterations) to converge.

To reduce the time required to converge your averaged field, you need to increase the statistics which is the aim of postChannel tools or the one Timofey has developed (see upper in the thread).

I hope this will help you,

Cedric

dradenkovic October 5, 2016 12:28

I will describe my problem better.

Real dimensions of channel that I am studying are 6 meters length, 35 mm is height and 350mm is width. In my LES simulation, I was watching only part of domain, 6m x 35mm x 35mm. Mesh was dense, 830 x 108 x 52 elements. Mean velocity was 20 m/s.
For flow initialization I used perturbUChannel utility. I used Smagorinsky with vanDriest damping. I did this simulation for 4.5 seconds, that is about 15 flow through times, formed with mean velocity and length of channel.
After using postChannel utility, there is no big difference in velocity profile after 0.5 s and 4.5 s.
https://www.dropbox.com/s/vpzz8rlaud...rison.eps?dl=0

What criterion should I use in order to know when simulation has converged, when there is no big change in velocity during this small time length? Perhaps it would be bigger difference in velocity if I waited for 50 seconds or more?

Now I am doing simulation in 2m x 35 mm x 52.5 mm channel. Mesh is finer, I have 926x114x82 elements in x,y and z direction. However, I am doing 0.1 seconds per day, which is slow if I need around 100 flow through times, that is around 10 s.

Please don't tell me to use RANS.

http://www.cfd-online.com/Forums/ope...nnel-flow.html

My final goal is modeling of pneumatic conveying of dilute particle flow, but I have problems with verification of pure channel flow for relatively long time.

Any advice is highly appreciated.

Regards,
Darko

Elham October 7, 2016 01:23

exact values of velocity for each cell center
 
Dear all,

I am going to plot uPlus versus yPlus and I want to determine if the number of cells in laminar sublayer when yPlus is less than one is enough. How can I have the exact values of velocity for each cell center?

Cheers,

Elham

Elham October 17, 2016 21:52

convergence problem in LES modeling of turbulent channel flow
 
Dear Timofey,

Since I had convergence problem I mean Ux and Uy residuals were around 0.1, Ux and k were 0.01, p was 0.3 although cumulative and global residuals were O(e-8) I have put all of settings in fvSolution and fvScheme as yours in https://bitbucket.org/lesituu/channe...tem/?at=master.
But the residuals are still in the same range and the number of iterations for solving p (PCG) is nearly 270 which was around 10 by GAMG solver. What is your idea for solving the speed and convergence problem?

Cheers,

Elham


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