CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   tank motion on boat (http://www.cfd-online.com/Forums/fluent/44789-tank-motion-boat.html)

Tim May 23, 2007 11:50

tank motion on boat
 
Hi I would like to model a solid tank motion filled with fluid. This tank is on a boat. I create an UDF to describe the motion of the tank but when I want to load it in Define->Dynamic Mesh->Zones. Fluent warns me: incorrect grid motion UDF cuve::libudf on zone 2 (assuming no motion)

So I suppose that my udf file is bad but I don't know how to correct it.

My UDF:

#include "udf.h"

real hs=-0.786; real thetamax=3; real pulsation=0.1; real theta; DEFINE_CG_MOTION(cuve,dt,vel,omega,time,dtime) { Thread *t; /* reset velocities */ NV_S(vel, =, 0.0); NV_S(omega, =, 0.0); if (!Data_Valid_P()) return; /* get the thread pointer for which this motion is defined */ t = DT_THREAD(dt);

theta=thetamax*sin(pulsation*time); omega[0]=theta/dtime; vel[0]=hs*sin(theta)/dtime; vel[1]=hs*sin(theta)/dtime; Message ("time = %f, x_vel = %f, y_vel=%f,rotation=%f\n", time, vel[0], vel[1], omega[0] ); }

Or do you have any other ideas to model this motion on Fluent??

Can you help me? thanks in advance Tim


All times are GMT -4. The time now is 18:30.