## Fluids

#### UDF motion vs displacement

TAGGED: ,

• sidjou
Subscriber

Hi,

I'm using an udf file to put a plate in motion. I'm interested in the position of the plate. From the collected position of the plate, i noticed that at t=0, the plate is not exactly at the known center of gravity of 6.25e-5 m and the plate has the same position (1.23e-4 m) for 2 consecutive times step (24 & 25).

How can i correct it please? I want to have the exact known center of gravity (6.25e-5 m) at t=0 and expect different position at time step 24 and 25. Below are the report of the plate position and the udf code. Thanks!

/* UDF for specifying a sinusoidal motion */

#include "udf.h"

#define amp RP_Get_Input_Parameter("amplitudeid")
#define freq RP_Get_Input_Parameter("frequencyid")
#define angular_freq 2.0*M_PI*freq

DEFINE_CG_MOTION(movingplate, dt, cg_vel, cg_omega, time, dtime)
{
real disp;

disp = amp*angular_freq*cos(angular_freq*time); /*displacement speed*/

cg_vel [0] = 0.0;
cg_vel [1] = 0.0;
cg_vel [2] = disp;

cg_omega [0] = 0.0;
cg_omega [1] = 0.0;
cg_omega [2] = 0.0;
}

• Federico Alzamora Previtali
Subscriber

Hello,

for your first question, are you using single or double precision for your simulation? You can find out by looking at the very top of your Fluent window and looking for "dp" (double precision). If you're running on single precision, it may affect the precision of the data that you are writing to file.

Regarding your second question, is it possible that at time step 24, your velocity cg_vel[2] is exactly zero? i.e. angular_freq*time = pi/2?

I hope this helps!

Federico

• Federico Alzamora Previtali
Subscriber

25000 RPM would yield exactly 0 at that time. I would suggest changing the time step a little bit to avoid such situation where your plate has zero velocity at a particular time step.

• sidjou
Subscriber