# 2D UDF conversion into 3D

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 LinkBack Thread Tools Display Modes
 December 19, 2015, 05:47 2D UDF conversion into 3D #1 Member   Mansoor Ahmed Join Date: Apr 2014 Location: Pakistan Posts: 45 Rep Power: 5 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 x-axis.

 January 2, 2016, 19:11 #2 Senior Member   Join Date: Mar 2015 Posts: 800 Rep Power: 11 What is your UDF and which different nodes are modified in the 3-D case? For example, if only the nodes in the X-Z 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: 5
Quote:
 Originally Posted by `e` What is your UDF and which different nodes are modified in the 3-D case? For example, if only the nodes in the X-Z plane are affected then you could add a conditional statement for z=0.
Dear 'e'
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)*(x-c*CURRENT_TIME));
NODE_Y (v)=y;
where D is tube diameter
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. x-axis. 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
Attached Images
 fig.png (18.4 KB, 2 views)

 January 11, 2016, 20:06 #4 Senior Member   Join Date: Mar 2015 Posts: 800 Rep Power: 11 The vertical distance, y, in the 2-D case (rectangle) is analogous to the radial distance, r, in the 3-D 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 X-Y 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 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 robtheslob Fluent UDF and Scheme Programming 8 July 24, 2015 00:53 Lilly FLUENT 5 March 25, 2014 03:05 Messi Fluent UDF and Scheme Programming 2 January 28, 2014 10:01 shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 23:14 Luc SEMINEL Main CFD Forum 0 November 25, 2002 05:01

All times are GMT -4. The time now is 15:16.

 Contact Us - CFD Online - Top