
[Sponsors] 
March 10, 2015, 11:10 
Addressing each Face cell in a certain Thread

#1 
New Member
Join Date: Oct 2014
Posts: 12
Rep Power: 3 
Hi Guys
Does anyone one,how can I address each face cell in a certain face thread.In other words how can I get a certain Value based on x,y,z positions ,say C=f(x,y) on a B.C. without using profiles.I just need to address my Values by postion on faces and use them for the rest of the UDF. Thank you very much in advance if you would share your infos Regards 

March 10, 2015, 16:32 

#2 
Senior Member
Join Date: Mar 2015
Posts: 468
Rep Power: 5 
You can loop over faces in a face thread using the begin_f_loop(f,t) and end_f_loop(f,t) macros. Then use F_CENTROID(x,f,t) to find the coordinate position of the face.


March 11, 2015, 03:55 

#3 
New Member
Join Date: Oct 2014
Posts: 12
Rep Power: 3 
Thank you 'e'
This is yeah very simple.Let me put it so: I want to say for example save the values in every face which is in an angular position of say 30 Degrees,then save values in cells with angular position of 31 Dgrees and so on.So The question is ,is there any way to adress a certain face among a certain face thread? Thanks in advance again 

March 11, 2015, 05:05 

#4 
Senior Member
Join Date: Nov 2013
Posts: 739
Rep Power: 10 
How I would do it:
Go through all cells, using the begin_f_loop(f,t) and end_f_loop(f,t) macros. Calculate the angular position of your cell. If angle=30, save info in "info30.dat". If angle=31, save info in "info31.dat", and so on. Do this for all cells. 

March 12, 2015, 05:44 

#5 
New Member
Join Date: Oct 2014
Posts: 12
Rep Power: 3 
Thank you very much Pakk
This is a good idea ,but I just want to mention that I have about 200000 face cells and more that 2000 time steps.So It's not practical to do so. I want to tell the Fluent go and give me the value of say Temperature of the face which has a certain postion.Temp=f(x,y,z) or f(r,tetha,z).What I have to do is to save them in UDMs internally.Now the Problem is that I need to save the values in each face in one time step and by the next time step save the value of the face which located in left side neighborhood of the face in previous time step.This is the reason why I am looking for adressing each face indipendently.I have to adress them circumferentially (based on tangential position).F_CENTROID gets the adresses accidentaly and not on a regular basis. Thank you all for any suggestion 

March 12, 2015, 06:06 

#6  
Senior Member
Join Date: Nov 2013
Posts: 739
Rep Power: 10 
Quote:
Quote:
Go for the simple solution first. If that is too slow, then you can always try a different solution that is smarter later. I can think of a smarter solution easily. On the first timestep, check the angles of all the faces, group them according to angles, save the groups, and in the next timesteps reuse the groups, using direct access to the Fluent variables. And I can easily think of the drawbacks: you have to distinguish between the first timestep and the others, if your mesh are moving this will not work, if you reload Fluent with saved solution you may have lost the groups, and if in a new version of Fluent something changes variables are stored internally, your UDF will no longer work. If you can gain 400 hours of simulation by using the smarter method, it is worth these problems. If you can gain 0.04 seconds by using the smarter method, it definitely is not worth it. My experience says that in your case it is not worth it. Go for simple first, and test it. 

March 12, 2015, 06:50 

#7 
New Member
Join Date: Oct 2014
Posts: 12
Rep Power: 3 
Thank you pakk
I'm really happy for your tips.It's a very kind of you.So to give you more info: 1.I need the values of mass fraction of one of my spieces for each face ,every time step,but in every time step I need to get the value of the face which is on the position of (Tetha=tetha_init+omega*time).Finally I need to add the values together and take an average.I really don't know if .dat data can give me statistical results (like Excel format or so).Moreover if itis capable,what should I do with 2268 timesteps and 2268 .dat files. 2.When I say: ...... F_CENTRIOD(x,f,t) ....transform to cylindrical coord. sys..> r and Tetha_init tetha=tetha_init+omega*time; ....(this is now the problem,where I want to get the value of my"mass fraction of my specie" which I have calculated it's position by "tetha" because in the command F_YI(f,t,i) "f" has the address (x,y,z) or (r,tetha1,z) ,which is read by fluent itself and not by my addressing.I have to find some how a relationship btw my adress giving and getting F_YI(f,t,i) value. Thank you very much again 

March 12, 2015, 07:02 

#8  
Senior Member
Join Date: Nov 2013
Posts: 739
Rep Power: 10 
Quote:
And is the average value all you need? In that case, simply calculate the average value in your UDF and save the average value, and append this every time step to your result file. Keep it simple. Quote:


Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Questions on dynamicTopoFvMesh  danvica  OpenFOAM Running, Solving & CFD  70  June 12, 2015 04:33 
nonorthogonal faces and incorrect orientation?  nennbs  OpenFOAM Native Meshers: blockMesh  7  April 17, 2013 05:42 
Converting meshes that includes interfaces  ham  OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ...  29  January 8, 2007 09:58 
Trimmed cell and embedded refinement mesh conversion issues  michele  OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ...  2  July 15, 2005 04:15 
how to connect faces(only one adjacent cell thread  BC  FLUENT  8  July 13, 2005 16:07 