Moving a wall with UDF
Can you please take a look at this????:confused::confused::mad:
I have a 2D channel that the upper wall has the equation of y=ax+b. I used a udf in order to move it along Y axis. However, when I preview my mesh it doesn't take into account the slope of the wall (a*x) : #include"udf.h" #include"mem.h" #include"dynamesh_tools.h" /* Constants */ #define b 10e-3 #define a 0.3e-3 /************************************************** ***/ DEFINE_GEOM(upper_wall_m,domain,dt,position) { Thread *tf = DT_THREAD (dt); face_t f; Node *node_p; real x, y; int n; SET_DEFORMING_THREAD_FLAG (THREAD_T0 (tf)); begin_f_loop (f, tf) { f_node_loop (f, tf, n) { node_p = F_NODE (f, tf, n); if (NODE_POS_NEED_UPDATE (node_p)) { NODE_POS_UPDATED (node_p); x = NODE_X (node_p); y=-a*(x)+b)+CURRENT_TIME; NODE_Y (node_p) = y; } } } end_f_loop (f, tf); } |
All times are GMT -4. The time now is 02:25. |