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

retrieve, access flow variables on interior boundary

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By macfly

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 22, 2013, 02:34
Default retrieve, access flow variables on interior boundary
  #1
Senior Member
 
François Grégoire
Join Date: Jan 2010
Location: Canada
Posts: 392
Rep Power: 17
macfly is on a distinguished road
Hi all,

I'm looking for a way to retrieve temperature data along an interior boundary in a simple pipe flow. See figures 1 and 2, I would like to retrieve the temperature along the interior boundary ID 30. Figure 1 shows the location of the interior boundary, and figure 2 shows the mesh in this region. Here's my udf:

#include "udf.h"
DEFINE_ADJUST(Tint, domain)
{
real T=0;
cell_t c;
int ID = 30;
Thread *thread = Lookup_Thread(domain, ID);
begin_c_loop(c, thread)
{
T = C_T(c,thread);
printf("Température = %.4f\n", T);
}
end_c_loop(f,thread)
}

Which produces the following error messages when I start calculation:

FLUENT received fatal signal (ACCESS_VIOLATION)
1. Note exact events leading to error.
2. Save case/data under new name.
3. Exit program and restart to continue.
4. Report error to your distributor.
Error Object: #f


I understand that the temperature is defined on boundaries and cells, but not on faces where I loop. But I can't find a way to use F_C0 to get the adjacent cells temperature. I'm a rookie with C coding and I would appreciate a little help to make my udf working. It works just fine on external boundaries, but I'm missing something regarding the interior boundaries.

Thanks ahead,
François
Attached Images
File Type: jpg 1.jpg (9.2 KB, 34 views)
File Type: png 2.png (9.9 KB, 35 views)

Last edited by macfly; January 22, 2013 at 09:58.
macfly is offline   Reply With Quote

Old   January 23, 2013, 16:26
Default
  #2
Member
 
Join Date: Dec 2012
Posts: 92
Rep Power: 14
beer is on a distinguished road
I think you loop over cells in a face, that won't work at all. Try the face loop. Than you ca use F_C0 and F_C1 to interpolate the temperature on the boundary. I already worked with the face loops, but I can't find the UDF right now...
Oh and you can't use printf, use Message("...")

Greetings
beer is offline   Reply With Quote

Old   January 23, 2013, 23:04
Default
  #3
Senior Member
 
François Grégoire
Join Date: Jan 2010
Location: Canada
Posts: 392
Rep Power: 17
macfly is on a distinguished road
Hi beer,

You're right, it works with a face loop and then I get adjacent cell values with F_C0 and THREAD_T0 (or F_C1 and THREAD_T1). The printf command works fine in my interpreted udf. Here is my code:

#include "udf.h"
DEFINE_ADJUST(Tint, domain,t)
{
real coord[ND_ND];
real T;
face_t f;
cell_t c0;
int ID = 30;
Thread *thread, *t0;
thread = Lookup_Thread(domain, ID);
begin_f_loop(f, thread)
{
c0 = F_C0(f,thread);
t0 = THREAD_T0(thread);
F_CENTROID(coord,c0,t0);
T = F_T(c0,t0);
printf("x = %f\ty = %f\tT = %f\n",coord[0], coord[1], T);
}
end_f_loop(f,thread)
}


solved
Abhinand likes this.

Last edited by macfly; January 23, 2013 at 23:44.
macfly 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
flow over a cylinder urgent! kevin FLUENT 8 August 11, 2015 14:00
How to access surrounding variables? chemycc CFX 0 April 30, 2009 02:42
transform navier-stokes eq. to euler-eq. pxyz Main CFD Forum 37 July 7, 2006 09:42
Question on 3D potential flow Adrin Gharakhani Main CFD Forum 13 June 21, 1999 06:18
computation about flow around a yawed cone Tylor Xie Main CFD Forum 0 June 9, 1999 08:33


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