CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   LES initial condition (https://www.cfd-online.com/Forums/fluent/33461-les-initial-condition.html)

shmhava August 29, 2012 04:59

Dear Paolo,

Thank you for your reply, I understand.
I went through your matlab code for meshing, and to be honest with you, I have no idea where to begin. How do I implement this code in fluent? First, I have to change the file name from writemesh.m to writemesh.msh, right?
Then, what should I do with the other two codes and what do I need to change in your code in order it would fit my case file? When I read the file into fluent, it gave an error message: invalid id x. (something like that).
I so envy you that you have a group to work with. I work entirely alone.

Thank you,
Hava

sbaffini August 29, 2012 05:41

Dear hava,

sorry for the lack of clearness. The files are not to be used as computational grids but are themselves a simple grid generator written in matlab, so you first need matlab to produce the grid.

All you need to do is to create a .m file with the following two calls (the files i posted were already set-up for the square channel with the sin law point distribution in the wall normal directions):

[x,y,z] = createmesh(nx,ny,nz,Lx,Ly,Lz,x0,y0,z0);
writemsh(x,y,z,file_name);

Here nx, ny and nz are the number of grid nodes (cells+1) in the three directions; Lx, Ly and Lz are the domain dimensions in the three directions and x0, y0 and z0 are the starting positions of the domain. Considering that in the files it is assumed that the stream-wise direction is x, this is the .m file i would use in your case:

file_name=mypath/mygrid.msh;
H=1;
Lx=6.4*H; Ly=H; Lz=H;
x0=0; y0=-H/2; z0=-H/2;
[x,y,z] = createmesh(97,65,65,Lx,Ly,Lz,x0,y0,z0);
writemsh(x,y,z,file_name);

Hope it is more clear now

shmhava August 29, 2012 06:37

sorry again, but when you say: file_name=mypath/mygrid.msh; what exactly do you mean? for example: file_name=C:\Documents and Settings\shmhava\Desktop\/mygrid.msh ? it doesn't work. Does it create a msh file or .m file?

sbaffini August 29, 2012 06:42

Try simply with:

file_name='mygrid.msh'; (sorry, i forgot the single quotes)

What i wrote above (previous post) has to be written in a .m file. When it is launched in matlab (the .m files i posted, together with this one, have to be in your working directory) it will produce (in the same directory) the file mygrid.msh, which is the grid you have to use in Fluent (as it was produced by gambit).

shmhava August 29, 2012 08:00

Thank you so much!!!! it's working.

Now, I have one more question: How did you start your calculation? the thing I did in previous calculations was first to calculate the flow using steady k-e,realizable, enhanced wall treatment model until convergence, then I used the command "solve/initialize/init-instantaneous-vel" to produce fluctuations and then I switched the viscosity model to LES.

sbaffini August 29, 2012 11:35

That's exactly the same procedure i used too. Sometimes i had to temporarily switch to the unbounded central scheme just to avoid relaminarization in the first time instants of the flow, then i switched back to the bounded scheme.

shmhava August 29, 2012 15:28

Dear Paolo,

Thanks again for you help.
How do you know when your calculation has reached the statistically steady state, and then you can turn on the "data sampling for time statistics"?

sbaffini August 29, 2012 16:58

There is not unique answer on this, in the sense that different people tend to use different indicators. I usually monitor the volume average of the kinetic energy (e.g. velocity magnitude squared) over the whole domain; when it is clearly oscillating around a steady mean value then i start collecting statistics until they are, to a certain extent (also according to the personal taste), converged.

shmhava September 5, 2012 09:50

Dear Paolo,

I wanted to thank you a lot for your help. My simulation now works much better than my previous ones (although, I get skin friction coefficient smaller than expected from the literature by 6-7%). Now, I added heat transfer to the problem, and I get Nusselt number of 11% smaller than the value predicted from a known correlation. Do you have any suggestions of how to improve my results?

Thanks again,
Hava

sbaffini September 6, 2012 04:17

Dear hava,

compared to the skin friction value you cited before, i got a 5% error which is comparable to your results. The difference may probably be due to the statistical difference in the samples used for the statistics (including, maybe, the total number of time steps used).

Initially we also had the idea to include heat transfer in our calculations but, as we were more concerned on several other effects, we didn't to save computational time. I have a very limited experience with heat transfer and LES in Fluent, it being limited to the case of bluff body flows (where the near wall small scale phenomena are much less important than in straight channels/ducts).

I can suggest the use of a dynamic model for the turbulent heat flux modelling and, if available, the comparison with a DNS reference instead of a correlation (or experimental data in general, whose uncertainties have to be carefully considered).

More generally, an 11% discrepancy might not be that bad.


All times are GMT -4. The time now is 14:18.