Fluent 3D Dynamic Mesh
I have to make a dynamic mesh that can change the radius of a cylinder. How can I make the .udf?
|
YOU CAN ALSO ADD z DIRECTION
DEFINE_GRID_MOTION(RADII, domain, dt, time, dtime) { Thread *tf = DT_THREAD (dt); face_t f; Node *v; real x_coor; real x_centre=0; real y_coor; real rayon; real freq = 3.183; real alpha; real temps; real R =0.25; int n; // FILE *fp = fopen(UDF_FILENAME, "r"); /* set deforming flag on adjacent cell zone */ SET_DEFORMING_THREAD_FLAG (THREAD_T0 (tf)); //temps = RP_Get_Real("flow-time"); temps = time+dtime; begin_f_loop (f, tf) { f_node_loop (f, tf, n) { v = F_NODE (f, tf, n); if (NODE_POS_NEED_UPDATE (v)) { NODE_POS_UPDATED (v); x_coor= NODE_X (v); y_coor= NODE_Y (v); alpha = 0.125; NODE_X (v) = x_coor- x_coor*(alpha*cos(2*M_PI*4*freq*temps)); NODE_Y (v) = y_coor- y_coor*(alpha*cos(2*M_PI*4*freq*temps)); } } } end_f_loop (f, tf); } |
All times are GMT -4. The time now is 03:51. |