Using a C_UDMI defined in one UDF in another UDF
I use a C_UDMI to calculate the number of particles that deposit on a wall as:
DEFINE_DPM_BC(Deposition,p,t,f,f_normal,dim) { #if !RP_HOST Thread *tcell=P_CELL_THREAD(p); cell_t c=P_CELL(p); Domain *d; d=Get_Domain(1); C_UDMI(c,tcell,0) += 1.; return PATH_ABORT; #endif } Then, I want to use this C_UDMI in another UDF to move the mesh where particles are deposited: DEFINE_GRID_MOTION(beam,domain,dt,time,dtime) { Thread *tf; face_t f; int n; Node *v; /* get the thread pointer for which this motion is defined */ tf=DT_THREAD(dt); begin_f_loop(f,tf) { f_node_loop(f,tf,n) { v = F_NODE(f,tf,n); ...... ......C_UDMI....... ...... } } end_f_loop(f,tf); } Is this possible? Can anyone help how to do this? Thanks, |
real G;
G=C_UDMI(c,t,0); will allow you to use it on another define macro but above you are trying to use cell data in face node loop. You cant transfer data like that |
Thanks for your response. So does G have all information that C_UDMI has?(cell information and stored values)
Do I need to define G in the second UDF as well? Something like: DEFINE_GRID_MOTION(beam,domain,dt,time,dtime) { Thread *tf; face_t f; int n; Real G .... |
Quote:
In your UDF "OSU_Deposition_Model_R1", you now store face data in a C_UDMI, by first finding the associated cell. You can skip that step, and directly store it in F_UDMI(f,t). Code:
DEFINE_DPM_BC(OSU_Deposition_Model_R1,p,t,f,f_normal,dim) |
Thanks for your response.
I guess I need the nodal values in DEFINE_GRID_MOTION to move the mesh? How do I store the same value (F_UDMI) in the neighboring nodes? How do I find the nodes around a the face f? (In 2D there are two nodes at two sides of the face) |
All times are GMT -4. The time now is 00:47. |