|
[Sponsors] |
November 17, 2005, 06:55 |
Passing point data to UDF using C_UDMI
|
#1 |
Guest
Posts: n/a
|
Dear all,
I have written the following code to load the temperature from a point (zone ID = 15) into the user defined memory.The point was created in Fluent using surace/point. When it's run as interpreted I get a segmentation violation. Yes I have turned on user memory. I have also tried looping over the face and using F_UDMI, same problem. The zone ID is from surface/manage, as a point isn't listed as a boundry. Is this where my problem comes from? Thanks for your help in advance, Sam DEFINE_ADJUST(sensor_temp, domain) { cell_t c; int ID = 15; Thread *thread = Lookup_Thread(domain, ID); begin_c_loop(c, thread) { C_UDMI(c,thread,0) = C_T(c,thread); } end_c_loop(c, thread) } |
|
November 17, 2005, 07:49 |
Re: Passing point data to UDF using C_UDMI
|
#2 |
Guest
Posts: n/a
|
You cant acces values from postprocessing surfaces in udf. Where did you get that thread id from? To get a list of all surfaces/cell zones you can access by udf type //define/bc/lz in tui.
RoM |
|
November 22, 2005, 06:59 |
Re: Passing point data to UDF using C_UDMI
|
#3 |
Guest
Posts: n/a
|
Dear RoM,
I got the zone ID from the manage surfaces panel, it doesn't show up on the list you get when you type in //define/bc/lz.So I probably can't use a "point" from Fluent. Is there any other way of accesing temperature from a position not on a boundry condition? Thanks, Sam |
|
November 22, 2005, 08:12 |
Re: Passing point data to UDF using C_UDMI
|
#4 |
Guest
Posts: n/a
|
One possible way is to create a new fluid zone which holds only the cells you want to access. First you will need to mark these cells with the adapt->region panel. After you have marked your cells you can create a new fluid zone with grid->seperate->cells (save before). The new fluid zone is a boundary and will show up when you type //define/bc/lz. You can get its ID from there and use it in your udf. If you dont need the additional fluid zone anymore you can use grid->merge to merge it with your original fluid zone.
Good Luck, RoM |
|
November 23, 2005, 11:50 |
Re: Passing point data to UDF using C_UDMI
|
#5 |
Guest
Posts: n/a
|
Hi RoM, thanks for your suggestion. I tried doing that but got a (SEGMENTATION VIOLATION), the same as when I tried using a point ID. Any more suggestions?
|
|
November 28, 2005, 02:50 |
Re: Passing point data to UDF using C_UDMI
|
#6 |
Guest
Posts: n/a
|
You can get the cell center corrdinates with the C_CENTROID macro and use it to pick the cells you want.
DEFINE_ADJUST(sensor_temp, domain) { cell_t c; real c_cen[ND_ND]; /* cell center coordinates */ int ID = 15; /* fluid zone id */ Thread *thread = Lookup_Thread(domain, ID); begin_c_loop(c, thread) { C_CENTROID(c_cen,c,thread); /* c_cen[0]=x, c_cen[1]=y, c_cen[2]=z */ if( /* pick cell, dependend on c_cen coords */ ) C_UDMI(c,thread,0) = C_T(c,thread); else C_UDMI(c,thread,0) = 0.; } end_c_loop(c, thread) } RoM |
|
December 1, 2005, 09:46 |
Re: Passing point data to UDF using C_UDMI
|
#7 |
Guest
Posts: n/a
|
Thanks RoM, I've sorted it out using a the cell centroid firdt to find th cell, and then later just using the number directly.Thanks again.
Sam |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
cell_t c from point coorfdinates UDF | andrea.dicarlo | Fluent UDF and Scheme Programming | 9 | July 4, 2014 13:05 |
block-structured mesh for t-junction | Robert@cfd | ANSYS Meshing & Geometry | 20 | November 11, 2011 05:59 |
Problem with UDF compiling for kTkLW model | Wantami | FLUENT | 0 | July 18, 2011 06:11 |
CFX4.3 -build analysis form | Chie Min | CFX | 5 | July 13, 2001 00:19 |
UDF reading species data of pdf simulations | Jamiro | FLUENT | 0 | June 20, 2001 18:15 |