|
[Sponsors] |
March 19, 2012, 11:48 |
Adding damping to UDF
|
#1 |
New Member
Peter
Join Date: Jan 2012
Posts: 29
Rep Power: 14 |
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 |
|
April 23, 2012, 22:34 |
|
#2 | |
New Member
Join Date: Oct 2009
Posts: 2
Rep Power: 0 |
Quote:
Have a nice day. |
||
August 7, 2012, 03: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 ???
|
|
February 23, 2016, 23:49 |
|
#4 | |
Member
N B Khan
Join Date: Jan 2014
Posts: 39
Rep Power: 12 |
Quote:
I am also looking for the same code,, IF you found the solution please share it... Thanks alot Regards, Niaz |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
HELP! adding a mass source to VOF eqn. by UDF??? | ROOZBEH | FLUENT | 5 | December 3, 2016 18:53 |
error about adding Constant damping coefficient | stickjohnson | ANSYS | 0 | January 25, 2012 04:49 |
adding Au (A is a constant) term to the momentum equation via udf | shahri20 | FLUENT | 0 | November 29, 2011 06:03 |
Adding Van der Waals force by coding UDF | Long Sang | FLUENT | 1 | June 23, 2008 08:44 |
How to adding source in UDF? | Sam Liu | FLUENT | 1 | November 2, 2005 00:59 |