CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   Adding damping to UDF (http://www.cfd-online.com/Forums/fluent-udf/98795-adding-damping-udf.html)

peatmac March 19, 2012 11:48

Adding damping to UDF
 
2 Attachment(s)
Hello,

Below is my UDF for a cylinder undergoing VIV with 2DOF -

#include "udf.h"

static real v_prev = 0.0;
static real v_prev2 = 0.0;

DEFINE_CG_MOTION(osc,dt,vel,omega,time,dtime)
{
Thread *t;
Domain *d = Get_Domain(1);
real x_cg[3], force[3], moment[3];
real accl, dv, accl2, dv2;
real mass = 181.823;
real wn = 1;
real k= mass * wn*wn;
real c = 2*mass*wn*0.00;
real c2 = 4*mass*wn*0.00;
int i;

NV_S(vel, =, 0.0);
NV_S(omega, =, 0.0);
t = DT_THREAD(dt);
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] - c2*vel[1];
force[0] += -k*x_cg[0] - c*vel[0] - c2*vel[0];

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]);

accl2 = force[0]/mass;
dv2 = accl2*dtime;
v_prev2+=dv2;
vel[0] = v_prev2;
printf("Computed force: %g \n", force[0]);
printf("Velocity: %g\n", vel[0]);
}


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

END

So far this UDF is producing some reasonable results for me, however I want to include structural and fluid damping. Please refer to the two attached images. Currently the cylinder is oscillating under the governing equations in image 1. Is it possible to write a UDF to allow the cylinders to freely oscillate, using the equations in image 2 (in the dimensionless state).
By allowing the cylinders to oscillate under these equations this will introduce structural damping, am I right? Also how would I include fluid damping?

Many thanks in advance.

Peter

colopolo70 April 23, 2012 21:34

Quote:

Originally Posted by peatmac (Post 350234)
Hello,

Below is my UDF for a cylinder undergoing VIV with 2DOF -

#include "udf.h"

static real v_prev = 0.0;
static real v_prev2 = 0.0;

DEFINE_CG_MOTION(osc,dt,vel,omega,time,dtime)
{
Thread *t;
Domain *d = Get_Domain(1);
real x_cg[3], force[3], moment[3];
real accl, dv, accl2, dv2;
real mass = 181.823;
real wn = 1;
real k= mass * wn*wn;
real c = 2*mass*wn*0.00;
real c2 = 4*mass*wn*0.00;
int i;

NV_S(vel, =, 0.0);
NV_S(omega, =, 0.0);
t = DT_THREAD(dt);
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] - c2*vel[1];
force[0] += -k*x_cg[0] - c*vel[0] - c2*vel[0];

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]);

accl2 = force[0]/mass;
dv2 = accl2*dtime;
v_prev2+=dv2;
vel[0] = v_prev2;
printf("Computed force: %g \n", force[0]);
printf("Velocity: %g\n", vel[0]);
}


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

END

So far this UDF is producing some reasonable results for me, however I want to include structural and fluid damping. Please refer to the two attached images. Currently the cylinder is oscillating under the governing equations in image 1. Is it possible to write a UDF to allow the cylinders to freely oscillate, using the equations in image 2 (in the dimensionless state).
By allowing the cylinders to oscillate under these equations this will introduce structural damping, am I right? Also how would I include fluid damping?

Many thanks in advance.

Peter

Hi, I also have similar problem. Could you kindly let me know how to compute displacement of cylinder in your udf?

Have a nice day.

saurav2012 August 7, 2012 02:17

hi , have u soved the above udf and validated the results with some journal ???


All times are GMT -4. The time now is 00:06.