C_UDMI & C_UDSI problem.
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 |
hello dimitrios,
to access the values on a wall, which is, from the geometrical point of view a 2-d 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 |
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 |
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. |
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 |
All times are GMT -4. The time now is 22:11. |