CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   pls check this c program (https://www.cfd-online.com/Forums/main/16101-pls-check-c-program.html)

bestrcsekhar December 7, 2008 07:32

pls check this c program
 
#include "udf.h"

static real v_prev = 0.0;

static real A = 0.00009;

static real f = 1;

DEFINE_CG_MOTION(piston,dt,vel,omega,time,dtime)

{

/* reset velocities */

NV_S(vel, =, 0.0);

NV_S(omega, =, 0.0);

if (!Data_Valid_P())

return;

/* equation of velocity */

v_prev = 2*3.142*A*f*sin(2*3.142*f*time+3.142/2);

/* set x-component of velocity */

vel[0] = v_prev;

}

can u tell me the mistake in it

Steve December 8, 2008 05:34

Re: pls check this c program
 
which 1 do u wont, the 1st or last?????

bestrcsekhar December 8, 2008 07:43

Re: pls check this c program
 
when i am using this i am getting an an phase error in second line

and also in the equation


All times are GMT -4. The time now is 12:46.