CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Negative volumes when using UDF in VIV in a cylinder (https://www.cfd-online.com/Forums/fluent-udf/93438-negative-volumes-when-using-udf-viv-cylinder.html)

 w-coche October 16, 2011 01:42

Negative volumes when using UDF in VIV in a cylinder

2 Attachment(s)
Hello all,

I am trying to solve the VIV case in a cylinder when Re=100 in Fluent 6.3. I have the solution when the cylinder is at rest, and my results are accurate. However, my problems appear when I try to use an UDF. When it is iterating, it stops because negative volumes appear. I do not know what I am doing wrong. My udf that I am using is one that I found on Internet:

#include "udf.h"

static real v_prev = 0.0;

DEFINE_CG_MOTION(osc,dt,vel,omega,time,dtime)
{
Domain *d = Get_Domain(1);
real x_cg[3], force[3], moment[3];
real accl, dv;
real mass = 0.2;
real wn = 12.0;
real k= mass * wn*wn;
real c = 2*mass*wn*0.00;
int i;

NV_S(vel, =, 0.0);
NV_S(omega, =, 0.0);
for(i=0;i<3;i++)
x_cg[i]=DT_CG(dt)[i];

Compute_Force_And_Moment(d, t, x_cg, force, moment, TRUE);
force[1] += -k*x_cg[1] - c*vel[1];

accl = force[1]/mass;
dv = accl*dtime;
v_prev+=dv;
vel[1] = v_prev;
printf("Computed force: %g \n", force[1]);
printf("Velocity: %g\n", vel[1]);
}

DEFINE_CG_MOTION(osc_inert,dt,vel,omega,time,dtime )
{
vel[0] = 0.0;
vel[1] = v_prev;
}

My parameters are based on smoothing and remeshing, and I am hooking osc to my cylinder. Here is attached my mesh. Please I need your help because I do not know if I need to change the mesh or I need to change some of the parameters.

Thanks,

Willy

 qing123 May 31, 2012 12:34

Hi:
Have u solve your problem regarding the negative grid? Could u tell me? Tks.

 Jessica.S June 1, 2012 04:06

You need to define another fluid zone which surrounds your body and moves with it...
Can you send me your case & mesh (jessica.simberg@gmail.com)?

 Faby June 4, 2012 06:47