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

cell_t c from point coorfdinates UDF

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Payam89

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 2, 2009, 11:06
Default cell_t c from point coorfdinates UDF
  #1
New Member
 
Andrea Di Carlo
Join Date: Jun 2009
Posts: 2
Rep Power: 0
andrea.dicarlo is on a distinguished road
Dear all I'm new of this forum.
Could you help me?
I was written a UDF(FLUENT), I should obtain the cell_t c that contain a point of known coordinate (x,y,z). I'm going to better explain. From UDF manual I know there is the macro
C_CENTROID(x,c,t) that from the knoledge of c and t give x,y,z coordinate of the cell centre. I would like to know if there is a macro that could do the opposite, know the point x,y,z that could return the number of cell that contain that point.
Thank you very much
andrea.dicarlo is offline   Reply With Quote

Old   June 2, 2009, 19:06
Default Use Find_bounding_cell
  #2
New Member
 
Bocliff Sutter
Join Date: Jun 2009
Location: Tibet
Posts: 9
Rep Power: 17
Bocliff is on a distinguished road
Greetings,

You can use the function:

cell_t Find_bounding_cell(Domain *domain, real *x, Thread **t)

You provide the domain pointer, the coordinates of the point, and it returns the cell_t index and the thread pointer. Include dpm_tools.h before using it.

Regards,
Bocliff Sutter
Bocliff is offline   Reply With Quote

Old   June 2, 2009, 19:12
Default
  #3
New Member
 
Bocliff Sutter
Join Date: Jun 2009
Location: Tibet
Posts: 9
Rep Power: 17
Bocliff is on a distinguished road
Make sure you do not call this from some cell loop as you will end up with n^2 algorithm...

Bocliff Sutter

"May your Yak live long"
Bocliff is offline   Reply With Quote

Old   June 4, 2009, 10:13
Default cell_t c from point coorfdinates UDF Reply to Thread
  #4
New Member
 
Andrea Di Carlo
Join Date: Jun 2009
Posts: 2
Rep Power: 0
andrea.dicarlo is on a distinguished road
Thank you very much Bocliff
It works. You saved me from an nervous breakdown
thnk you again
andrea.dicarlo is offline   Reply With Quote

Old   October 15, 2012, 13:04
Default
  #5
New Member
 
Ian Maes
Join Date: Oct 2011
Posts: 10
Rep Power: 15
ian.maes is on a distinguished road
Hi!

I see the communication in this topic was ended in 2009, but could somebody type an example of the use of this function?
Is it also possible in 3D and give coordinates of x,y and z to the function?

Thank you in advance,

Kind regards,

Ian
ian.maes is offline   Reply With Quote

Old   October 15, 2012, 13:39
Post Mhd
  #6
Member
 
payamfadaei
Join Date: Oct 2012
Location: Mashhad/Iran
Posts: 32
Rep Power: 14
Payam89 is on a distinguished road
Send a message via Skype™ to Payam89
hello my dear!

I have a magnetic field in my flow and I read a lot of MHD tutorials but I am not able that in which format I should write this in c/c++ ....please if you have a similar c program me help.

regards
nasser likes this.
Payam89 is offline   Reply With Quote

Old   December 29, 2012, 17:28
Default
  #7
New Member
 
Nasser
Join Date: Dec 2012
Posts: 21
Rep Power: 13
nasser is on a distinguished road
Quote:
Originally Posted by Payam89 View Post
hello my dear!

I have a magnetic field in my flow and I read a lot of MHD tutorials but I am not able that in which format I should write this in c/c++ ....please if you have a similar c program me help.

regards
hi
I have same problem , can you solve it my friends ?
nasser is offline   Reply With Quote

Old   December 30, 2012, 02:40
Default
  #8
Senior Member
 
SSL
Join Date: Oct 2012
Posts: 226
Rep Power: 15
msaeedsadeghi is on a distinguished road
Please share your equation. It's easy to write UDF for any equation.
msaeedsadeghi is offline   Reply With Quote

Old   July 4, 2014, 07:44
Default
  #9
New Member
 
Garvit Goel
Join Date: May 2014
Posts: 11
Rep Power: 12
garvitgoel is on a distinguished road
Lets say I first loop over the entire domain and store cell_t c and thread *t for every cell.
Can I later access a cell using these c and t?
For eg
i store cell_t c and thread *t of some cell in global variables c_global and t_global.
Then in some other function I do C_CENTROID ( xc , c_global, t_global );
Will xc hold the centroid of that original cell?
Thanks a lot
garvit goel
Imperial college
garvitgoel is offline   Reply With Quote

Old   July 4, 2014, 13:05
Default
  #10
New Member
 
Garvit Goel
Join Date: May 2014
Posts: 11
Rep Power: 12
garvitgoel is on a distinguished road
Quote:
Originally Posted by Bocliff View Post
Make sure you do not call this from some cell loop as you will end up with n^2 algorithm...

Bocliff Sutter

"May your Yak live long"
Is it possible to obatin a n^1 or less algorithym?
garvitgoel is offline   Reply With Quote

Reply


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
[Gmsh] Gmsh and samplesurface touf OpenFOAM Meshing & Mesh Conversion 2 December 10, 2007 03:27
udf to set vel. = 0 at a grid point or a cell Ralf Schmidt FLUENT 0 September 22, 2006 10:45
UDF to define source term at every grid point Ralf Schmidt FLUENT 0 September 21, 2006 12:32
Passing point data to UDF using C_UDMI Sam Bennett FLUENT 6 December 1, 2005 09:46
CFX4.3 -build analysis form Chie Min CFX 5 July 13, 2001 00:19


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