CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

2D UDF conversion into 3D

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 19, 2015, 04:47
Default 2D UDF conversion into 3D
  #1
Member
 
Mansoor Ahmed
Join Date: Apr 2014
Location: https://t.me/pump_upp
Posts: 47
Rep Power: 12
engrmansoor2534 is on a distinguished road
Send a message via ICQ to engrmansoor2534 Send a message via AIM to engrmansoor2534 Send a message via Yahoo to engrmansoor2534
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.
engrmansoor2534 is offline   Reply With Quote

Old   January 2, 2016, 18:11
Default
  #2
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
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.
`e` is offline   Reply With Quote

Old   January 11, 2016, 11:37
Default
  #3
Member
 
Mansoor Ahmed
Join Date: Apr 2014
Location: https://t.me/pump_upp
Posts: 47
Rep Power: 12
engrmansoor2534 is on a distinguished road
Send a message via ICQ to engrmansoor2534 Send a message via AIM to engrmansoor2534 Send a message via Yahoo to engrmansoor2534
Quote:
Originally Posted by `e` View Post
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
File Type: png fig.png (18.4 KB, 8 views)
engrmansoor2534 is offline   Reply With Quote

Old   January 11, 2016, 19:06
Default
  #4
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
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);
`e` is offline   Reply With Quote

Reply


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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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 02:05
Help! Delete the UDM codes in the UDF Messi Fluent UDF and Scheme Programming 2 January 28, 2014 09:01
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 22:14
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 04:01


All times are GMT -4. The time now is 19:22.