Multiphase Udf code for looping a wall face
Hello everyone!
During a multiphase flow simulation (air+sand, Eulerian-Eulerian model), I am trying to write an UDF to loop a wall face (its ID is 22). The purpose is to store some values (the secondary phase) of the wall adjacent cell to the UDM. But after a long attempt, I failed to complete this process. The code is in vain for the wall adjacent cell. Those values that are not in this area are looped and stored instead. There must be something wrong with my UDF,especially in the looping process. I have no idea what to do next, so maybe someone here has an idea? Thank you. #include "udf.h" #include "sg.h" #include "sg_mphase.h" #include "flow.h" #include "mem.h" #define ID 22 //WALL_NUMBER DEFINE_ADJUST(settingvalue, mixture_domain) { Thread *cell_thread; Thread *tc; cell_t c; face_t f; Thread **pt; Thread *ti; Thread *tf; mixture_domain = Get_Domain(1); tf= Lookup_Thread(mixture_domain, ID); //getting the wall thread mp_thread_loop_f(tf, mixture_domain, pt) { if (DOMAIN_ID(tf) == 3) // 3 is the secondary phase domain { begin_f_loop(f,tf) { tc = THREAD_T0(tf); /*adjacent cell thread*/ c = F_C0(f,tf); /*adjacent cell*/ ti = pt[1]; /* 0 pointer for the primary phase, 1 is for the secondary phase*/ C_UDMI(c,ti,0) = - C_R(c, ti)*C_VOF(c,ti)/CURRENT_TIMESTEP ; } end_f_loop(f,tf) } } } |
Quote:
|
Dear pakk.
Thank you for responding. It may or may not be this. The contours in other areas show changes, but I am not sure whether it works well or not for everything except the wall that I am interested in. It is certain that it has no effect on the interested cells. thank you. Xingang Quote:
|
C_UDMI(c,ti,0)
Should be C_UDMI(c,tc,0) (i think) |
Thank you, I will try.
Quote:
|
All times are GMT -4. The time now is 03:53. |