CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Addressing each Face cell in a certain Thread

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 10, 2015, 11:10
Default Addressing each Face cell in a certain Thread
  #1
New Member
 
Join Date: Oct 2014
Posts: 17
Rep Power: 11
Schumacher00 is on a distinguished road
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
Schumacher00 is offline   Reply With Quote

Old   March 10, 2015, 16:32
Default
  #2
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
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.
`e` is offline   Reply With Quote

Old   March 11, 2015, 03:55
Default
  #3
New Member
 
Join Date: Oct 2014
Posts: 17
Rep Power: 11
Schumacher00 is on a distinguished road
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
Schumacher00 is offline   Reply With Quote

Old   March 11, 2015, 05:05
Default
  #4
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
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.
pakk is offline   Reply With Quote

Old   March 12, 2015, 05:44
Default
  #5
New Member
 
Join Date: Oct 2014
Posts: 17
Rep Power: 11
Schumacher00 is on a distinguished road
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
Schumacher00 is offline   Reply With Quote

Old   March 12, 2015, 06:06
Default
  #6
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
Quote:
Originally Posted by Schumacher00 View Post
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.
Why not? 200000 faces is really not much, it should not take much time to go through them all. Certainly less than a second.

Quote:
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.
I can not understand what you mean here. But it doesn't matter, I think you are thinking too complicated. You assume that you need some smart trick to speed up the calculation, but you did not check if your assumption is true. Premature optimization is the root of all evil.

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 re-use 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.
pakk is offline   Reply With Quote

Old   March 12, 2015, 06:50
Default
  #7
New Member
 
Join Date: Oct 2014
Posts: 17
Rep Power: 11
Schumacher00 is on a distinguished road
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
Schumacher00 is offline   Reply With Quote

Old   March 12, 2015, 07:02
Default
  #8
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
Quote:
Originally Posted by Schumacher00 View Post
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.
So the faces you need change every timestep? Then you definitely need to go through all faces every timestep.
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:
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
I can not follow this. But it looks like you still are looking for a complicated solution. Don't do that, start with the easy solution.
pakk is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Questions on dynamicTopoFvMesh danvica OpenFOAM Running, Solving & CFD 80 April 16, 2019 17:58
[blockMesh] non-orthogonal faces and incorrect orientation? nennbs OpenFOAM Meshing & Mesh Conversion 7 April 17, 2013 06:42
[Commercial meshers] Converting meshes that includes interfaces ham OpenFOAM Meshing & Mesh Conversion 29 January 8, 2007 09:58
[Commercial meshers] Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Meshing & Mesh Conversion 2 July 15, 2005 05:15
how to connect faces(only one adjacent cell thread BC FLUENT 8 July 13, 2005 17:07


All times are GMT -4. The time now is 05:01.