UDF dynamic mesh problem
These 2 udf codes are both for the model I uploaded(one for membrane one for axis), and the membrane oscillated successfully.
The problem is the stretching of the axis.I want the point of the axis at (0,0) fixed. How should I do?
I have solved the problem, the code is changed as below.
And the model is not the one I uploaded before so the number in the code is different.
Thread *tf = DT_THREAD(dt);
/* set deforming flag on adjacent cell zone */
//Message ("time = %f, omega = %f\n", time, sign);
NV_D(vel, =, 0.0,0.0,0.0);
width = 0.095776 / 2.0;
period = 0.05;
v = F_NODE(f,tf,n);
xx = NODE_X(v);
if (NODE_POS_NEED_UPDATE (v))
yy = (NODE_Y(v)) / width;
vel = 0;
vel = - 2 * 3.14159 / period * 0.005 * (1 - pow(yy,2)) * cos(2 * 3.14159 / period * time);
|All times are GMT -4. The time now is 03:44.|