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

UDF for 2d translational motion

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

Reply
 
LinkBack Thread Tools Display Modes
Old   July 24, 2012, 01:26
Default UDF for 2d translational motion
  #1
New Member
 
Join Date: Jun 2012
Posts: 11
Rep Power: 2
ThinkQuick is on a distinguished road
Hi all,

I am relatively new to ANSYS Fluent and am trying to impose a simple UDF to move a disturbance through a fluid. I only require the disturbance to move in the x direction with a constant velocity.

Could anyone please point me in the right direction about how to write this UDF?

Thanks
ThinkQuick is offline   Reply With Quote

Old   July 25, 2012, 04:26
Default Profiles instead
  #2
Senior Member
 
Marion
Join Date: Jul 2012
Location: France
Posts: 117
Rep Power: 3
Marion is on a distinguished road
This is a udf for X-velocity (3D)

#include<udf.h>
DEFINE_CG_MOTION(velo_needle, dt, cg_vel, cg_omega, time, dtime)
{

cg_vel[0] = -0.6;
/* x-velocity*/
cg_vel[1] = 0.0;
cg_vel[2] = 0.0;
NV_S (cg_omega, =, 0.0);
/* no angular motion */
/* Messages in Fluent TUI */

Message(
" \n");
Message(
"velocity \n");
Message(
"%5.6f\t\n",cg_vel[0]);
Message(
" \n");
}

However, Fluent support advised me to use profiles files for this kind of motion (i.e. non force driven motions)... It's easier since you do not have to compile your udf or have to keep the files together, etc.

Since I discovered the use of profiles for transient motions my life has changed

Marion.
Marion is offline   Reply With Quote

Old   July 25, 2012, 20:49
Default
  #3
New Member
 
Join Date: Jun 2012
Posts: 11
Rep Power: 2
ThinkQuick is on a distinguished road
Quote:
Originally Posted by eng_s_sadeghi View Post
Hello,
May you please send me a sample paper to know what exactly you want to model? Please take a look at my website and feel free to email me for any questions.
Hi Saeed, I have emailed you.
Thanks.

Marion:
'Fluent support advised me to use profiles files for this kind of motion'

Thanks for the reply. Do you have any resources on using profiles to specify translation?

Its pretty frustrating it seems like a relatively simply problem to move an object at a constant velocity in one dimension however the simulation is becoming difficult and cumbersome.
ThinkQuick is offline   Reply With Quote

Old   July 26, 2012, 06:43
Default
  #4
Senior Member
 
Marion
Join Date: Jul 2012
Location: France
Posts: 117
Rep Power: 3
Marion is on a distinguished road
Have you tried the udf I gave you yesterday and it is not working? Maybe you have an issue with compiling udfs?
For the profile files, there is a section about this in the user guide, but here is a copy of a recent reply I posted on this forum:

For the profile:
you have to write it like this and save it as filename.prof:
disp_needle 2 10 0
time x
0.00000E+00 0.00000E+00
1.00000E-06 -1.20000E-07
2.00000E-06 -2.40000E-07
3.00000E-06 -3.60000E-07
4.00000E-06 -4.80000E-07
5.00000E-06 -6.00000E-07
6.00000E-06 -7.20000E-07
7.00000E-06 -8.40000E-07
8.00000E-06 -9.60000E-07
9.00000E-06 -1.08000E-06

where
*disp_needle--> name of the profile
*2 --> number of columns
*10 --> number of points
*0 --> for periodicity - 0=not periodic and 1=periodic

once you've created this file, within Fluent TUI you type
file
rtt
filename.prof
(make sure everything is in your working directory)

and then in the fluent dynamic mesh panel, choose disp_needle in the drop down list under "profile/udf".

As it is displacement vs. time the 1st column has to be time. the 2nd column can be displacement (x,y,z) velocity (v_x, v_y, v_z) , etc...

I hope this helps,

Marion.
Marion is offline   Reply With Quote

Old   May 9, 2013, 20:27
Default Simple UDF motion
  #5
New Member
 
cguerrero
Join Date: May 2013
Location: Perú
Posts: 1
Rep Power: 0
XthianGA is on a distinguished road
Like Carlos, I'm trying to impose a simple UDF for moving a body through a fluid. I require only your body moving in the X direction with a constant speed, this movement is caused by fluid entering the duct. Carlos, you could help in achieving this UDF, or guide in performing the same.

I leave a picture

Like you I would like to learn the use of profiles for transient motions .
Thanks !!
Attached Images
File Type: jpg Sin título.jpg (82.5 KB, 1 views)
XthianGA is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 121 March 7, 2013 17:21
CG Motion UDF Problem leoarmas Fluent UDF and Scheme Programming 3 August 1, 2012 06:58
Fluent UDF Discontinuous Motion lequi7 Fluent UDF and Scheme Programming 2 November 4, 2011 00:18
Grid motion with UDF fivos Fluent UDF and Scheme Programming 2 February 27, 2011 04:51
UDF error CG Motion Alex FLUENT 0 March 22, 2006 17:40


All times are GMT -4. The time now is 21:29.