# How can I twist a surface with UDF?

 Register Blogs Members List Search Today's Posts Mark Forums Read

 July 21, 2010, 11:21 How can I twist a surface with UDF? -solved- #1 Senior Member   Herman Join Date: Nov 2009 Posts: 122 Rep Power: 7 Hi all, I have to twist a surface through mesh-motion. How can I do that? How should I write the UDF? Please help me... Thanks in advace! Last edited by enry; July 21, 2010 at 16:57.

 July 21, 2010, 16:57 #2 Senior Member   Herman Join Date: Nov 2009 Posts: 122 Rep Power: 7 I solved the problem, with define_grid_motion. If somebody is interested, here is the UDF. #include"udf.h" DEFINE_GRID_MOTION(twist,domain,dt,time,dtime) { Thread *tf = DT_THREAD(dt); face_t f; Node *v; real NV_VEC(axis); real delta,xaxis,yaxis,teta,xn,yn,dx,dy,H; int n; H = 0.1; /*z-dimension of the model*/ teta = 10*3.14/180; /*rotation angle*/ begin_f_loop(f,tf) { f_node_loop(f,tf,n) { v = F_NODE(f,tf,n); /* update node if the current node has not been previously visited when looping through previous faces */ if ( NODE_POS_NEED_UPDATE (v)) { /* indicate that node position has been update so that it's not updated more than once */ NODE_POS_UPDATED(v); xn = cos(teta)*NODE_X(v)-sin(teta)*NODE_Y(v); yn = sin(teta)*NODE_X(v)+cos(teta)*NODE_Y(v); dx = xn-NODE_X(v); dy = yn-NODE_Y(v); xaxis = dx/sqrt(pow(dx,2) + pow(dy,2)); yaxis = dy/sqrt(pow(dx,2) + pow(dy,2)); NV_D(axis, =, xaxis,yaxis, 0.0); delta = sqrt(pow(dx,2) + pow(dy,2))*NODE_Z(v)/H; NV_V_VS(NODE_COORD(v), =, NODE_COORD(v), +, axis,*,delta); } } } end_f_loop(f,tf); } Last edited by enry; July 21, 2010 at 17:21.

 September 16, 2010, 13:40 #3 New Member   Taher Join Date: Jun 2009 Posts: 1 Rep Power: 0 Hey guys.. I need to move a 2D airfoil through certain angle of attack.. now if I dont want to use CG_Motion.. do you think I can do it through GRID_MOTION.. Like may be threading all the nodes across surface and moving them all..

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Ashish Jain FLUENT 0 May 16, 2005 10:43 Ashish Jain FLUENT 0 May 11, 2005 14:31 cindy Main CFD Forum 3 April 5, 2004 13:43 Deb CFX 19 April 17, 2003 10:56 Kaushik FLUENT 1 May 8, 2000 06:47

All times are GMT -4. The time now is 09:39.