Moving Wall Boundary Condition
dear friends
Is there any udf for moving wall with time dependent velocity on the web? i need it ASAP. thanks, |
Hi Morteza,
I previously wrote a UDF for rotating wall. theta as a function of time, for other types of wall motions you can change some lines of that : #include "udf.h" #include "stdio.h" #include "math.h" // rotation theta=f(t) DEFINE_GRID_MOTION(eye,domain,dt,time,dtime) { Thread *tf = DT_THREAD(dt); face_t f; Node *v; real dtheta,a,b; int n; SET_DEFORMING_THREAD_FLAG(THREAD_T0(tf)); 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); dtheta=......; // compute dtheta as a function of dtime (differentiation) a=cos(dtheta)*NODE_X(v)-sin(dtheta)*NODE_Y(v); // rotation tensor b=sin(dtheta)*NODE_X(v)+cos(dtheta)*NODE_Y(v); NODE_X(v)=a; NODE_Y(v)=b; } } } end_f_loop(f,tf); } |
Thanks
Dear Amir
thank u for your help.can you explain differences between moving wall and grid motion? |
Hi Morteza,
you can hang this UDF where ever you want, obviously your wall also has grid points and they can move. but notice that you can use remeshing and smoothing options in your case. |
thank u Amir,
Consider a tank that contains water about its half height. and the whole tank begins to move with time dependent velocity. in this case i should use moving mesh or moving wall? tanks in advance. |
Hi Morteza,
of course you should use moving mesh without deforming or smoothing or... . if velocity was constant, you could easily use moving reference frame but in your case the above UDF works. just hook it to all of your zones like wall,interior,... except fluid ones. |
Hi Amir
Thanks for your help.i will check it and whether i have problem i will inform you. thanks again. |
All times are GMT -4. The time now is 06:37. |