
[Sponsors] 
August 29, 2012, 04:59 

#21 
New Member
hava
Join Date: Aug 2012
Posts: 11
Rep Power: 6 
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 

August 29, 2012, 05:41 

#22 
Senior Member

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 setup 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 streamwise 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 

August 29, 2012, 06:37 

#23 
New Member
hava
Join Date: Aug 2012
Posts: 11
Rep Power: 6 
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?


August 29, 2012, 06:42 

#24 
Senior Member

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

August 29, 2012, 08:00 

#25 
New Member
hava
Join Date: Aug 2012
Posts: 11
Rep Power: 6 
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 ke,realizable, enhanced wall treatment model until convergence, then I used the command "solve/initialize/initinstantaneousvel" to produce fluctuations and then I switched the viscosity model to LES. 

August 29, 2012, 11:35 

#26 
Senior Member

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.


August 29, 2012, 15:28 

#27 
New Member
hava
Join Date: Aug 2012
Posts: 11
Rep Power: 6 
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"? 

August 29, 2012, 16:58 

#28 
Senior Member

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.


September 5, 2012, 09:50 

#29 
New Member
hava
Join Date: Aug 2012
Posts: 11
Rep Power: 6 
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 67%). 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 

September 6, 2012, 04:17 

#30 
Senior Member

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. 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Forces in OF15  richard  OpenFOAM Running, Solving & CFD  167  June 18, 2016 06:04 
SLTS+rhoPisoFoam: what is rDeltaT???  nileshjrane  OpenFOAM Running, Solving & CFD  4  February 25, 2013 05:13 
MRFSimpleFOAM goes divergenced!  renyun0511  OpenFOAM Running, Solving & CFD  0  November 19, 2009 03:11 
ForcesCoeffs  ronaldo  OpenFOAM  4  September 14, 2009 07:11 
Differences between serial and parallel runs  carsten  OpenFOAM Bugs  11  September 12, 2008 11:16 