CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   vortex induced vibration (http://www.cfd-online.com/Forums/fluent/88129-vortex-induced-vibration.html)

Simon Wang May 9, 2011 10:47

vortex induced vibration
 
Hi, everybody
I'am do a numerical simulation of vortex induced vibration use fluent 6.3.But I met some very stange problems, if I use boundary layer in mesh, the cylinder amplitude is much too high and fore exerted on cylinder is also larger than normal level. If I don't use boundary layer in my mesh, the mesh near to the cylinder became very bad in simulation.
So is there anybody can help me, I have been stuck by this problem for months.

Here is the full text of my UDF.
#include <stdio.h>
#include "udf.h"
# define UDF_FILENAME "udf_loc_velo_acc"
# define Temp_File "mytemp"

/* read current location,velocity and accelerator from file */
static void
read_loc_vel_acc_file (real *loc1, real *vel1,real *acc1)
{
FILE *fp = fopen(Temp_File, "r");
if (fp != NULL)
{
float read_loc1, read_vel1, read_acc1;
fscanf (fp, "%e %e %e", &read_loc1, &read_vel1, &read_acc1);
fclose (fp);
*loc1 = (real) read_loc1;
*vel1 = (real) read_vel1;
*acc1=(real) read_acc1;
Message ("\nUDF read viv: y_vel = %f, acc = %f, loc(m)= %f\n",
*vel1, *acc1, *loc1);
}
else
{
*loc1 = 0.0;
*vel1 = 0.0;
*acc1 = 0.0;
Message("\nThe first reading of udf_loc_vel_acc_file\n");
}
}
/* write current location, velocity and acceleration into file */
static void
write_loc_vel_acc_file (real loc, real vel, real acc)
{
FILE *fp = fopen(UDF_FILENAME, "a");
if (fp != NULL)
{
fprintf (fp, "%e %e %e\n", loc, vel, acc);
fclose (fp);
}
else
Message ("\nWarning: cannot write %s file", UDF_FILENAME);
}
/* write current location,velocity and acceleration into temp_file */
static void
write_loc_vel_acc_file2 (real loc, real vel, real acc)
{
FILE *fp = fopen(Temp_File, "w");
if (fp != NULL)
{
fprintf (fp, "%e %e %e\n", loc, vel, acc);
fclose (fp);
}
else
Message ("\nWarning: cannot write %s file", Temp_File);
}
DEFINE_CG_MOTION(viv, dt, cg_vel, cg_omega, time, dtime)
{
#define DELTA 0.5
#define BETA 0.25
#define K_SPRING 22.406
#define MASS 4.864
#define xi 0.0054
real wn=sqrt(K_SPRING/MASS);
real CC=2*xi*wn*MASS;
/*fn=2.92745*/
/*mass ratio equaul 2.4*/
real loc,vel,acc,loc1,vel1,acc1;
real a0,a1,a2,a3,a4,a5,a6,a7,keff,reff;
static int id1=5; /* Face ID of the cylinder */
static real f_glob[3]; /* Total forces (global) */
static real m_glob[3]; /* Moment (global) */
static real x_cg[3]; /* CG location */
static real force[3];
int i=0;
Thread *tf1;
Domain *domain = Get_Domain(1);
tf1 = Lookup_Thread(domain, id1);
a0=1/(BETA*dtime*dtime);
a1=DELTA/(BETA*dtime);
a2=1/(BETA*dtime);
a3=0.5/BETA-1;
a4=DELTA/BETA-1;
a5=0.5*dtime*(DELTA/BETA-2);
a6=dtime*(1-DELTA);
a7=DELTA*dtime;
keff=a0*MASS+a1*CC+K_SPRING;
/* reset velocities */
NV_S (cg_vel, =, 0.0);
NV_S (cg_omega, =, 0.0);
if (!Data_Valid_P ())
return;

/* Get CG position */
for (i=0; i<ND_ND; i++) x_cg[i] = DT_CG(dt)[i];
/* compute force on cylinder */
force[1] = 0.0;
Compute_Force_And_Moment(domain, tf1, x_cg, f_glob, m_glob, TRUE);
for (i=0; i<ND_ND; i++)
{
force[i] = f_glob[i];
}

/*read data calculated in the former step*/
read_loc_vel_acc_file (&loc1, &vel1, &acc1);
/* compute response of cylinder by newmark method*/

reff=force[1]+MASS*(a0*loc1+a2*vel1+a3*acc1)+CC*(a1*loc1+a4*vel 1+a5*acc1);
loc=reff/keff;
acc=a0*(loc-loc1)-a2*vel1-a3*acc1;
vel=vel1+a6*acc1+a7*acc;

Message ("\nUDF of viv: time = %f, y_vel = %f, acc = %f, loc(m)= %f\n",
time, vel, acc, loc);
write_loc_vel_acc_file (loc, vel, acc);
write_loc_vel_acc_file2 (loc, vel, acc);
cg_vel[1] = vel;
}

sham83 May 31, 2011 02:18

Could you describe your error in more detail. What do you actually mena by BL here? Also how do you assign the UDF to your dynamic mesh?

colopolo October 11, 2011 03:17

Quote:

Originally Posted by Simon Wang (Post 306831)
Hi, everybody
I'am do a numerical simulation of vortex induced vibration use fluent 6.3.But I met some very stange problems, if I use boundary layer in mesh, the cylinder amplitude is much too high and fore exerted on cylinder is also larger than normal level. If I don't use boundary layer in my mesh, the mesh near to the cylinder became very bad in simulation.
So is there anybody can help me, I have been stuck by this problem for months.

Here is the full text of my UDF.
#include <stdio.h>
#include "udf.h"
# define UDF_FILENAME "udf_loc_velo_acc"
# define Temp_File "mytemp"

/* read current location,velocity and accelerator from file */
static void
read_loc_vel_acc_file (real *loc1, real *vel1,real *acc1)
{
FILE *fp = fopen(Temp_File, "r");
if (fp != NULL)
{
float read_loc1, read_vel1, read_acc1;
fscanf (fp, "%e %e %e", &read_loc1, &read_vel1, &read_acc1);
fclose (fp);
*loc1 = (real) read_loc1;
*vel1 = (real) read_vel1;
*acc1=(real) read_acc1;
Message ("\nUDF read viv: y_vel = %f, acc = %f, loc(m)= %f\n",
*vel1, *acc1, *loc1);
}
else
{
*loc1 = 0.0;
*vel1 = 0.0;
*acc1 = 0.0;
Message("\nThe first reading of udf_loc_vel_acc_file\n");
}
}
/* write current location, velocity and acceleration into file */
static void
write_loc_vel_acc_file (real loc, real vel, real acc)
{
FILE *fp = fopen(UDF_FILENAME, "a");
if (fp != NULL)
{
fprintf (fp, "%e %e %e\n", loc, vel, acc);
fclose (fp);
}
else
Message ("\nWarning: cannot write %s file", UDF_FILENAME);
}
/* write current location,velocity and acceleration into temp_file */
static void
write_loc_vel_acc_file2 (real loc, real vel, real acc)
{
FILE *fp = fopen(Temp_File, "w");
if (fp != NULL)
{
fprintf (fp, "%e %e %e\n", loc, vel, acc);
fclose (fp);
}
else
Message ("\nWarning: cannot write %s file", Temp_File);
}
DEFINE_CG_MOTION(viv, dt, cg_vel, cg_omega, time, dtime)
{
#define DELTA 0.5
#define BETA 0.25
#define K_SPRING 22.406
#define MASS 4.864
#define xi 0.0054
real wn=sqrt(K_SPRING/MASS);
real CC=2*xi*wn*MASS;
/*fn=2.92745*/
/*mass ratio equaul 2.4*/
real loc,vel,acc,loc1,vel1,acc1;
real a0,a1,a2,a3,a4,a5,a6,a7,keff,reff;
static int id1=5; /* Face ID of the cylinder */
static real f_glob[3]; /* Total forces (global) */
static real m_glob[3]; /* Moment (global) */
static real x_cg[3]; /* CG location */
static real force[3];
int i=0;
Thread *tf1;
Domain *domain = Get_Domain(1);
tf1 = Lookup_Thread(domain, id1);
a0=1/(BETA*dtime*dtime);
a1=DELTA/(BETA*dtime);
a2=1/(BETA*dtime);
a3=0.5/BETA-1;
a4=DELTA/BETA-1;
a5=0.5*dtime*(DELTA/BETA-2);
a6=dtime*(1-DELTA);
a7=DELTA*dtime;
keff=a0*MASS+a1*CC+K_SPRING;
/* reset velocities */
NV_S (cg_vel, =, 0.0);
NV_S (cg_omega, =, 0.0);
if (!Data_Valid_P ())
return;

/* Get CG position */
for (i=0; i<ND_ND; i++) x_cg[i] = DT_CG(dt)[i];
/* compute force on cylinder */
force[1] = 0.0;
Compute_Force_And_Moment(domain, tf1, x_cg, f_glob, m_glob, TRUE);
for (i=0; i<ND_ND; i++)
{
force[i] = f_glob[i];
}

/*read data calculated in the former step*/
read_loc_vel_acc_file (&loc1, &vel1, &acc1);
/* compute response of cylinder by newmark method*/

reff=force[1]+MASS*(a0*loc1+a2*vel1+a3*acc1)+CC*(a1*loc1+a4*vel 1+a5*acc1);
loc=reff/keff;
acc=a0*(loc-loc1)-a2*vel1-a3*acc1;
vel=vel1+a6*acc1+a7*acc;

Message ("\nUDF of viv: time = %f, y_vel = %f, acc = %f, loc(m)= %f\n",
time, vel, acc, loc);
write_loc_vel_acc_file (loc, vel, acc);
write_loc_vel_acc_file2 (loc, vel, acc);
cg_vel[1] = vel;
}

Did you solve your problems of udf file?
Please let me know the solution of your problem.

Thanks

qing123 June 17, 2012 05:22

Hi Simon Wang:
Have you already solved your problem, I am currently doing some simulation like yours. Could you exchange with me through email? My email address is zhangguoqing@ntu.edu.sg


All times are GMT -4. The time now is 04:10.