|
[Sponsors] |
June 2, 2009, 11:06 |
cell_t c from point coorfdinates UDF
|
#1 |
New Member
Andrea Di Carlo
Join Date: Jun 2009
Posts: 2
Rep Power: 0 |
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 |
|
June 2, 2009, 19:06 |
Use Find_bounding_cell
|
#2 |
New Member
Bocliff Sutter
Join Date: Jun 2009
Location: Tibet
Posts: 9
Rep Power: 17 |
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 |
|
June 2, 2009, 19:12 |
|
#3 |
New Member
Bocliff Sutter
Join Date: Jun 2009
Location: Tibet
Posts: 9
Rep Power: 17 |
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" |
|
June 4, 2009, 10:13 |
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 |
Thank you very much Bocliff
It works. You saved me from an nervous breakdown thnk you again |
|
October 15, 2012, 13:04 |
|
#5 |
New Member
Ian Maes
Join Date: Oct 2011
Posts: 10
Rep Power: 15 |
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 |
|
October 15, 2012, 13:39 |
Mhd
|
#6 |
Member
|
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 |
|
December 29, 2012, 17:28 |
|
#7 | |
New Member
Nasser
Join Date: Dec 2012
Posts: 21
Rep Power: 14 |
Quote:
I have same problem , can you solve it my friends ? |
||
December 30, 2012, 02:40 |
|
#8 |
Senior Member
SSL
Join Date: Oct 2012
Posts: 226
Rep Power: 15 |
Please share your equation. It's easy to write UDF for any equation.
|
|
July 4, 2014, 07:44 |
|
#9 |
New Member
Garvit Goel
Join Date: May 2014
Posts: 11
Rep Power: 12 |
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 |
|
July 4, 2014, 13:05 |
|
#10 |
New Member
Garvit Goel
Join Date: May 2014
Posts: 11
Rep Power: 12 |
||
|
|
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 |