Register Blogs Members List Search Today's Posts Mark Forums Read

March 19, 2012, 11:48
#1
New Member

Peter
Join Date: Jan 2012
Posts: 29
Rep Power: 5
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)
{
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);
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?

Peter
Attached Images
 1.png (34.6 KB, 73 views) 2.png (28.4 KB, 52 views)

April 23, 2012, 21:34
#2
New Member

Join Date: Oct 2009
Posts: 2
Rep Power: 0
Quote:
 Originally Posted by peatmac 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.

 August 7, 2012, 02:17 #3 New Member   saurav Join Date: Jul 2012 Posts: 2 Rep Power: 0 hi , have u soved the above udf and validated the results with some journal ???

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post stickjohnson ANSYS 0 January 25, 2012 04:49 shahri20 FLUENT 0 November 29, 2011 06:03 Long Sang FLUENT 1 June 23, 2008 07:44 Sam Liu FLUENT 1 November 2, 2005 00:59 ROOZBEH FLUENT 4 May 29, 2003 09:54

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