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

Passing point data to UDF using C_UDMI

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 17, 2005, 05:55
Default Passing point data to UDF using C_UDMI
  #1
Sam Bennett
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)

}
  Reply With Quote

Old   November 17, 2005, 06:49
Default Re: Passing point data to UDF using C_UDMI
  #2
RoM
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
  Reply With Quote

Old   November 22, 2005, 05:59
Default Re: Passing point data to UDF using C_UDMI
  #3
Sam Bennett
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
  Reply With Quote

Old   November 22, 2005, 07:12
Default Re: Passing point data to UDF using C_UDMI
  #4
RoM
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
  Reply With Quote

Old   November 23, 2005, 10:50
Default Re: Passing point data to UDF using C_UDMI
  #5
Sam Bennett
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?
  Reply With Quote

Old   November 28, 2005, 01:50
Default Re: Passing point data to UDF using C_UDMI
  #6
RoM
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
  Reply With Quote

Old   December 1, 2005, 08:46
Default Re: Passing point data to UDF using C_UDMI
  #7
Sam Bennett
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
  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
cell_t c from point coorfdinates UDF andrea.dicarlo Fluent UDF and Scheme Programming 9 July 4, 2014 12:05
block-structured mesh for t-junction Robert@cfd ANSYS Meshing & Geometry 20 November 11, 2011 04:59
Problem with UDF compiling for kTkLW model Wantami FLUENT 0 July 18, 2011 05:11
CFX4.3 -build analysis form Chie Min CFX 5 July 12, 2001 23:19
UDF reading species data of pdf simulations Jamiro FLUENT 0 June 20, 2001 17:15


All times are GMT -4. The time now is 12:17.