
[Sponsors] 
December 19, 2015, 05:47 
2D UDF conversion into 3D

#1 
Member
Mansoor Ahmed
Join Date: Apr 2014
Location: Pakistan
Posts: 45
Rep Power: 4 
I have written a udf for 2D channel wall deformation. Now I want to apply the udf to the wall of a tube. the udf just displaces a certain line of nodes but not all the nodes on the tube wall.what changes should I apply?
the tube has axial direction in the xaxis. 

January 2, 2016, 19:11 

#2 
Senior Member
Join Date: Mar 2015
Posts: 793
Rep Power: 9 
What is your UDF and which different nodes are modified in the 3D case? For example, if only the nodes in the XZ plane are affected then you could add a conditional statement for z=0.


January 11, 2016, 12:37 

#3  
Member
Mansoor Ahmed
Join Date: Apr 2014
Location: Pakistan
Posts: 45
Rep Power: 4 
Quote:
Here is the udf for 2D channel case. which is deforming the walls according to the specified equation. Code:
DEFINE_GRID_MOTION(grid_motion, domain, dt, time, dtime) { face_t f; Thread *tf = DT_THREAD ((Dynamic_Thread *) dt); int n; Node *v; real x; real y; SET_DEFORMING_THREAD_FLAG(THREAD_T0(tf)); /* Set flag to indicate that the current node's position has been updated, so that it will not be updated in a future pass through the loop. */ 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 = NODE_X (v); y = (D/2)+b*sin((2*pi/lam)*(xc*CURRENT_TIME)); NODE_Y (v)=y; b is wave amplitude and c is wave propagation speed lam is wavelength Now I want to apply this equation for a 3D TUBE case. the streamwise direction is same as the channel i.e. xaxis. TUBE diameter is along y and z axis. that is, nodes in both y and z directions need to be deformed in order to produce contraction and expansion in the tube. what changes do you prefer to the above code so that it can be used to produce deformation in a tube. I have tried the following changes i,e, NODE_Y(v), NODE_Z(v)=y; but this command deforms the the wall of the tube in a rectangular manner. the circular property of the tube is violated. any suggestions would be highly appreciated. thank you 

January 11, 2016, 20:06 

#4 
Senior Member
Join Date: Mar 2015
Posts: 793
Rep Power: 9 
The vertical distance, y, in the 2D case (rectangle) is analogous to the radial distance, r, in the 3D case (tube/pipe). One approach is to assume the nodes only move radially inwards/outwards from the origin and therefore have a constant angle with the XY plane.
For example: Code:
r = (D/2.)+b*sin((2.*pi/lam)*(NODE_X(v)c*CURRENT_TIME)); theta = atan(NODE_Z(v)/NODE_Y(v)); NODE_Y(v) = r * cos(theta); NODE_Z(v) = r * sin(theta); 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
UDF Compilation Error  Loading Library  COMMON Problem! Help!  robtheslob  Fluent UDF and Scheme Programming  8  July 24, 2015 00:53 
Parallelize UDF? Which kind of UDF?  Lilly  FLUENT  5  March 25, 2014 03:05 
Help! Delete the UDM codes in the UDF  Messi  Fluent UDF and Scheme Programming  2  January 28, 2014 10:01 
UDF parallel error: chipexec: function not found?????  shankara.2  Fluent UDF and Scheme Programming  1  January 16, 2012 23:14 
UDF, UDF, UDF, UDF  Luc SEMINEL  Main CFD Forum  0  November 25, 2002 05:01 