|
[Sponsors] |
retrieve, access flow variables on interior boundary |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 22, 2013, 02:34 |
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 |
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 Last edited by macfly; January 22, 2013 at 09:58. |
|
January 23, 2013, 16:26 |
|
#2 |
Member
Join Date: Dec 2012
Posts: 92
Rep Power: 14 |
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 |
|
January 23, 2013, 23:04 |
|
#3 |
Senior Member
François Grégoire
Join Date: Jan 2010
Location: Canada
Posts: 392
Rep Power: 17 |
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 Last edited by macfly; January 23, 2013 at 23:44. |
|
|
|
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 |