
[Sponsors] 
September 10, 2009, 12:28 
C_UDMI & C_UDSI problem.

#1 
New Member
Join Date: Jun 2009
Posts: 9
Rep Power: 8 
I want to run a DEFINE_ON_DEMAND udf in order to save the UDS at the wall in a UDM.
Actualy, I dont have any problem if i save the whole UDS result but i am not able to do it too. I used the following code: DEFINE_ON_DEMAND(wall_UDS_value) { Domain *d; face_t f; cell_t c, c0; Thread *t,*t0, *c_thread; int Zone_ID=3; /* Zone ID of the wall on which UDS to be calculated */ /* It can be obtained from the boundary condition panel.*/ d=Get_Domain(1); /* Initialize the UDM value to zero in complete domain */ thread_loop_c(c_thread,d) { begin_c_loop(c, c_thread) { C_UDMI(c,c_thread,0)= 0; } end_c_loop(c, c_thread) } t=Lookup_Thread(d,Zone_ID); begin_c_loop (c,t) { c0 = F_C0(f,t); t0 = THREAD_T0(t); C_UDMI(c0,t0,0) = C_UDSI(c,t,0); } end_c_loop (c,t) } Can anyone help me. What i did wrong? Thank you for your answer. Dim 

September 11, 2009, 04:01 

#2 
Senior Member
Max
Join Date: Mar 2009
Posts: 133
Rep Power: 9 
hello dimitrios,
to access the values on a wall, which is, from the geometrical point of view a 2d plane and in the context of fluent a "face", you need to loop over faces and not cells. Thus, use something like begin_f_loop and F_UDMI and you wil get what you want. cheers 

September 11, 2009, 19:44 

#3 
New Member
Join Date: Jun 2009
Posts: 9
Rep Power: 8 
Hello Max,
Firstly, thank you very much for your quick reply and help. I tried what you said but I had some problems. When i used the following code the result is an "ACCESS_VIOLATION". Could you tell me please if you know something more about that? DEFINE_ON_DEMAND(wall_UDS_value) { Domain *d; face_t f; cell_t c; Thread *t,*t0, *f_thread; int Zone_ID=3; /* Zone ID of the wall on which UDS to be calculated */ /* It can be obtained from the boundary condition panel.*/ d=Get_Domain(1); /* Initialize the UDM value to zero in complete domain */ thread_loop_f (f_thread,d) { begin_f_loop(f, f_thread) { F_UDMI(f,f_thread,0)=0; } end_f_loop(f,f_thread) } t=Lookup_Thread(d,Zone_ID); begin_f_loop (f,t) { t0 = THREAD_T0(t); F_UDMI(f,t0,0) = F_UDSI(f,t,0); } end_f_loop (f,t) } Thank you for your answer. Dim 

September 13, 2009, 04:26 

#4 
Member
Ivan
Join Date: May 2009
Posts: 85
Rep Power: 9 
if I may throw in my 2 cents. first, f is from thread t, I am NOT sure if you can use it in F_UDMI(f,t0,0). correct me if I am wrong. second, F UDMI is available for wall and
flow boundary faces only and t0 may NOT be either of those. 

September 13, 2009, 05:11 

#5 
New Member
Join Date: Jun 2009
Posts: 9
Rep Power: 8 
Hello Ivan,
Thank you very much for your reply. You are right! Sorry I posted by mistake the wrong udf. actually i used the following udf with the same "ACCESS_VIOLATION". DEFINE_ON_DEMAND(wall_UDS_value) { Domain *d; face_t f; cell_t c; Thread *t, *f_thread; int Zone_ID=3; /* Zone ID of the wall on which UDS to be calculated */ /* It can be obtained from the boundary condition panel.*/ d=Get_Domain(1); /* Initialize the UDM value to zero in complete domain */ thread_loop_f (f_thread,d) { begin_f_loop(f, f_thread) { F_UDMI(f,f_thread,0)=0; } end_f_loop(f,f_thread) } t=Lookup_Thread(d,Zone_ID); begin_f_loop (f,t) { F_UDMI(f,t,0) = F_UDSI(f,t,0); } end_f_loop (f,t) } Any ideas? Thank you for your answers. Dim 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
UDF compiling problem  Wouter  Fluent UDF and Scheme Programming  6  June 6, 2012 04:43 
Incoherent problem table in hollowfiber spinning  Gianni  FLUENT  0  April 5, 2008 10:33 
natural convection problem for a CHT problem  SeHee  CFX  2  June 10, 2007 06:29 
Adiabatic and Rotating wall (Convection problem)  ParodDav  CFX  5  April 29, 2007 19:13 
convergence problem  Trushar  Phoenics  5  August 27, 2002 23:40 