UDF for 2d translational motion
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?
This is a udf for X-velocity (3D)
DEFINE_CG_MOTION(velo_needle, dt, cg_vel, cg_omega, time, dtime)
cg_vel = -0.6; /* x-velocity*/
cg_vel = 0.0;
cg_vel = 0.0;
NV_S (cg_omega, =, 0.0); /* no angular motion */
/* Messages in Fluent TUI */
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 :D
'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.
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
*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
(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,
Simple UDF motion
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 :).
I am trying to use profile by entering the velocity_y and time data points from matlab using step time as 0.000041667s. To get the rigid body motion as needed.
I use the layering - dynamic mesh type
When I see the zone motion - preview it work 254mm distance in 60millisec(30 millisec it move remaining 30 ms it zero velocity.)
But when i try mesh motion - preview - it moves little bit only.. not 254mmm for same time steps.
can you tell what may be issue with mesh notion
. I tried the UDF but it shows error: warning unable to read the udf file
DEFINE_CG_MOTION(oscillate, dt, vel, omega, time, dtime)
face_t f; /* define the variables */
t = DT_THREAD(dt); /* get the thread pointer for which the motion is defined */
/* if (!Data_Valid_P())
/* return; /* check if the values of the variables are accessible before you compute the function */
begin_f_loop(f, t) /* loop over each face in the zone to create an array of data */
if (time <= 0.02)
vel = (673* time); /* define the velocity of the moving zone---*/
else if (0.02 < time < 0.027)
vel = 14;
else if (0.027 < time < 0.03)
vel = 3 - 2800*(time-0.03);
else if (0.03 < time)
vel = 0;
|All times are GMT -4. The time now is 12:42.|