CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   cg motion profile (https://www.cfd-online.com/Forums/fluent-udf/229191-cg-motion-profile.html)

Duke711 July 30, 2020 10:50

cg motion profile
 
what is wrong?
the wall only rotate in positive vector, the motion profile is not working?


#include "udf.h"

static real omega1 = 0.0;

DEFINE_CG_MOTION(box,dt,vel,omega,time,dtime)
{
NV_S(vel, =, 0.0);
NV_S(omega, =, 0.0);

if (time > 0)
omega1 = 0.8726 * time;
else if (time > 1.4)
omega1 = 0;
else if (time > 5.4 < 6.8)
omega1 = -0.8726 * time;
else
omega1 = 0;

omega[1] = omega1;
Message ("time =%f, omega[1] = %f\n", time, omega[1]);
}

Duke711 July 30, 2020 15:42

Problem solved:




#include "udf.h"

static real omega1 = 0.0;

DEFINE_CG_MOTION(box,dt,vel,omega,time,dtime)
{
NV_S(vel, =, 0.0);
NV_S(omega, =, 0.0);

if (time >= 6.8)
omega1 = 0;
else if (time > 5.4)
omega1 = -0.8726 * (time -5.4);
else if (time > 1.4)
omega1 = 0;
else
omega1 = 0.8726 * time;

omega[1] = omega1;
Message ("time =%f, omega[1] = %f\n", time, omega[1]);
{


All times are GMT -4. The time now is 09:53.